/** * Service Initialization Helper * * Initializes all NAuth services in correct dependency order. * Matches NestJS AuthModule service initialization. */ import { Repository } from 'typeorm'; import { NAuthConfig, NAuthLogger, StorageAdapter, ClientInfoService, RateLimitStorageService, AccountLockoutStorageService, EmailVerificationService, PhoneVerificationService, MFAService, AuthService, AdminAuthService, SocialAuthService, HookRegistryService, ApiKeyService } from '../../index'; import { PasswordService, JwtService, SessionService, AuthAuditService, // Internal version with recordEvent() ChallengeService, TrustedDeviceService, AuthFlowContextBuilder, AuthFlowStateMachineService, AuthChallengeHelperService, SocialProviderRegistry, GeoLocationService, RiskDetectionService, RiskScoringService, AdaptiveMFADecisionService } from '../../internal'; import { BaseUser, BaseSession, BaseLoginAttempt, BaseVerificationToken, BaseSocialAccount, BaseChallengeSession, BaseMFADevice, BaseAuthAudit, BaseTrustedDevice, BaseApiKey } from '../../entities'; /** * Service container returned by initServices() */ export interface NAuthServices { passwordService: PasswordService; jwtService: JwtService; clientInfoService: ClientInfoService; rateLimitStorageService: RateLimitStorageService; accountLockoutStorageService: AccountLockoutStorageService; sessionService: SessionService; challengeService: ChallengeService; emailVerificationService: EmailVerificationService; authFlowContextBuilder: AuthFlowContextBuilder; authFlowStateMachine: AuthFlowStateMachineService; authChallengeHelperService: AuthChallengeHelperService; authService: AuthService; adminAuthService: AdminAuthService; socialProviderRegistry: SocialProviderRegistry; socialAuthService: SocialAuthService; hookRegistry: HookRegistryService; auditService?: AuthAuditService; phoneVerificationService?: PhoneVerificationService; trustedDeviceService?: TrustedDeviceService; mfaService?: MFAService; geoLocationService?: GeoLocationService; riskDetectionService?: RiskDetectionService; riskScoringService?: RiskScoringService; adaptiveMFADecisionService?: AdaptiveMFADecisionService; apiKeyService?: ApiKeyService; csrfService?: unknown; } /** * Initialize all services in correct dependency order * * Service initialization order matches NestJS AuthModule: * 1. PasswordService, JwtService (no dependencies) * 2. ClientInfoService (no dependencies) * 3. AuthAuditService (if enabled) * 4. RateLimitStorageService, AccountLockoutStorageService * 5. SessionService * 6. ChallengeService * 7. EmailVerificationService * 8. PhoneVerificationService (if SMS configured) * 9. TrustedDeviceService (if rememberDevices enabled) * 10. AuthFlowContextBuilder, AuthFlowStateMachine * 11. AuthChallengeHelperService * 12. MFAService (if enabled) * 13. AuthService * 14. SocialAuthService * 15. GeoLocationService (if MaxMind configured) * 16. Risk services (if adaptive MFA configured) * * @param config - NAuth configuration * @param repositories - Repository container * @param storageAdapter - Initialized storage adapter * @param logger - Logger instance * @param emailProvider - Email provider instance * @param smsProvider - SMS provider instance (optional) * @returns Service container with all initialized services */ export declare function initServices(config: NAuthConfig, repositories: { userRepository: Repository; sessionRepository: Repository; loginAttemptRepository: Repository; verificationTokenRepository: Repository; socialAccountRepository: Repository; challengeSessionRepository: Repository; mfaDeviceRepository: Repository; authAuditRepository: Repository; trustedDeviceRepository: Repository | null; apiKeyRepository?: Repository | null; }, storageAdapter: StorageAdapter, logger: NAuthLogger, emailProvider: unknown, smsProvider?: unknown): NAuthServices; //# sourceMappingURL=init-services.d.ts.map