import { D as DeviceFingerprintRequest, L as LocationVerification, N as LocationRequest, J as JurisdictionConfig, Q as LocationRequestFilters, R as LocationRequestListResponse, G as GeolocationClient } from '../client-K-qkyEBM.js'; export { O as CreateLocationRequestRequest, T as LocationCaptureRequest, Y as LocationCaptureResponse, M as LocationRequestChannel, P as LocationRequestResult, K as LocationRequestStatus, X as LocationShareInfo, S as ResendLocationRequestRequest } from '../client-K-qkyEBM.js'; import { CustomerProfile, RiskProfileClient } from '../risk-profile/index.js'; import { g as EntityType, C as CGSConfig, P as PaginationParams } from '../types-DxnfRzF_.js'; interface RegistrationVerificationRequest { customerId: string; fullName: string; emailAddress: string; phoneNumber?: string; dateOfBirth?: string; address?: string; entityType?: EntityType; ipAddress: string; deviceFingerprint?: DeviceFingerprintRequest; metadata?: Record; } interface RegistrationVerificationResponse { allowed: boolean; geolocation: LocationVerification; profile: CustomerProfile; requiresKYC: boolean; requiresEDD: boolean; blockReasons: string[]; processingTime: number; } interface LoginVerificationRequest { customerId: string; ipAddress: string; deviceFingerprint?: DeviceFingerprintRequest; metadata?: Record; } interface LoginVerificationResponse { allowed: boolean; geolocation: LocationVerification; profile: CustomerProfile; requiresStepUp: boolean; blockReasons: string[]; processingTime: number; } interface TransactionVerificationRequest { customerId: string; ipAddress: string; amount: number; currency: string; transactionType?: 'deposit' | 'withdrawal' | 'bet' | 'transfer' | 'payout'; deviceFingerprint?: DeviceFingerprintRequest; metadata?: Record; } interface TransactionVerificationResponse { allowed: boolean; geolocation: LocationVerification; profile: CustomerProfile; transactionRisk: TransactionRiskResult; requiresApproval: boolean; blockReasons: string[]; processingTime: number; } interface TransactionRiskResult { score: number; level: 'low' | 'medium' | 'high' | 'critical'; factors: string[]; allowed: boolean; requiresManualReview: boolean; } interface EventVerificationRequest { customerId: string; ipAddress: string; eventType: string; deviceFingerprint?: DeviceFingerprintRequest; metadata?: Record; } interface EventVerificationResponse { allowed: boolean; geolocation: LocationVerification; blockReasons: string[]; processingTime: number; } interface CurrencyRates { [currency: string]: number; } declare const DEFAULT_CURRENCY_RATES: CurrencyRates; interface RegistrationPreCheckResult { canRegister: boolean; jurisdiction: JurisdictionConfig | null; blockReasons: string[]; riskLevel: 'low' | 'medium' | 'high' | 'critical'; requiresKYC: boolean; requiresEDD: boolean; location: { country: string; countryISO: string; city: string; }; } interface RegistrationSyncOptions { /** Maximum time to wait for risk calculation in milliseconds (default: 5000) */ maxWaitMs?: number; /** Polling interval in milliseconds (default: 500) */ pollIntervalMs?: number; } interface RegistrationVerificationResponseWithSync extends RegistrationVerificationResponse { /** Whether the risk score was successfully synchronized */ riskSynced: boolean; } interface ComplianceLocationRequestInput { /** Customer user ID to request location from */ customerId: string; /** Notification channel to use */ channel: 'sms' | 'email' | 'push'; /** Reason for requesting location (for compliance/audit) */ reason: string; /** Customer email (required for email channel) */ email?: string; /** Customer phone (required for SMS channel) */ phone?: string; /** Custom expiry time in hours (default: 24) */ expiryHours?: number; } interface ComplianceLocationRequestResult { /** The created location request */ request: LocationRequest; /** Shareable link for the customer */ shareLink: string; /** Token expiration time */ tokenExpiry: string; /** Customer profile (if available) */ profile?: CustomerProfile; } /** * ComplianceClient - Unified Compliance Orchestration * * Main integration point for casino platforms. Orchestrates geolocation * verification with customer risk profiling for complete compliance coverage. * * GeoComply-style approach: SDK is the primary data injection point. */ declare class ComplianceClient { private geoClient; private riskClient; private config; private currencyRates; constructor(config: CGSConfig); /** * Verify customer registration with automatic profile creation * * This is the primary integration point for new customer sign-ups. * Combines geolocation verification with customer risk profile creation. * * Important: Profile is only created if geolocation verification passes. * This prevents orphaned geolocation records when registration is blocked. * * @param request - Registration verification request * @returns Verification response with profile and compliance status * * @example * ```typescript * const result = await sdk.verifyAtRegistration({ * customerId: 'CUST-12345', * fullName: 'John Doe', * emailAddress: 'john@example.com', * ipAddress: req.ip, * deviceFingerprint: getDeviceFingerprint() * }); * * if (result.allowed) { * // Create account * console.log('Profile created:', result.profile); * if (result.requiresKYC) { * // Redirect to KYC flow * } * } else { * // Block registration * console.log('Blocked:', result.blockReasons); * } * ``` */ verifyAtRegistration(request: RegistrationVerificationRequest): Promise; /** * Evaluate if registration should be blocked based on geolocation verification * * Checks: * 1. General compliance status (is_compliant) * 2. Explicit block flag (is_blocked) * 3. Jurisdiction-specific registration allowance (allow_registration) * 4. Risk level thresholds * * @param geoVerification - Geolocation verification result * @returns Array of block reasons (empty if allowed) */ private evaluateRegistrationBlock; /** * Validate registration request has all required fields * * @param request - Registration request to validate * @throws ValidationError if required fields are missing or invalid */ private validateRegistrationRequest; /** * Validate IP address format (IPv4 or IPv6) */ private isValidIP; /** * Validate email address format */ private isValidEmail; /** * Verify customer login with profile activity update * * Verifies geolocation and updates customer profile with latest activity. * * @param request - Login verification request * @returns Verification response with compliance status * * @example * ```typescript * const result = await sdk.verifyAtLogin({ * customerId: 'CUST-12345', * ipAddress: req.ip, * deviceFingerprint: getDeviceFingerprint() * }); * * if (result.allowed) { * // Allow login * if (result.requiresStepUp) { * // Trigger MFA or additional verification * } * } else { * // Block login * console.log('Blocked:', result.blockReasons); * } * ``` */ verifyAtLogin(request: LoginVerificationRequest): Promise; /** * Verify transaction with amount-based risk assessment * * Combines geolocation verification with transaction amount analysis * and customer risk profile for comprehensive transaction screening. * * @param request - Transaction verification request * @returns Verification response with transaction risk assessment * * @example * ```typescript * const result = await sdk.verifyAtTransaction({ * customerId: 'CUST-12345', * ipAddress: req.ip, * amount: 5000, * currency: 'USD', * transactionType: 'withdrawal', * deviceFingerprint: getDeviceFingerprint() * }); * * if (result.allowed) { * // Process transaction * } else if (result.requiresApproval) { * // Queue for manual review * } else { * // Block transaction * console.log('Blocked:', result.blockReasons); * } * ``` */ verifyAtTransaction(request: TransactionVerificationRequest): Promise; /** * Generic event verification (for other touchpoints) * * @param request - Event verification request * @returns Verification response */ verifyEvent(request: EventVerificationRequest): Promise; private shouldUpdateProfile; private createProfileFromGeo; private calculateTransactionRisk; private checkJurisdictionLimits; private normalizeToUSD; private getRiskLevel; private getBlockReasons; private getTransactionBlockReasons; /** * Verify registration with synchronized risk calculation * * This method extends verifyAtRegistration by waiting for the geolocation * risk factor to be processed by the backend. Use this when you need * the accurate risk score immediately after registration. * * Note: This adds latency (up to `maxWaitMs`) but provides accurate risk data. * * @param request - Registration verification request * @param options - Sync options * @returns Verification response with updated risk score * * @example * ```typescript * const result = await sdk.verifyAtRegistrationWithSync( * { * customerId: 'CUST-12345', * fullName: 'John Doe', * emailAddress: 'john@example.com', * ipAddress: req.ip, * }, * { maxWaitMs: 5000, pollIntervalMs: 500 } * ); * * // profile.risk_score now reflects geolocation risk factor * console.log('Synced risk score:', result.profile?.risk_score); * ``` */ verifyAtRegistrationWithSync(request: RegistrationVerificationRequest, options?: { maxWaitMs?: number; pollIntervalMs?: number; }): Promise; /** * Wait for risk score to be calculated * * Polls the profile until risk_score > 0 or risk_last_calculated is set, * indicating that risk factors have been processed. * * @param profileId - Profile UUID to poll * @param maxWaitMs - Maximum wait time in milliseconds * @param pollIntervalMs - Polling interval in milliseconds * @returns Updated profile or null if timeout */ private waitForRiskCalculation; /** * Pre-check if registration would be allowed from an IP address * * Use this before showing the registration form to provide early feedback * to users in blocked jurisdictions. * * @param ipAddress - IP address to check * @returns Pre-check result with jurisdiction info * * @example * ```typescript * const preCheck = await sdk.preCheckRegistration(req.ip); * * if (!preCheck.canRegister) { * return res.render('blocked', { reasons: preCheck.blockReasons }); * } * * if (preCheck.requiresKYC) { * // Prepare KYC flow * } * ``` */ preCheckRegistration(ipAddress: string): Promise<{ canRegister: boolean; jurisdiction: JurisdictionConfig | null; blockReasons: string[]; riskLevel: 'low' | 'medium' | 'high' | 'critical'; requiresKYC: boolean; requiresEDD: boolean; location: { country: string; countryISO: string; city: string; }; }>; /** * Request live location from a customer * * Creates a location request and sends a notification to the customer * via the specified channel (SMS, email, or push). The customer receives * a link to share their location. * * @param input - Location request details * @returns Location request result with share link * * @example * ```typescript * // Request location via SMS for transaction verification * const result = await sdk.requestCustomerLocation({ * customerId: 'CUST-12345', * channel: 'sms', * phone: '+1234567890', * reason: 'Verification required for high-value transaction' * }); * * console.log('Share link sent:', result.shareLink); * console.log('Expires at:', result.tokenExpiry); * * // Request location via email * const emailResult = await sdk.requestCustomerLocation({ * customerId: 'CUST-12345', * channel: 'email', * email: 'customer@example.com', * reason: 'Account verification', * expiryHours: 48 * }); * ``` */ requestCustomerLocation(input: ComplianceLocationRequestInput): Promise; /** * Get a specific location request by ID * * @param requestId - Location request ID * @returns Location request details * * @example * ```typescript * const request = await sdk.getLocationRequest('req_abc123'); * console.log('Status:', request.status); * if (request.latitude && request.longitude) { * console.log('Location captured:', request.latitude, request.longitude); * } * ``` */ getLocationRequest(requestId: string): Promise; /** * List location requests with filters and pagination * * @param filters - Optional filters * @param pagination - Optional pagination * @returns Paginated list of location requests * * @example * ```typescript * // Get pending requests for a customer * const pending = await sdk.listLocationRequests( * { status: 'pending', user_id: 'CUST-12345' }, * { page: 1, limit: 20 } * ); * * // Get all completed requests from last week * const completed = await sdk.listLocationRequests({ * status: 'completed', * date_from: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString() * }); * ``` */ listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams): Promise; /** * Cancel a pending location request * * @param requestId - Location request ID * * @example * ```typescript * await sdk.cancelLocationRequest('req_abc123'); * ``` */ cancelLocationRequest(requestId: string): Promise; /** * Resend notification for a location request * * @param requestId - Location request ID * @param contact - Contact details (email or phone) * * @example * ```typescript * // Resend to a different phone number * await sdk.resendLocationRequest('req_abc123', { phone: '+0987654321' }); * * // Resend to email * await sdk.resendLocationRequest('req_abc123', { email: 'new@example.com' }); * ``` */ resendLocationRequest(requestId: string, contact: { email?: string; phone?: string; }): Promise; /** * Validate location request input */ private validateLocationRequestInput; /** * Update currency exchange rates * * Use this to keep currency rates current for accurate transaction risk * calculation. Rates should be updated regularly (e.g., daily). * * @param rates - Currency to USD exchange rates * * @example * ```typescript * // Update specific rates * sdk.updateCurrencyRates({ * EUR: 1.08, * GBP: 1.25, * BTC: 42000, // For crypto support * }); * * // Or fetch from external service * const rates = await fetchExchangeRates(); * sdk.updateCurrencyRates(rates); * ``` */ updateCurrencyRates(rates: CurrencyRates): void; /** * Get current currency rates * * @returns Current currency to USD exchange rates */ getCurrencyRates(): Readonly; /** * Fetch and update currency rates from an external API * * This method allows integration with external exchange rate providers. * Pass a fetcher function that returns the new rates. * * @param fetcher - Async function that returns currency rates * @returns The fetched rates * * @example * ```typescript * // Using a rate provider * const rates = await sdk.fetchCurrencyRates(async () => { * const response = await fetch('https://api.exchangerate.host/latest?base=USD'); * const data = await response.json(); * return data.rates; * }); * * console.log('Updated rates:', rates); * ``` */ fetchCurrencyRates(fetcher: () => Promise): Promise; /** * Get underlying geolocation client */ getGeolocationClient(): GeolocationClient; /** * Get underlying risk profile client */ getRiskProfileClient(): RiskProfileClient; /** * Update configuration */ updateConfig(config: Partial): void; /** * Helper to create a delay */ private sleep; } export { ComplianceClient, type ComplianceLocationRequestInput, type ComplianceLocationRequestResult, type CurrencyRates, DEFAULT_CURRENCY_RATES, type EventVerificationRequest, type EventVerificationResponse, LocationRequest, LocationRequestFilters, LocationRequestListResponse, type LoginVerificationRequest, type LoginVerificationResponse, type RegistrationPreCheckResult, type RegistrationSyncOptions, type RegistrationVerificationRequest, type RegistrationVerificationResponse, type RegistrationVerificationResponseWithSync, type TransactionRiskResult, type TransactionVerificationRequest, type TransactionVerificationResponse };