import { RoleType } from "@talosjs/role"; import { LocaleType } from "@talosjs/translation"; declare enum EAccountType { OAUTH = "oauth", EMAIL = "email", CREDENTIALS = "credentials", WEBAUTHN = "webauthn" } declare enum EVerificationType { EMAIL = "email", PHONE = "phone", PASSWORD_RESET = "password_reset", TWO_FACTOR = "two_factor", ACCOUNT_ACTIVATION = "account_activation" } declare enum EProfileUpdateStatus { PENDING = "pending", COMPLETED = "completed", FAILED = "failed", REVERTED = "reverted" } type AccountType = `${EAccountType}`; type VerificationType = `${EVerificationType}`; type ProfileUpdateStatusType = `${EProfileUpdateStatus}`; interface IBase { id: string; isLocked?: boolean; lockedAt?: Date; isBanned?: boolean; bannedAt?: Date; banReason?: string; isBlocked?: boolean; blockedAt?: Date; blockReason?: string; isPublic?: boolean; createdAt?: Date; updatedAt?: Date; deletedAt?: Date; language?: LocaleType; } interface IUser extends IBase { email: string; roles: RoleType[]; externalId?: string; name?: string; lastName?: string; firstName?: string; username?: string; avatar?: string; bio?: string; phone?: string; birthDate?: Date; timezone?: string; isEmailVerified?: boolean; isPhoneVerified?: boolean; lastActiveAt?: Date; emailVerifiedAt?: Date; phoneVerifiedAt?: Date; lastLoginAt?: Date; passwordChangedAt?: Date; twoFactorEnabled?: boolean; twoFactorSecret?: string; recoveryTokens?: string[]; sessions?: ISession[]; accounts?: IAccount[]; verifications?: IVerification[]; } interface ISession extends IBase { token: string; refreshToken?: string; userAgent?: string; ipAddress?: string; deviceType?: string; deviceName?: string; browser?: string; operatingSystem?: string; location?: string; isActive: boolean; expiresAt: Date; lastAccessAt?: Date; revokedAt?: Date; revokedReason?: string; user?: IUser; } interface IAccount extends IBase { provider?: string; providerAccountId?: string; type: EAccountType; password?: string; accessToken?: string; accessTokenExpiresAt?: Date; refreshToken?: string; refreshTokenExpiresAt?: Date; expiresAt?: Date; tokenType?: string; scope?: string; idToken?: string; sessionState?: string; email?: string; emailVerified?: boolean; name?: string; picture?: string; profile?: Record; user?: IUser; } interface IVerification extends IBase { email?: string; phone?: string; token: string; type: EVerificationType; code?: string; isUsed: boolean; usedAt?: Date; expiresAt: Date; attemptsCount: number; maxAttempts: number; ipAddress?: string; userAgent?: string; metadata?: Record; description?: string; user?: IUser; } interface IUserProfileUpdate extends IBase { changedFields: string[]; previousValues?: Record; newValues?: Record; updateReason?: string; ipAddress?: string; userAgent?: string; requiresVerification?: boolean; status: EProfileUpdateStatus; appliedAt?: Date; metadata?: Record; description?: string; user?: IUser; verification?: IVerification; } export { AccountType, EAccountType, EProfileUpdateStatus, EVerificationType, IAccount, ISession, IUser, IUserProfileUpdate, IVerification, ProfileUpdateStatusType, VerificationType };