@mudrichenkoevgeny/shared-foundation 0.0.48 → 0.0.50

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 (5) hide show
  1. package/README.md +37 -4
  2. package/index.d.ts +756 -186
  3. package/index.js +1007 -139
  4. package/index.mjs +1007 -139
  5. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ export type Instant = number;
4
+
3
5
  export type PermissionCode = string & { readonly __brand: 'PermissionCode' };
4
6
  export function toPermissionCodeOrNull(value: string | null | undefined): PermissionCode | null;
5
7
  export function toPermissionCodeOrThrow(value: string): PermissionCode;
@@ -30,6 +32,36 @@
30
32
  export function toClientDeviceIdOrThrow(value: string): ClientDeviceId;
31
33
  export const clientDeviceIdSchema: z.ZodType<ClientDeviceId>;
32
34
 
35
+ export type DecryptedString = string & { readonly __brand: 'DecryptedString' };
36
+ export function toDecryptedStringOrNull(value: string | null | undefined): DecryptedString | null;
37
+ export function toDecryptedStringOrThrow(value: string): DecryptedString;
38
+ export const decryptedStringSchema: z.ZodType<DecryptedString>;
39
+
40
+ export type EncryptedString = string & { readonly __brand: 'EncryptedString' };
41
+ export function toEncryptedStringOrNull(value: string | null | undefined): EncryptedString | null;
42
+ export function toEncryptedStringOrThrow(value: string): EncryptedString;
43
+ export const encryptedStringSchema: z.ZodType<EncryptedString>;
44
+
45
+ export type PasswordHash = string & { readonly __brand: 'PasswordHash' };
46
+ export function toPasswordHashOrNull(value: string | null | undefined): PasswordHash | null;
47
+ export function toPasswordHashOrThrow(value: string): PasswordHash;
48
+ export const passwordHashSchema: z.ZodType<PasswordHash>;
49
+
50
+ export type AccessToken = string & { readonly __brand: 'AccessToken' };
51
+ export function toAccessTokenOrNull(value: string | null | undefined): AccessToken | null;
52
+ export function toAccessTokenOrThrow(value: string): AccessToken;
53
+ export const accessTokenSchema: z.ZodType<AccessToken>;
54
+
55
+ export type RefreshToken = string & { readonly __brand: 'RefreshToken' };
56
+ export function toRefreshTokenOrNull(value: string | null | undefined): RefreshToken | null;
57
+ export function toRefreshTokenOrThrow(value: string): RefreshToken;
58
+ export const refreshTokenSchema: z.ZodType<RefreshToken>;
59
+
60
+ export type RefreshTokenHash = string & { readonly __brand: 'RefreshTokenHash' };
61
+ export function toRefreshTokenHashOrNull(value: string | null | undefined): RefreshTokenHash | null;
62
+ export function toRefreshTokenHashOrThrow(value: string): RefreshTokenHash;
63
+ export const refreshTokenHashSchema: z.ZodType<RefreshTokenHash>;
64
+
33
65
  export declare const ManagementRoutes: {
34
66
  readonly BASE_MANAGEMENT_ROUTE: "/management";
35
67
  };
@@ -80,6 +112,14 @@ readonly LOGIN_BY_TOTP: "/management/auth/login/totp";
80
112
  readonly LOGIN_BY_TOTP_RECOVERY_CODE: "/management/auth/login/totp-recovery-code";
81
113
  };
82
114
 
115
+ export declare const OpenRefreshTokenRoutes: {
116
+ readonly REFRESH_TOKEN: "/auth/refresh";
117
+ };
118
+
119
+ export declare const SelfManagementRefreshTokenRoutes: {
120
+ readonly REFRESH_TOKEN: "/management/auth/refresh";
121
+ };
122
+
83
123
  export declare const OpenRegisterRoutes: {
84
124
  readonly REGISTER_BY_EMAIL_ROUTE: "/auth/register/email";
85
125
  readonly REGISTER_BY_EMAIL: "/auth/register/email";
@@ -228,6 +268,18 @@ readonly UPDATE_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings";
228
268
  readonly RESET_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings/reset";
229
269
  };
230
270
 
271
+ export declare const OpenAuthSettingsRoutes: {
272
+ readonly GET_OPEN_AUTH_SETTINGS: "/auth/settings";
273
+ };
274
+
275
+ export declare const OpenUserConfigurationRoutes: {
276
+ readonly GET_CONFIGURATION: "user-configuration";
277
+ };
278
+
279
+ export declare const ManagementUserConfigurationRoutes: {
280
+ readonly GET_CONFIGURATION: "/management/user-configuration";
281
+ };
282
+
231
283
  export declare const CommonApiFields: {
232
284
  readonly ITEMS: "items";
233
285
  readonly TOTAL_COUNT: "total_count";
@@ -419,6 +471,72 @@ readonly MANAGEMENT_SECURITY_SETTINGS_UPDATED: "MANAGEMENT_SECURITY_SETTINGS_UPD
419
471
  readonly MANAGEMENT_GLOBAL_SETTINGS_UPDATED: "MANAGEMENT_GLOBAL_SETTINGS_UPDATED";
420
472
  };
421
473
 
474
+ export declare const UserWebSocketCloseReasons: {
475
+ readonly AUTH_FAILED: "Auth failed";
476
+ readonly SESSION_EXPIRED: "Session expired";
477
+ readonly SESSION_DELETED: "Session deleted";
478
+ readonly USER_BANNED: "User banned";
479
+ };
480
+
481
+ export declare const UserWebSocketEventTypes: {
482
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
483
+ readonly OPEN_AUTH_SETTINGS_UPDATED: "OPEN_AUTH_SETTINGS_UPDATED";
484
+ readonly MANAGEMENT_AUTH_SETTINGS_UPDATED: "MANAGEMENT_AUTH_SETTINGS_UPDATED";
485
+ readonly USER_UPDATED: "USER_UPDATED";
486
+ readonly SESSION_DELETED: "SESSION_DELETED";
487
+ };
488
+
489
+ export declare const UserApiPaths: {
490
+ readonly USER_ID: "user_id";
491
+ readonly SESSION_ID: "session_id";
492
+ readonly USER_IDENTIFIER_ID: "user_identifier_id";
493
+ };
494
+
495
+ export declare const UserApiQueryParams: {
496
+ readonly ACCESS_TOKEN: "token";
497
+ };
498
+
499
+ export declare const UserAuthSpec: {
500
+ readonly TOKEN_TYPE_BEARER: "Bearer";
501
+ };
502
+
503
+ export declare const AuditApiPaths: {
504
+ readonly EVENT_ID: "event_id";
505
+ };
506
+
507
+ export declare const UserRoleDefaultAuthorityLevel: {
508
+
509
+ };
510
+
511
+ export declare const SecurityAuditMetadataDeniedReasonValues: {
512
+ readonly RATE_LIMIT: "rate_limit";
513
+ readonly PASSWORD_TOO_WEAK: "password_too_weak";
514
+ readonly MFA_TOKEN_EXPIRED: "mfa_token_expired";
515
+ readonly TOTP_ALREADY_ENABLED: "totp_already_enabled";
516
+ readonly TOTP_NOT_ENABLED: "totp_not_enabled";
517
+ readonly RECOVERY_CODE_ALREADY_USED: "recovery_code_already_used";
518
+ readonly MFA_REQUIRED: "mfa_required";
519
+ };
520
+
521
+ export declare const UserAuditMetadataDeniedReasonValues: {
522
+ readonly USER_READ_ONLY: "user_read_only";
523
+ readonly USER_BANNED: "user_banned";
524
+ readonly USER_LOCKED: "user_locked";
525
+ readonly USER_SECURITY_HOLD: "user_security_hold";
526
+ readonly USER_PENDING_DELETION: "user_pending_deletion";
527
+ readonly USER_NOT_FOUND: "user_not_found";
528
+ readonly USER_ROLE_NOT_ALLOWED: "user_role_not_allowed";
529
+ readonly USER_MISSING_PERMISSIONS: "user_missing_permissions";
530
+ readonly USER_INSUFFICIENT_AUTHORITY_LEVEL: "user_insufficient_authority_level";
531
+ readonly USER_ILLEGAL_ACCOUNT_STATUS: "user_illegal_account_status";
532
+ readonly USER_FORBIDDEN: "user_forbidden";
533
+ readonly USER_IDENTIFIER_LIMIT_REACHED: "user_identifier_limit_reached";
534
+ readonly TOTAL_USER_IDENTIFIERS_LIMIT_REACHED: "total_user_identifier_limit_reached";
535
+ readonly PASSWORD_SETUP_REQUIRED: "password_setup_required";
536
+ readonly USER_IDENTIFIER_PASSWORD_NOT_SUPPORTED: "user_identifier_password_not_supported";
537
+ readonly USER_IDENTIFIER_PASSWORD_NOT_SET: "user_identifier_password_not_set";
538
+ };
539
+
422
540
  export declare const ListingParamNames: {
423
541
  readonly PAGE_NUMBER: "page_number";
424
542
  readonly PAGE_SIZE: "page_size";
@@ -434,6 +552,52 @@ readonly MANAGEMENT_GLOBAL_SETTINGS_UPDATED: "MANAGEMENT_GLOBAL_SETTINGS_UPDATED
434
552
  };
435
553
  };
436
554
 
555
+ export declare const AuditFilterValues: {
556
+ readonly AuditEventFilterValues: {
557
+ readonly ACTOR_ID: "actor_id";
558
+ readonly ACTOR_TYPE: "actor_type";
559
+ readonly ACTOR_USER_ROLE: "actor_user_role";
560
+ readonly ACTION: "action";
561
+ readonly RESOURCE: "resource";
562
+ readonly RESOURCE_ID: "resource_id";
563
+ readonly STATUS: "status";
564
+ readonly MESSAGE: "message";
565
+ };
566
+ };
567
+
568
+ export declare const UserFilterValues: {
569
+ readonly UserFilterValues: {
570
+ readonly ROLE: "role";
571
+ readonly ACCOUNT_STATUS: "account_status";
572
+ readonly ACCOUNT_STATUS_ON_RESTORE: "account_status_on_restore";
573
+ readonly ACCOUNT_LOCKOUT_TYPE: "account_lockout_type";
574
+ readonly AUTHORITY_LEVEL_FROM: "authority_level_from";
575
+ readonly AUTHORITY_LEVEL_TO: "authority_level_to";
576
+ readonly IS_TOTP_ENABLED: "is_totp_enabled";
577
+ readonly PERMISSION_CODES: "permission_codes";
578
+ };
579
+ readonly UserIdentifierFilterValues: {
580
+ readonly USER_ID: "user_id";
581
+ readonly USER_AUTH_PROVIDER: "user_auth_provider";
582
+ readonly IDENTIFIER: "identifier";
583
+ };
584
+ readonly UserSessionFilterValues: {
585
+ readonly USER_ID: "user_id";
586
+ readonly USER_ROLE: "user_role";
587
+ readonly IDENTIFIER_ID: "identifier_id";
588
+ readonly USER_AUTH_PROVIDER: "user_auth_provider";
589
+ readonly CLIENT_TYPE: "client_type";
590
+ readonly USER_AGENT: "user_agent";
591
+ readonly IP_ADDRESS: "ip_address";
592
+ readonly LANGUAGE: "language";
593
+ readonly DEVICE_ID: "device_id";
594
+ readonly DEVICE_NAME: "device_name";
595
+ readonly APP_VERSION: "app_version";
596
+ readonly OPERATION_SYSTEM_VERSION: "operation_system_version";
597
+ readonly IDENTIFIER: "identifier";
598
+ };
599
+ };
600
+
437
601
  export declare const CommonErrorCodes: {
438
602
  readonly UNKNOWN: "UNKNOWN";
439
603
  readonly INTERNAL: "INTERNAL";
@@ -703,6 +867,40 @@ readonly REFRESH_TOKEN_REUSE_DETECTED: 'refresh_token_reuse_detected';
703
867
  };
704
868
  export const userAuditActionTypeSchema: z.ZodType<UserAuditActionType>;
705
869
 
870
+ export type CommonAuditMetadataKey = 'device_id' | 'device_name' | 'client_type' | 'language' | 'app_version' | 'os_version' | 'user_agent' | 'key_ip_address' | 'host' | 'origin' | 'api_version' | 'trace_id' | 'denied_reason' | 'error_id' | 'error_code';
871
+ export const CommonAuditMetadataKey: {
872
+ readonly DEVICE_ID: 'device_id';
873
+ readonly DEVICE_NAME: 'device_name';
874
+ readonly CLIENT_TYPE: 'client_type';
875
+ readonly LANGUAGE: 'language';
876
+ readonly APP_VERSION: 'app_version';
877
+ readonly OS_VERSION: 'os_version';
878
+ readonly USER_AGENT: 'user_agent';
879
+ readonly IP_ADDRESS: 'key_ip_address';
880
+ readonly HOST: 'host';
881
+ readonly ORIGIN: 'origin';
882
+ readonly API_VERSION: 'api_version';
883
+ readonly TRACE_ID: 'trace_id';
884
+ readonly DENIED_REASON: 'denied_reason';
885
+ readonly ERROR_ID: 'error_id';
886
+ readonly ERROR_CODE: 'error_code';
887
+ };
888
+ export const commonAuditMetadataKeySchema: z.ZodType<CommonAuditMetadataKey>;
889
+
890
+ export type UserAuditMetadataKey = 'user_id' | 'session_id' | 'identifier_id' | 'email_address' | 'phone_number' | 'user_auth_provider' | 'external_id' | 'account_lockout_type' | 'temporary_lockout_until';
891
+ export const UserAuditMetadataKey: {
892
+ readonly USER_ID: 'user_id';
893
+ readonly SESSION_ID: 'session_id';
894
+ readonly IDENTIFIER_ID: 'identifier_id';
895
+ readonly EMAIL_ADDRESS: 'email_address';
896
+ readonly PHONE_NUMBER: 'phone_number';
897
+ readonly USER_AUTH_PROVIDER: 'user_auth_provider';
898
+ readonly EXTERNAL_ID: 'external_id';
899
+ readonly ACCOUNT_LOCKOUT_TYPE: 'account_lockout_type';
900
+ readonly TEMPORARY_LOCKOUT_UNTIL: 'temporary_lockout_until';
901
+ };
902
+ export const userAuditMetadataKeySchema: z.ZodType<UserAuditMetadataKey>;
903
+
706
904
  export type UserAccountStatus = 'active' | 'read_only' | 'banned' | 'security_hold' | 'pending_deletion';
707
905
  export const UserAccountStatus: {
708
906
  readonly ACTIVE: 'active';
@@ -807,42 +1005,414 @@ readonly MANAGEMENT: 'MANAGEMENT';
807
1005
  };
808
1006
  export const appTypeSchema: z.ZodType<AppType>;
809
1007
 
810
- export interface ConfirmationKey {
811
- readonly type: ConfirmationType;
812
- readonly identifier: string;
1008
+ export interface ConfirmationKey {
1009
+ readonly type: ConfirmationType;
1010
+ readonly identifier: string;
1011
+ }
1012
+ export const confirmationKeySchema: z.ZodType<ConfirmationKey>;
1013
+
1014
+ export interface ClientInfo {
1015
+ readonly deviceInfo: ClientDeviceInfo;
1016
+ readonly userAgent: string | null;
1017
+ readonly ipAddress: string | null;
1018
+ readonly host: string | null;
1019
+ readonly origin: string | null;
1020
+ readonly apiVersion: string | null;
1021
+ }
1022
+
1023
+ export declare const toClientInfo: (payload: ClientInfoPayload) => ClientInfo;
1024
+ export declare const toClientInfoPayload: (domain: ClientInfo) => ClientInfoPayload;
1025
+
1026
+ export interface ClientDeviceInfo {
1027
+ readonly deviceId: ClientDeviceId | null;
1028
+ readonly deviceName: string | null;
1029
+ readonly clientType: ClientType | null;
1030
+ readonly language: string | null;
1031
+ readonly appVersion: string | null;
1032
+ readonly operationSystemVersion: string | null;
1033
+ }
1034
+
1035
+ export declare const toClientDeviceInfo: (payload: ClientDeviceInfoPayload) => ClientDeviceInfo;
1036
+ export declare const toClientDeviceInfoPayload: (domain: ClientDeviceInfo) => ClientDeviceInfoPayload;
1037
+
1038
+ export interface AccountLockoutPolicy {
1039
+ readonly maxFailedPasswordAttempts: number;
1040
+ readonly maxFailedOtpAttempts: number;
1041
+ readonly maxFailedTotpAttempts: number;
1042
+ readonly failedAttemptsWindowSeconds: number;
1043
+ readonly lockoutDurationSeconds: number;
1044
+ readonly indefiniteLockoutThreshold: number;
1045
+ readonly isSelfServiceUnlockEnabled: boolean;
1046
+ }
1047
+
1048
+ export declare const toAccountLockoutPolicy: (payload: AccountLockoutPolicyPayload) => AccountLockoutPolicy;
1049
+ export declare const toAccountLockoutPolicyPayload: (domain: AccountLockoutPolicy) => AccountLockoutPolicyPayload;
1050
+
1051
+ export interface IpRestrictionPolicy {
1052
+ readonly isBlacklistEnabled: boolean;
1053
+ readonly blacklist: string[];
1054
+ readonly isWhitelistEnabled: boolean;
1055
+ readonly whitelist: string[];
1056
+ }
1057
+
1058
+ export declare const toIpRestrictionPolicy: (payload: IpRestrictionPolicyPayload) => IpRestrictionPolicy;
1059
+ export declare const toIpRestrictionPolicyPayload: (domain: IpRestrictionPolicy) => IpRestrictionPolicyPayload;
1060
+
1061
+ export interface OtpConfirmation {
1062
+ readonly retryAfterSeconds: number;
1063
+ readonly numberOfSymbols: number;
1064
+ readonly expirationSeconds: number;
1065
+ }
1066
+
1067
+ export declare const toOtpConfirmation: (payload: OtpConfirmationPayload) => OtpConfirmation;
1068
+ export declare const toOtpConfirmationPayload: (domain: OtpConfirmation) => OtpConfirmationPayload;
1069
+
1070
+ export interface ManagementPasswordPolicy {
1071
+ readonly minLength: number;
1072
+ readonly requireLetter: boolean;
1073
+ readonly requireUpperCase: boolean;
1074
+ readonly requireLowerCase: boolean;
1075
+ readonly requireDigit: boolean;
1076
+ readonly requireSpecialChar: boolean;
1077
+ readonly commonPasswords: string[];
1078
+ }
1079
+
1080
+ export declare const toManagementPasswordPolicy: (payload: ManagementPasswordPolicyPayload) => ManagementPasswordPolicy;
1081
+ export declare const toManagementPasswordPolicyPayload: (domain: ManagementPasswordPolicy) => ManagementPasswordPolicyPayload;
1082
+
1083
+ export interface OpenPasswordPolicy {
1084
+ readonly minLength: number;
1085
+ readonly requireLetter: boolean;
1086
+ readonly requireUpperCase: boolean;
1087
+ readonly requireLowerCase: boolean;
1088
+ readonly requireDigit: boolean;
1089
+ readonly requireSpecialChar: boolean;
1090
+ }
1091
+
1092
+ export declare const toOpenPasswordPolicy: (payload: OpenPasswordPolicyPayload) => OpenPasswordPolicy;
1093
+ export declare const toOpenPasswordPolicyPayload: (domain: OpenPasswordPolicy) => OpenPasswordPolicyPayload;
1094
+
1095
+ export interface ManagementSecuritySettings {
1096
+ readonly recentAuthenticationValiditySecondsForOpenUser: number;
1097
+ readonly recentAuthenticationValiditySecondsForManagementUser: number;
1098
+ readonly passwordPolicy: ManagementPasswordPolicy;
1099
+ readonly otpConfirmation: OtpConfirmation;
1100
+ readonly accountLockoutPolicy: AccountLockoutPolicy;
1101
+ readonly accountLockoutCheckIntervalSeconds: number;
1102
+ readonly openIpRestrictionPolicy: IpRestrictionPolicy;
1103
+ readonly managementIpRestrictionPolicy: IpRestrictionPolicy;
1104
+ readonly mfaTokenExpirationSeconds: number;
1105
+ readonly maxRequestsPerPeriod: number;
1106
+ readonly rateLimitPeriodSeconds: number;
1107
+ readonly refreshTokenRotationGracePeriodSeconds: number;
1108
+ }
1109
+
1110
+ export declare const toManagementSecuritySettings: (payload: ManagementSecuritySettingsPayload) => ManagementSecuritySettings;
1111
+ export declare const toManagementSecuritySettingsPayload: (domain: ManagementSecuritySettings) => ManagementSecuritySettingsPayload;
1112
+
1113
+ export interface OpenSecuritySettings {
1114
+ readonly passwordPolicy: OpenPasswordPolicy;
1115
+ readonly otpConfirmation: OtpConfirmation;
1116
+ }
1117
+
1118
+ export declare const toOpenSecuritySettings: (payload: OpenSecuritySettingsPayload) => OpenSecuritySettings;
1119
+ export declare const toOpenSecuritySettingsPayload: (domain: OpenSecuritySettings) => OpenSecuritySettingsPayload;
1120
+
1121
+ export interface TotpRecoveryCodes {
1122
+ readonly codes: string[];
813
1123
  }
814
- export const confirmationKeySchema: z.ZodType<ConfirmationKey>;
815
-
816
- export type UserSortValues = 'created_at' | 'updated_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'expires_at';
817
-
818
- export namespace UserSortValues {
819
- export type UserSortBy = 'last_login_at' | 'last_active_at' | 'scheduled_permanent_deletion_at' | 'account_lockout_type' | 'temporary_lockout_until' | 'created_at' | 'updated_at';
820
- export const UserSortBy: {
821
- readonly LAST_LOGIN_AT: 'last_login_at';
822
- readonly LAST_ACTIVE_AT: 'last_active_at';
823
- readonly SCHEDULED_PERMANENT_DELETION_AT: 'scheduled_permanent_deletion_at';
824
- readonly ACCOUNT_LOCKOUT_TYPE: 'account_lockout_type';
825
- readonly TEMPORARY_LOCKOUT_UNTIL: 'temporary_lockout_until';
826
- readonly CREATED_AT: 'created_at';
827
- readonly UPDATED_AT: 'updated_at';
828
- };
829
1124
 
830
- export type UserIdentifierSortBy = 'created_at' | 'updated_at';
831
- export const UserIdentifierSortBy: {
832
- readonly CREATED_AT: 'created_at';
833
- readonly UPDATED_AT: 'updated_at';
834
- };
1125
+ export declare const toTotpRecoveryCodes: (payload: TotpRecoveryCodesPayload) => TotpRecoveryCodes;
1126
+ export declare const toTotpRecoveryCodesPayload: (domain: TotpRecoveryCodes) => TotpRecoveryCodesPayload;
1127
+
1128
+ export interface TotpSetup {
1129
+ readonly secretKey: string;
1130
+ readonly otpAuthUrl: string;
1131
+ readonly mfaToken: string;
1132
+ }
1133
+
1134
+ export declare const toTotpSetup: (payload: TotpSetupPayload) => TotpSetup;
1135
+ export declare const toTotpSetupPayload: (domain: TotpSetup) => TotpSetupPayload;
1136
+
1137
+ export interface VerifyTotp {
1138
+ readonly mfaToken: string;
1139
+ readonly code: string;
1140
+ }
1141
+
1142
+ export declare const toVerifyTotp: (payload: VerifyTotpPayload) => VerifyTotp;
1143
+ export declare const toVerifyTotpPayload: (domain: VerifyTotp) => VerifyTotpPayload;
1144
+
1145
+ export interface ManagementGlobalSettings {
1146
+ readonly privacyPolicyUrl: string | null;
1147
+ readonly termsOfServiceUrl: string | null;
1148
+ readonly contactSupportEmail: string | null;
1149
+ readonly minSupportedAppVersions: Record<string, string>;
1150
+ readonly isTracingEnabled: boolean;
1151
+ readonly isMetricsEnabled: boolean;
1152
+ readonly isVerboseLoggingEnabled: boolean;
1153
+ }
1154
+
1155
+ export declare const toManagementGlobalSettings: (payload: ManagementGlobalSettingsPayload) => ManagementGlobalSettings;
1156
+ export declare const toManagementGlobalSettingsPayload: (domain: ManagementGlobalSettings) => ManagementGlobalSettingsPayload;
1157
+
1158
+ export interface OpenGlobalSettings {
1159
+ readonly privacyPolicyUrl: string | null;
1160
+ readonly termsOfServiceUrl: string | null;
1161
+ readonly contactSupportEmail: string | null;
1162
+ readonly minSupportedAppVersions: Record<string, string>;
1163
+ }
1164
+
1165
+ export declare const toOpenGlobalSettings: (payload: OpenGlobalSettingsPayload) => OpenGlobalSettings;
1166
+ export declare const toOpenGlobalSettingsPayload: (domain: OpenGlobalSettings) => OpenGlobalSettingsPayload;
1167
+
1168
+ export interface AuditEvent {
1169
+ readonly id: AuditEventId;
1170
+ readonly actorId: UserId | null;
1171
+ readonly actorType: AuditActorType;
1172
+ readonly actorUserRole: UserRole | null;
1173
+ readonly action: AuditActionType;
1174
+ readonly resource: AuditResourceType;
1175
+ readonly resourceId: string | null;
1176
+ readonly resourceValueSensitivity: AuditValueSensitivity;
1177
+ readonly status: AuditStatus;
1178
+ readonly metadata: AuditEventMetadata[];
1179
+ readonly message: string | null;
1180
+ readonly createdAt: Instant;
1181
+ }
1182
+
1183
+ export declare const toAuditEvent: (payload: AuditEventPayload) => AuditEvent;
1184
+ export declare const toAuditEventPayload: (domain: AuditEvent) => AuditEventPayload;
1185
+
1186
+ export interface AuditEventMetadata {
1187
+ readonly key: AuditMetadataKey;
1188
+ readonly value: string;
1189
+ }
1190
+
1191
+ export declare const toAuditEventMetadata: (payload: AuditEventMetadataPayload) => AuditEventMetadata;
1192
+ export declare const toAuditEventMetadataPayload: (domain: AuditEventMetadata) => AuditEventMetadataPayload;
1193
+
1194
+ export interface AuthData {
1195
+ readonly userDetails: UserDetails;
1196
+ readonly sessionToken: SessionToken;
1197
+ }
1198
+
1199
+ export declare const toAuthData: (payload: AuthDataPayload) => AuthData;
1200
+ export declare const toAuthDataPayload: (domain: AuthData) => AuthDataPayload;
1201
+
1202
+ export interface AvailableAuthProviders {
1203
+ readonly primary: UserAuthProvider[];
1204
+ readonly secondary: UserAuthProvider[];
1205
+ }
1206
+
1207
+ export declare const toAvailableAuthProviders: (payload: AvailableAuthProvidersPayload) => AvailableAuthProviders;
1208
+ export declare const toAvailableAuthProvidersPayload: (domain: AvailableAuthProviders) => AvailableAuthProvidersPayload;
1209
+
1210
+ export interface ManagementAuthSettings {
1211
+ readonly availableAuthProviders: AvailableAuthProviders;
1212
+ readonly maxTotalIdentifiers: number;
1213
+ readonly maxEmailIdentifiers: number;
1214
+ readonly maxPhoneIdentifiers: number;
1215
+ readonly maxIdentifiersPerExternalProvider: number;
1216
+ readonly maxActiveSessionsForOpenUser: number;
1217
+ readonly maxActiveSessionsForManagementUser: number;
1218
+ readonly accessTokenExpirationSeconds: number;
1219
+ readonly refreshTokenExpirationSeconds: number;
1220
+ readonly accountDeletionGracePeriodSeconds: number;
1221
+ readonly accountDeletionCheckIntervalSeconds: number;
1222
+ readonly isRegistrationEnabled: boolean;
1223
+ readonly openEmailRestrictionPolicy: EmailRestrictionPolicy;
1224
+ readonly managementEmailRestrictionPolicy: EmailRestrictionPolicy;
1225
+ }
1226
+
1227
+ export declare const toManagementAuthSettings: (payload: ManagementAuthSettingsPayload) => ManagementAuthSettings;
1228
+ export declare const toManagementAuthSettingsPayload: (domain: ManagementAuthSettings) => ManagementAuthSettingsPayload;
1229
+
1230
+ export interface OpenAuthSettings {
1231
+ readonly availableAuthProviders: AvailableAuthProviders;
1232
+ readonly maxTotalIdentifiers: number;
1233
+ readonly maxEmailIdentifiers: number;
1234
+ readonly maxPhoneIdentifiers: number;
1235
+ readonly maxIdentifiersPerExternalProvider: number;
1236
+ readonly isRegistrationEnabled: boolean;
1237
+ }
1238
+
1239
+ export declare const toOpenAuthSettings: (payload: OpenAuthSettingsPayload) => OpenAuthSettings;
1240
+ export declare const toOpenAuthSettingsPayload: (domain: OpenAuthSettings) => OpenAuthSettingsPayload;
1241
+
1242
+ export interface ManagementUserConfiguration {
1243
+ readonly managementGlobalSettings: ManagementGlobalSettings;
1244
+ readonly managementSecuritySettings: ManagementSecuritySettings;
1245
+ readonly managementAuthSettings: ManagementAuthSettings;
1246
+ }
1247
+
1248
+ export declare const toManagementUserConfiguration: (payload: ManagementUserConfigurationPayload) => ManagementUserConfiguration;
1249
+ export declare const toManagementUserConfigurationPayload: (domain: ManagementUserConfiguration) => ManagementUserConfigurationPayload;
1250
+
1251
+ export interface OpenUserConfiguration {
1252
+ readonly openGlobalSettings: OpenGlobalSettings;
1253
+ readonly openSecuritySettings: OpenSecuritySettings;
1254
+ readonly openAuthSettings: OpenAuthSettings;
1255
+ }
1256
+
1257
+ export declare const toOpenUserConfiguration: (payload: OpenUserConfigurationPayload) => OpenUserConfiguration;
1258
+ export declare const toOpenUserConfigurationPayload: (domain: OpenUserConfiguration) => OpenUserConfigurationPayload;
1259
+
1260
+ export interface EmailRestrictionPolicy {
1261
+ readonly isBlacklistEnabled: boolean;
1262
+ readonly blacklist: string[];
1263
+ readonly isWhitelistEnabled: boolean;
1264
+ readonly whitelist: string[];
1265
+ }
1266
+
1267
+ export declare const toEmailRestrictionPolicy: (payload: EmailRestrictionPolicyPayload) => EmailRestrictionPolicy;
1268
+ export declare const toEmailRestrictionPolicyPayload: (domain: EmailRestrictionPolicy) => EmailRestrictionPolicyPayload;
1269
+
1270
+ export interface UserIdentifier {
1271
+ readonly id: UserIdentifierId;
1272
+ readonly userId: UserId;
1273
+ readonly userAuthProvider: UserAuthProvider;
1274
+ readonly identifier: string;
1275
+ readonly displayName: string;
1276
+ readonly externalProviderEmail: string | null;
1277
+ readonly isSensitiveValuesMasked: boolean;
1278
+ readonly createdAt: Instant;
1279
+ readonly updatedAt: Instant | null;
1280
+ }
1281
+
1282
+ export declare const toUserIdentifier: (payload: UserIdentifierPayload) => UserIdentifier;
1283
+ export declare const toUserIdentifierPayload: (domain: UserIdentifier) => UserIdentifierPayload;
1284
+
1285
+ export interface DeletedSessions {
1286
+ readonly deletedSessionIds: UserSessionId[];
1287
+ }
835
1288
 
836
- export type UserSessionSortBy = 'expires_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'created_at' | 'updated_at';
837
- export const UserSessionSortBy: {
838
- readonly EXPIRES_AT: 'expires_at';
839
- readonly LAST_ACCESSED_AT: 'last_accessed_at';
840
- readonly LAST_REAUTHENTICATED_AT: 'last_reauthenticated_at';
841
- readonly CREATED_AT: 'created_at';
842
- readonly UPDATED_AT: 'updated_at';
843
- };
1289
+ export declare const toDeletedSessions: (payload: DeletedSessionsPayload) => DeletedSessions;
1290
+ export declare const toDeletedSessionsPayload: (domain: DeletedSessions) => DeletedSessionsPayload;
1291
+
1292
+ export interface UserSession {
1293
+ readonly id: UserSessionId;
1294
+ readonly userId: UserId;
1295
+ readonly userRole: UserRole;
1296
+ readonly identifier: string;
1297
+ readonly identifierId: UserIdentifierId;
1298
+ readonly identifierDisplayName: string;
1299
+ readonly identifierAuthProvider: UserAuthProvider;
1300
+ readonly deviceInfo: ClientDeviceInfo;
1301
+ readonly userAgent: string | null;
1302
+ readonly ipAddress: string | null;
1303
+ readonly expiresAt: Instant;
1304
+ readonly lastAccessedAt: Instant;
1305
+ readonly lastReauthenticatedAt: Instant;
1306
+ readonly isSensitiveValuesMasked: boolean;
1307
+ readonly createdAt: Instant;
1308
+ readonly updatedAt: Instant | null;
1309
+ }
1310
+
1311
+ export declare const toUserSession: (payload: UserSessionPayload) => UserSession;
1312
+ export declare const toUserSessionPayload: (domain: UserSession) => UserSessionPayload;
1313
+
1314
+ export interface SessionToken {
1315
+ readonly accessToken: AccessToken;
1316
+ readonly refreshToken: RefreshToken;
1317
+ readonly expiresAt: Instant;
1318
+ readonly tokenType: string;
1319
+ readonly sessionId: UserSessionId;
1320
+ readonly identifierId: UserIdentifierId;
1321
+ }
1322
+
1323
+ export declare const toSessionToken: (payload: SessionTokenPayload) => SessionToken;
1324
+ export declare const toSessionTokenPayload: (domain: SessionToken) => SessionTokenPayload;
1325
+
1326
+ export interface UserDetails {
1327
+ readonly id: UserId;
1328
+ readonly role: UserRole;
1329
+ readonly accountStatus: UserAccountStatus;
1330
+ readonly accountStatusOnRestore: UserAccountStatus | null;
1331
+ readonly authorityLevel: number;
1332
+ readonly permissionCodes: PermissionCode[];
1333
+ readonly isTotpEnabled: boolean;
1334
+ readonly lastLoginAt: Instant | null;
1335
+ readonly lastActiveAt: Instant | null;
1336
+ readonly createdAt: Instant;
1337
+ readonly updatedAt: Instant | null;
1338
+ readonly scheduledPermanentDeletionAt: Instant | null;
1339
+ readonly lockoutType: AccountLockoutType;
1340
+ readonly temporaryLockoutUntil: Instant | null;
1341
+ }
1342
+
1343
+ export declare const toUserDetails: (payload: UserDetailsPayload) => UserDetails;
1344
+ export declare const toUserDetailsPayload: (domain: UserDetails) => UserDetailsPayload;
1345
+
1346
+ export interface UserPublic {
1347
+ readonly id: UserId;
1348
+ readonly role: UserRole;
1349
+ readonly accountStatus: UserAccountStatus;
1350
+ }
1351
+
1352
+ export declare const toUserPublic: (payload: UserPublicPayload) => UserPublic;
1353
+ export declare const toUserPublicPayload: (domain: UserPublic) => UserPublicPayload;
1354
+
1355
+ export type AuditActionType = SecurityAuditActionType | SettingsAuditActionType | UserAuditActionType | string;
1356
+ export type AuditMetadataKey = CommonAuditMetadataKey | UserAuditMetadataKey | string;
1357
+ export type AuditResourceType = CommonAuditResourceType | SecurityAuditResourceType | SettingsAuditResourceType | UserAuditResourceType | string;
1358
+
1359
+ export interface AuditActionTypeParser {
1360
+ parseOrNull(value: string): AuditActionType | null;
1361
+ }
1362
+
1363
+ export interface AuditMetadataKeyParser {
1364
+ parseOrNull(value: string): AuditMetadataKey | null;
844
1365
  }
845
1366
 
1367
+ export interface AuditResourceTypeParser {
1368
+ parseOrNull(value: string): AuditResourceType | null;
1369
+ }
1370
+
1371
+ export declare class CompositeAuditActionTypeParser {
1372
+ constructor(auditActionTypes: Array<((value: string) => AuditActionType | null) | AuditActionTypeParser>);
1373
+ fromValueOrThrow(value: string): AuditActionType;
1374
+ }
1375
+
1376
+ export declare class CompositeAuditMetadataKeyParser {
1377
+ constructor(metadataKeys: Array<((value: string) => AuditMetadataKey | null) | AuditMetadataKeyParser>);
1378
+ fromValueOrThrow(value: string): AuditMetadataKey;
1379
+ }
1380
+
1381
+ export declare class CompositeAuditResourceTypeParser {
1382
+ constructor(auditResourceTypes: Array<((value: string) => AuditResourceType | null) | AuditResourceTypeParser>);
1383
+ fromValueOrThrow(value: string): AuditResourceType;
1384
+ }
1385
+
1386
+ export type UserSortValues = 'created_at' | 'updated_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'expires_at';
1387
+
1388
+ export namespace UserSortValues {
1389
+ export type UserSortBy = 'last_login_at' | 'last_active_at' | 'scheduled_permanent_deletion_at' | 'account_lockout_type' | 'temporary_lockout_until' | 'created_at' | 'updated_at';
1390
+ export const UserSortBy: {
1391
+ readonly LAST_LOGIN_AT: 'last_login_at';
1392
+ readonly LAST_ACTIVE_AT: 'last_active_at';
1393
+ readonly SCHEDULED_PERMANENT_DELETION_AT: 'scheduled_permanent_deletion_at';
1394
+ readonly ACCOUNT_LOCKOUT_TYPE: 'account_lockout_type';
1395
+ readonly TEMPORARY_LOCKOUT_UNTIL: 'temporary_lockout_until';
1396
+ readonly CREATED_AT: 'created_at';
1397
+ readonly UPDATED_AT: 'updated_at';
1398
+ };
1399
+
1400
+ export type UserIdentifierSortBy = 'created_at' | 'updated_at';
1401
+ export const UserIdentifierSortBy: {
1402
+ readonly CREATED_AT: 'created_at';
1403
+ readonly UPDATED_AT: 'updated_at';
1404
+ };
1405
+
1406
+ export type UserSessionSortBy = 'expires_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'created_at' | 'updated_at';
1407
+ export const UserSessionSortBy: {
1408
+ readonly EXPIRES_AT: 'expires_at';
1409
+ readonly LAST_ACCESSED_AT: 'last_accessed_at';
1410
+ readonly LAST_REAUTHENTICATED_AT: 'last_reauthenticated_at';
1411
+ readonly CREATED_AT: 'created_at';
1412
+ readonly UPDATED_AT: 'updated_at';
1413
+ };
1414
+ }
1415
+
846
1416
  export function pagedResultSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
847
1417
  items: z.ZodArray<T>;
848
1418
  totalCount: z.ZodNumber;
@@ -867,14 +1437,6 @@ args: Record<string, string>;
867
1437
  }
868
1438
  export const apiErrorResponseSchema: z.ZodType<ApiErrorResponse>;
869
1439
 
870
- export interface ClientInfoPayload {
871
- client_device_info: ClientDeviceInfoPayload;
872
- user_agent: string | null;
873
- ip_address: string | null;
874
- api_version: string | null;
875
- }
876
- export const clientInfoPayloadSchema: z.ZodType<ClientInfoPayload>;
877
-
878
1440
  export interface ClientDeviceInfoPayload {
879
1441
  client_type: ClientType | null;
880
1442
  language: string | null;
@@ -932,46 +1494,6 @@ require_special_char: boolean;
932
1494
  }
933
1495
  export const openPasswordPolicyPayloadSchema: z.ZodType<OpenPasswordPolicyPayload>;
934
1496
 
935
- export interface ManagementSecuritySettingsPayload {
936
- recent_authentication_validity_seconds_for_open_user: number;
937
- recent_authentication_validity_seconds_for_management_user: number;
938
- management_password_policy: ManagementPasswordPolicyPayload;
939
- otp_confirmation: OtpConfirmationPayload;
940
- account_lockout_policy: AccountLockoutPolicyPayload;
941
- account_lockout_check_interval_seconds: number;
942
- open_ip_restriction_policy: IpRestrictionPolicyPayload;
943
- management_ip_restriction_policy: IpRestrictionPolicyPayload;
944
- expiration_seconds: number;
945
- max_requests_per_period: number;
946
- rate_limit_period_seconds: number;
947
- refresh_token_rotation_grace_period_seconds: number;
948
- }
949
- export const managementSecuritySettingsPayloadSchema: z.ZodType<ManagementSecuritySettingsPayload>;
950
-
951
- export interface OpenSecuritySettingsPayload {
952
- open_password_policy: OpenPasswordPolicyPayload;
953
- otp_confirmation: OtpConfirmationPayload;
954
- }
955
- export const openSecuritySettingsPayloadSchema: z.ZodType<OpenSecuritySettingsPayload>;
956
-
957
- export interface TotpRecoveryCodesPayload {
958
- totp_recovery_codes: string[];
959
- }
960
- export const totpRecoveryCodesPayloadSchema: z.ZodType<TotpRecoveryCodesPayload>;
961
-
962
- export interface TotpSetupPayload {
963
- totp_secret_key: string;
964
- totp_otp_auth_url: string;
965
- mfa_token: string;
966
- }
967
- export const totpSetupPayloadSchema: z.ZodType<TotpSetupPayload>;
968
-
969
- export interface VerifyTotpPayload {
970
- mfa_token: string;
971
- totp_code: string;
972
- }
973
- export const verifyTotpPayloadSchema: z.ZodType<VerifyTotpPayload>;
974
-
975
1497
  export interface ManagementGlobalSettingsPayload {
976
1498
  privacy_policy_url: string | null;
977
1499
  terms_of_service_url: string | null;
@@ -991,82 +1513,19 @@ min_supported_app_versions: Record<string, string>;
991
1513
  }
992
1514
  export const openGlobalSettingsPayloadSchema: z.ZodType<OpenGlobalSettingsPayload>;
993
1515
 
994
- export interface AuditEventPayload {
995
- id: AuditEventId;
996
- actor_id: UserId | null;
997
- actor_type: AuditActorType;
998
- actor_user_role: UserRole | null;
999
- action: string;
1000
- resource: string;
1001
- resource_id: string | null;
1002
- status: AuditStatus;
1003
- metadata: AuditEventMetadataPayload[];
1004
- message: string | null;
1005
- created_at: number;
1006
- }
1007
- export const auditEventPayloadSchema: z.ZodType<AuditEventPayload>;
1008
-
1009
1516
  export interface AuditEventMetadataPayload {
1010
1517
  key: string;
1011
1518
  value: string;
1012
- value_sensitivity: string;
1519
+ value_sensitivity: AuditValueSensitivity;
1013
1520
  }
1014
1521
  export const auditEventMetadataPayloadSchema: z.ZodType<AuditEventMetadataPayload>;
1015
1522
 
1016
- export interface AuthDataPayload {
1017
- user: UserDetailsPayload;
1018
- session_token: SessionTokenPayload;
1019
- }
1020
- export const authDataPayloadSchema: z.ZodType<AuthDataPayload>;
1021
-
1022
1523
  export interface AvailableAuthProvidersPayload {
1023
1524
  primary: string[];
1024
1525
  secondary: string[];
1025
1526
  }
1026
1527
  export const availableAuthProvidersPayloadSchema: z.ZodType<AvailableAuthProvidersPayload>;
1027
1528
 
1028
- export interface ManagementAuthSettingsPayload {
1029
- available_auth_providers: AvailableAuthProvidersPayload;
1030
- max_total_identifiers: number;
1031
- max_email_identifiers: number;
1032
- max_phone_identifiers: number;
1033
- max_identifiers_per_external_provider: number;
1034
- max_active_sessions_for_open_user: number;
1035
- max_active_sessions_for_management_user: number;
1036
- access_token_validity_seconds: number;
1037
- refresh_token_validity_seconds: number;
1038
- account_deletion_grace_period_seconds: number;
1039
- account_deletion_check_interval_seconds: number;
1040
- is_registration_enabled: boolean;
1041
- open_email_restriction_policy: EmailRestrictionPolicyPayload;
1042
- management_email_restriction_policy: EmailRestrictionPolicyPayload;
1043
- }
1044
- export const managementAuthSettingsPayloadSchema: z.ZodType<ManagementAuthSettingsPayload>;
1045
-
1046
- export interface OpenAuthSettingsPayload {
1047
- available_auth_providers: AvailableAuthProvidersPayload;
1048
- max_total_identifiers: number;
1049
- max_email_identifiers: number;
1050
- max_phone_identifiers: number;
1051
- max_identifiers_per_external_provider: number;
1052
- is_registration_enabled: boolean;
1053
- }
1054
- export const openAuthSettingsPayloadSchema: z.ZodType<OpenAuthSettingsPayload>;
1055
-
1056
- export interface ManagementUserConfigurationPayload {
1057
- management_global_settings: ManagementGlobalSettingsPayload;
1058
- management_security_settings: ManagementSecuritySettingsPayload;
1059
- management_auth_settings: ManagementAuthSettingsPayload;
1060
- }
1061
- export const managementUserConfigurationPayloadSchema: z.ZodType<ManagementUserConfigurationPayload>;
1062
-
1063
- export interface OpenUserConfigurationPayload {
1064
- open_global_settings: OpenGlobalSettingsPayload;
1065
- open_security_settings: OpenSecuritySettingsPayload;
1066
- open_auth_settings: OpenAuthSettingsPayload;
1067
- }
1068
- export const openUserConfigurationPayloadSchema: z.ZodType<OpenUserConfigurationPayload>;
1069
-
1070
1529
  export interface EmailRestrictionPolicyPayload {
1071
1530
  is_blacklist_enabled: boolean;
1072
1531
  blacklist: string[];
@@ -1075,49 +1534,6 @@ whitelist: string[];
1075
1534
  }
1076
1535
  export const emailRestrictionPolicyPayloadSchema: z.ZodType<EmailRestrictionPolicyPayload>;
1077
1536
 
1078
- export interface UserIdentifierPayload {
1079
- id: UserIdentifierId;
1080
- user_id: UserId;
1081
- user_auth_provider: UserAuthProvider;
1082
- identifier: string;
1083
- display_name: string;
1084
- external_provider_email: string | null;
1085
- is_sensitive_values_masked: boolean;
1086
- created_at: number;
1087
- updated_at: number | null;
1088
- }
1089
- export const userIdentifierPayloadSchema: z.ZodType<UserIdentifierPayload>;
1090
-
1091
- export interface DeletedSessionsPayload {
1092
- deleted_session_ids: string[];
1093
- }
1094
- export const deletedSessionsPayloadSchema: z.ZodType<DeletedSessionsPayload>;
1095
-
1096
- export interface UserSessionPayload {
1097
- id: UserSessionId;
1098
- user_id: UserId;
1099
- user_role: UserRole;
1100
- identifier: string;
1101
- identifier_id: UserIdentifierId;
1102
- identifier_display_name: string;
1103
- identifier_auth_provider: UserAuthProvider;
1104
- client_device_info: ClientDeviceInfoPayload;
1105
- user_agent: string | null;
1106
- ip_address: string | null;
1107
- expires_at: number;
1108
- last_accessed_at: number;
1109
- last_reauthenticated_at: number;
1110
- is_sensitive_values_masked: boolean;
1111
- created_at: number;
1112
- updated_at: number | null;
1113
- }
1114
- export const userSessionPayloadSchema: z.ZodType<UserSessionPayload>;
1115
-
1116
- export interface RefreshTokenPayload {
1117
- refresh_token: string;
1118
- }
1119
- export const refreshTokenPayloadSchema: z.ZodType<RefreshTokenPayload>;
1120
-
1121
1537
  export interface SessionTokenPayload {
1122
1538
  access_token: string;
1123
1539
  refresh_token: string;
@@ -1153,6 +1569,47 @@ account_status: UserAccountStatus;
1153
1569
  }
1154
1570
  export const userPublicPayloadSchema: z.ZodType<UserPublicPayload>;
1155
1571
 
1572
+ export interface UserIdentifierPayload {
1573
+ id: UserIdentifierId;
1574
+ user_id: UserId;
1575
+ user_auth_provider: UserAuthProvider;
1576
+ identifier: string;
1577
+ display_name: string;
1578
+ external_provider_email: string | null;
1579
+ is_sensitive_values_masked: boolean;
1580
+ created_at: number;
1581
+ updated_at: number | null;
1582
+ }
1583
+ export const userIdentifierPayloadSchema: z.ZodType<UserIdentifierPayload>;
1584
+
1585
+ export interface DeletedSessionsPayload {
1586
+ deleted_session_ids: string[];
1587
+ }
1588
+ export const deletedSessionsPayloadSchema: z.ZodType<DeletedSessionsPayload>;
1589
+
1590
+ export interface RefreshTokenPayload {
1591
+ refresh_token: string;
1592
+ }
1593
+ export const refreshTokenPayloadSchema: z.ZodType<RefreshTokenPayload>;
1594
+
1595
+ export interface TotpRecoveryCodesPayload {
1596
+ totp_recovery_codes: string[];
1597
+ }
1598
+ export const totpRecoveryCodesPayloadSchema: z.ZodType<TotpRecoveryCodesPayload>;
1599
+
1600
+ export interface TotpSetupPayload {
1601
+ totp_secret_key: string;
1602
+ totp_otp_auth_url: string;
1603
+ mfa_token: string;
1604
+ }
1605
+ export const totpSetupPayloadSchema: z.ZodType<TotpSetupPayload>;
1606
+
1607
+ export interface VerifyTotpPayload {
1608
+ mfa_token: string;
1609
+ totp_code: string;
1610
+ }
1611
+ export const verifyTotpPayloadSchema: z.ZodType<VerifyTotpPayload>;
1612
+
1156
1613
  export interface SocketFrame {
1157
1614
  id: UserId;
1158
1615
  type: string;
@@ -1173,6 +1630,119 @@ api_version: string | null;
1173
1630
  }
1174
1631
  export const webSocketInitializePayloadSchema: z.ZodType<WebSocketInitializePayload>;
1175
1632
 
1633
+ export interface ClientInfoPayload {
1634
+ client_device_info: ClientDeviceInfoPayload;
1635
+ user_agent: string | null;
1636
+ ip_address: string | null;
1637
+ api_version: string | null;
1638
+ }
1639
+ export const clientInfoPayloadSchema: z.ZodType<ClientInfoPayload>;
1640
+
1641
+ export interface UserSessionPayload {
1642
+ id: UserSessionId;
1643
+ user_id: UserId;
1644
+ user_role: UserRole;
1645
+ identifier: string;
1646
+ identifier_id: UserIdentifierId;
1647
+ identifier_display_name: string;
1648
+ identifier_auth_provider: UserAuthProvider;
1649
+ client_device_info: ClientDeviceInfoPayload;
1650
+ user_agent: string | null;
1651
+ ip_address: string | null;
1652
+ expires_at: number;
1653
+ last_accessed_at: number;
1654
+ last_reauthenticated_at: number;
1655
+ is_sensitive_values_masked: boolean;
1656
+ created_at: number;
1657
+ updated_at: number | null;
1658
+ }
1659
+ export const userSessionPayloadSchema: z.ZodType<UserSessionPayload>;
1660
+
1661
+ export interface AuditEventPayload {
1662
+ id: AuditEventId;
1663
+ actor_id: UserId | null;
1664
+ actor_type: AuditActorType;
1665
+ actor_user_role: UserRole | null;
1666
+ action: string;
1667
+ resource: string;
1668
+ resource_id: string | null;
1669
+ status: AuditStatus;
1670
+ metadata: AuditEventMetadataPayload[];
1671
+ message: string | null;
1672
+ created_at: number;
1673
+ }
1674
+ export const auditEventPayloadSchema: z.ZodType<AuditEventPayload>;
1675
+
1676
+ export interface AuthDataPayload {
1677
+ user: UserDetailsPayload;
1678
+ session_token: SessionTokenPayload;
1679
+ }
1680
+ export const authDataPayloadSchema: z.ZodType<AuthDataPayload>;
1681
+
1682
+ export interface ManagementAuthSettingsPayload {
1683
+ available_auth_providers: AvailableAuthProvidersPayload;
1684
+ max_total_identifiers: number;
1685
+ max_email_identifiers: number;
1686
+ max_phone_identifiers: number;
1687
+ max_identifiers_per_external_provider: number;
1688
+ max_active_sessions_for_open_user: number;
1689
+ max_active_sessions_for_management_user: number;
1690
+ access_token_validity_seconds: number;
1691
+ refresh_token_validity_seconds: number;
1692
+ account_deletion_grace_period_seconds: number;
1693
+ account_deletion_check_interval_seconds: number;
1694
+ is_registration_enabled: boolean;
1695
+ open_email_restriction_policy: EmailRestrictionPolicyPayload;
1696
+ management_email_restriction_policy: EmailRestrictionPolicyPayload;
1697
+ }
1698
+ export const managementAuthSettingsPayloadSchema: z.ZodType<ManagementAuthSettingsPayload>;
1699
+
1700
+ export interface OpenAuthSettingsPayload {
1701
+ available_auth_providers: AvailableAuthProvidersPayload;
1702
+ max_total_identifiers: number;
1703
+ max_email_identifiers: number;
1704
+ max_phone_identifiers: number;
1705
+ max_identifiers_per_external_provider: number;
1706
+ is_registration_enabled: boolean;
1707
+ }
1708
+ export const openAuthSettingsPayloadSchema: z.ZodType<OpenAuthSettingsPayload>;
1709
+
1710
+ export interface ManagementSecuritySettingsPayload {
1711
+ recent_authentication_validity_seconds_for_open_user: number;
1712
+ recent_authentication_validity_seconds_for_management_user: number;
1713
+ management_password_policy: ManagementPasswordPolicyPayload;
1714
+ otp_confirmation: OtpConfirmationPayload;
1715
+ account_lockout_policy: AccountLockoutPolicyPayload;
1716
+ account_lockout_check_interval_seconds: number;
1717
+ open_ip_restriction_policy: IpRestrictionPolicyPayload;
1718
+ management_ip_restriction_policy: IpRestrictionPolicyPayload;
1719
+ expiration_seconds: number;
1720
+ max_requests_per_period: number;
1721
+ rate_limit_period_seconds: number;
1722
+ refresh_token_rotation_grace_period_seconds: number;
1723
+ }
1724
+ export const managementSecuritySettingsPayloadSchema: z.ZodType<ManagementSecuritySettingsPayload>;
1725
+
1726
+ export interface OpenSecuritySettingsPayload {
1727
+ open_password_policy: OpenPasswordPolicyPayload;
1728
+ otp_confirmation: OtpConfirmationPayload;
1729
+ }
1730
+ export const openSecuritySettingsPayloadSchema: z.ZodType<OpenSecuritySettingsPayload>;
1731
+
1732
+ export interface ManagementUserConfigurationPayload {
1733
+ management_global_settings: ManagementGlobalSettingsPayload;
1734
+ management_security_settings: ManagementSecuritySettingsPayload;
1735
+ management_auth_settings: ManagementAuthSettingsPayload;
1736
+ }
1737
+ export const managementUserConfigurationPayloadSchema: z.ZodType<ManagementUserConfigurationPayload>;
1738
+
1739
+ export interface OpenUserConfigurationPayload {
1740
+ open_global_settings: OpenGlobalSettingsPayload;
1741
+ open_security_settings: OpenSecuritySettingsPayload;
1742
+ open_auth_settings: OpenAuthSettingsPayload;
1743
+ }
1744
+ export const openUserConfigurationPayloadSchema: z.ZodType<OpenUserConfigurationPayload>;
1745
+
1176
1746
  export interface CreateByEmailRequest {
1177
1747
  email: string;
1178
1748
  password: string | null;