vesant-sdk 1.0.4
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.
- package/README.md +247 -0
- package/dist/client-CA9Wr_qb.d.ts +1108 -0
- package/dist/client-DMNkESa0.d.mts +1108 -0
- package/dist/compliance/index.d.mts +543 -0
- package/dist/compliance/index.d.ts +543 -0
- package/dist/compliance/index.js +2133 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/index.mjs +2130 -0
- package/dist/compliance/index.mjs.map +1 -0
- package/dist/geolocation/index.d.mts +73 -0
- package/dist/geolocation/index.d.ts +73 -0
- package/dist/geolocation/index.js +1100 -0
- package/dist/geolocation/index.js.map +1 -0
- package/dist/geolocation/index.mjs +1094 -0
- package/dist/geolocation/index.mjs.map +1 -0
- package/dist/index.d.mts +50 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +2968 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2948 -0
- package/dist/index.mjs.map +1 -0
- package/dist/kyc/core.d.mts +3 -0
- package/dist/kyc/core.d.ts +3 -0
- package/dist/kyc/core.js +773 -0
- package/dist/kyc/core.js.map +1 -0
- package/dist/kyc/core.mjs +771 -0
- package/dist/kyc/core.mjs.map +1 -0
- package/dist/kyc/index.d.mts +734 -0
- package/dist/kyc/index.d.ts +734 -0
- package/dist/kyc/index.js +773 -0
- package/dist/kyc/index.js.map +1 -0
- package/dist/kyc/index.mjs +771 -0
- package/dist/kyc/index.mjs.map +1 -0
- package/dist/react.d.mts +487 -0
- package/dist/react.d.ts +487 -0
- package/dist/react.js +1122 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +1102 -0
- package/dist/react.mjs.map +1 -0
- package/dist/risk-profile/index.d.mts +228 -0
- package/dist/risk-profile/index.d.ts +228 -0
- package/dist/risk-profile/index.js +548 -0
- package/dist/risk-profile/index.js.map +1 -0
- package/dist/risk-profile/index.mjs +546 -0
- package/dist/risk-profile/index.mjs.map +1 -0
- package/dist/types-Bnsnejor.d.mts +150 -0
- package/dist/types-Bnsnejor.d.ts +150 -0
- package/dist/types-CFupjwi8.d.ts +213 -0
- package/dist/types-CqOLbaXk.d.mts +213 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/errors.ts","../../src/core/client.ts","../../src/geolocation/client.ts","../../src/risk-profile/client.ts","../../src/compliance/types.ts","../../src/compliance/client.ts"],"names":[],"mappings":";AAOO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAClC,WAAA,CACE,OAAA,EACO,IAAA,EACA,UAAA,EACA,OAAA,EACP;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAJN,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAGP,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,SAAA,CAAS,SAAS,CAAA;AAAA,EAChD;AACF,CAAA;AAEO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqB,QAAA,CAAS;AAAA,EACzC,WAAA,CAAY,SAAwB,aAAA,EAAyB;AAC3D,IAAA,KAAA,CAAM,OAAA,EAAS,eAAA,EAAiB,MAAA,EAAW,EAAE,eAAe,CAAA;AAD1B,IAAA,IAAA,CAAA,aAAA,GAAA,aAAA;AAElC,IAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,aAAA,CAAa,SAAS,CAAA;AAAA,EACpD;AACF,CAAA;AAEO,IAAM,eAAA,GAAN,MAAM,gBAAA,SAAwB,QAAA,CAAS;AAAA,EAC5C,WAAA,CAAY,SAAiB,MAAA,EAAmB;AAC9C,IAAA,KAAA,CAAM,OAAA,EAAS,kBAAA,EAAoB,GA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,MAAM,EAAA,EAA2B;AACvC,IAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,YAAY,UAAA,CAAW,OAAA,EAAS,EAAE,CAAC,CAAA;AAAA,EACzD;AACF","file":"index.mjs","sourcesContent":["/**\n * Error hierarchy for CGS SDK\n *\n * Provides structured error handling with specific error types\n * for different failure scenarios.\n */\n\nexport class CGSError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode?: number,\n public details?: Record<string, unknown>\n ) {\n super(message);\n this.name = 'CGSError';\n Object.setPrototypeOf(this, CGSError.prototype);\n }\n}\n\nexport class NetworkError extends CGSError {\n constructor(message: string, public originalError?: unknown) {\n super(message, 'NETWORK_ERROR', undefined, { originalError });\n this.name = 'NetworkError';\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n\nexport class ValidationError extends CGSError {\n constructor(message: string, fields?: string[]) {\n super(message, 'VALIDATION_ERROR', 400, { fields });\n this.name = 'ValidationError';\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class ServiceUnavailableError extends CGSError {\n constructor(service: string) {\n super(`${service} is unavailable`, 'SERVICE_UNAVAILABLE', 503, { service });\n this.name = 'ServiceUnavailableError';\n Object.setPrototypeOf(this, ServiceUnavailableError.prototype);\n }\n}\n\nexport class ComplianceBlockedError extends CGSError {\n constructor(reasons: string[]) {\n super('Access blocked due to compliance rules', 'COMPLIANCE_BLOCKED', 403, { reasons });\n this.name = 'ComplianceBlockedError';\n Object.setPrototypeOf(this, ComplianceBlockedError.prototype);\n }\n}\n\nexport class AuthenticationError extends CGSError {\n constructor(message: string = 'Authentication failed') {\n super(message, 'AUTHENTICATION_ERROR', 401);\n this.name = 'AuthenticationError';\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n\nexport class RateLimitError extends CGSError {\n constructor(public retryAfter?: number) {\n super('Rate limit exceeded', 'RATE_LIMIT_EXCEEDED', 429, { retryAfter });\n this.name = 'RateLimitError';\n Object.setPrototypeOf(this, RateLimitError.prototype);\n }\n}\n\nexport class TimeoutError extends CGSError {\n constructor(public timeout: number) {\n super(`Request timeout after ${timeout}ms`, 'TIMEOUT', 408, { timeout });\n this.name = 'TimeoutError';\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class ComplianceError extends CGSError {\n constructor(\n message: string,\n public originalError?: unknown,\n code: string = 'COMPLIANCE_ERROR'\n ) {\n super(message, code, undefined, { originalError });\n this.name = 'ComplianceError';\n Object.setPrototypeOf(this, ComplianceError.prototype);\n }\n}\n","/**\n * Base HTTP client for all CGS SDK clients\n *\n * Provides common functionality:\n * - Request/response handling\n * - Error handling\n * - Retry logic with exponential backoff\n * - Timeout management\n * - Debug logging\n */\n\nimport type { BaseClientConfig, RequiredBaseClientConfig } from './config';\nimport {\n CGSError,\n NetworkError,\n TimeoutError,\n AuthenticationError,\n RateLimitError,\n ServiceUnavailableError,\n} from './errors';\n\nexport abstract class BaseClient {\n protected config: RequiredBaseClientConfig;\n\n constructor(config: BaseClientConfig) {\n this.config = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey || '',\n headers: config.headers || {},\n timeout: config.timeout || 10000,\n retries: config.retries || 3,\n debug: config.debug || false,\n };\n }\n\n /**\n * Make an HTTP request with timeout and error handling\n */\n protected async request<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string\n ): Promise<T> {\n const url = `${serviceURL || this.config.baseURL}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-Tenant-ID': this.config.tenantId,\n ...this.config.headers,\n ...((options.headers as Record<string, string>) || {}),\n };\n\n if (this.config.apiKey) {\n headers['Authorization'] = `Bearer ${this.config.apiKey}`;\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n try {\n if (this.config.debug) {\n console.log(`[CGS SDK] ${options.method || 'GET'} ${url}`, {\n headers,\n body: options.body,\n });\n }\n\n const response = await fetch(url, {\n ...options,\n headers,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n const data = await response.json();\n\n if (!response.ok) {\n this.handleErrorResponse(response.status, data);\n }\n\n if (this.config.debug) {\n console.log(`[CGS SDK] Response:`, data);\n }\n\n return data as T;\n } catch (error) {\n clearTimeout(timeoutId);\n\n if (error instanceof Error) {\n if (error.name === 'AbortError') {\n throw new TimeoutError(this.config.timeout);\n }\n if (error instanceof CGSError) {\n throw error;\n }\n }\n\n throw new NetworkError('Network request failed', error);\n }\n }\n\n /**\n * Make an HTTP request with retry logic\n */\n protected async requestWithRetry<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n retries: number = this.config.retries\n ): Promise<T> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await this.request<T>(endpoint, options, serviceURL);\n } catch (error) {\n lastError = error instanceof Error ? error : new Error('Unknown error');\n\n // Don't retry on client errors (4xx) or authentication errors\n if (\n lastError instanceof CGSError &&\n lastError.statusCode &&\n lastError.statusCode >= 400 &&\n lastError.statusCode < 500\n ) {\n throw lastError;\n }\n\n // Don't retry on last attempt\n if (attempt === retries) {\n break;\n }\n\n // Exponential backoff with jitter\n const delay = Math.min(1000 * Math.pow(2, attempt) + Math.random() * 1000, 10000);\n await new Promise((resolve) => setTimeout(resolve, delay));\n\n if (this.config.debug) {\n console.log(`[CGS SDK] Retry attempt ${attempt + 1}/${retries} after ${delay.toFixed(0)}ms`);\n }\n }\n }\n\n throw new NetworkError(`Request failed after ${retries} retries`, lastError);\n }\n\n /**\n * Handle error responses from API\n */\n protected handleErrorResponse(status: number, data: any): never {\n const message = data.error || data.message || `HTTP ${status}`;\n\n switch (status) {\n case 400:\n throw new CGSError(message, 'BAD_REQUEST', 400, data);\n case 401:\n throw new AuthenticationError(message);\n case 403:\n throw new CGSError(message, 'FORBIDDEN', 403, data);\n case 404:\n throw new CGSError(message, 'NOT_FOUND', 404, data);\n case 429:\n const retryAfter = data.retry_after || data.retryAfter;\n throw new RateLimitError(retryAfter);\n case 500:\n case 502:\n case 503:\n case 504:\n throw new ServiceUnavailableError(message);\n default:\n throw new CGSError(message, 'UNKNOWN_ERROR', status, data);\n }\n }\n\n /**\n * Build query string from parameters\n */\n protected buildQueryString(params: Record<string, unknown>): string {\n const query = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach((item) => query.append(key, String(item)));\n } else {\n query.append(key, String(value));\n }\n }\n });\n\n const queryString = query.toString();\n return queryString ? `?${queryString}` : '';\n }\n\n /**\n * Update client configuration\n */\n updateConfig(config: Partial<BaseClientConfig>): void {\n this.config = {\n ...this.config,\n ...config,\n headers: {\n ...this.config.headers,\n ...(config.headers || {}),\n },\n };\n }\n\n /**\n * Get current configuration (readonly)\n */\n getConfig(): Readonly<BaseClientConfig> {\n return { ...this.config };\n }\n\n /**\n * Health check endpoint\n */\n async healthCheck(): Promise<{ status: string; timestamp: string }> {\n return this.request('/api/v1/health');\n }\n}\n","/**\n * GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service\n *\n * Provides type-safe methods to interact with the geolocation service API.\n * Extends BaseClient for consistent retry logic, timeout handling, and error management.\n */\n\nimport { BaseClient } from '../core/client';\nimport type { BaseClientConfig } from '../core/config';\nimport type {\n GeolocationClientConfig,\n VerifyIPRequest,\n LocationVerification,\n ComplianceCheckResponse,\n GeolocationAlert,\n AlertFilters,\n PaginationParams,\n AlertListResponse,\n DashboardMetrics,\n JurisdictionConfig,\n CreateJurisdictionRequest,\n UpdateJurisdictionRequest,\n GeofenceRule,\n CreateGeofenceRuleRequest,\n UpdateGeofenceRuleRequest,\n DeviceFingerprint,\n GeolocationRecord,\n AlertStatus,\n // Location Request Types\n LocationRequest,\n CreateLocationRequestRequest,\n LocationRequestResult,\n LocationRequestFilters,\n LocationRequestListResponse,\n ResendLocationRequestRequest,\n LocationShareInfo,\n LocationCaptureRequest,\n LocationCaptureResponse,\n // CipherText Types\n ValidateCipherTextRequest,\n ValidateCipherTextResponse,\n CipherTextReason,\n} from './types';\n\n/**\n * GeolocationClient extends BaseClient for:\n * - Consistent retry logic with exponential backoff\n * - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)\n * - Automatic timeout management\n * - Debug logging\n *\n * All geolocation verification calls use requestWithRetry() to handle\n * transient failures gracefully.\n */\nexport class GeolocationClient extends BaseClient {\n constructor(config: GeolocationClientConfig) {\n // Convert GeolocationClientConfig to BaseClientConfig\n const baseConfig: BaseClientConfig = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey,\n headers: config.headers,\n timeout: config.timeout,\n retries: 3, // Default retry count for geolocation calls\n debug: config.debug,\n };\n super(baseConfig);\n }\n\n // ============================================================================\n // IP Verification & Compliance\n // ============================================================================\n\n /**\n * Verify an IP address and check compliance\n *\n * Uses requestWithRetry() for automatic retry on transient failures.\n *\n * @param request - Verification request with IP, user ID, event type, and optional device fingerprint\n * @returns Location verification result with risk assessment\n *\n * @example\n * ```typescript\n * const result = await client.verifyIP({\n * ip_address: \"8.8.8.8\",\n * user_id: \"user_123\",\n * event_type: \"login\",\n * device_fingerprint: {\n * device_id: \"device_abc\",\n * user_agent: navigator.userAgent,\n * platform: \"web\"\n * }\n * });\n *\n * if (result.is_blocked) {\n * console.log(\"Access blocked:\", result.risk_reasons);\n * }\n * ```\n */\n async verifyIP(request: VerifyIPRequest): Promise<LocationVerification> {\n // Use requestWithRetry for critical verification calls\n return this.requestWithRetry<LocationVerification>('/api/v1/geo/verify', {\n method: 'POST',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Check compliance for a specific country\n *\n * @param countryISO - ISO 3166-1 alpha-2 country code (e.g., \"US\", \"GB\")\n * @returns Jurisdiction configuration and compliance status\n *\n * @example\n * ```typescript\n * const compliance = await client.checkCompliance(\"KP\"); // North Korea\n * if (!compliance.is_compliant) {\n * console.log(\"Country is not allowed:\", compliance.jurisdiction?.status);\n * }\n * ```\n */\n async checkCompliance(countryISO: string): Promise<ComplianceCheckResponse> {\n return this.requestWithRetry<ComplianceCheckResponse>(\n `/api/v1/geo/check-compliance`,\n {\n method: 'POST',\n body: JSON.stringify({ country_iso: countryISO }),\n }\n );\n }\n\n // ============================================================================\n // CipherText Validation\n // ============================================================================\n\n /**\n * Validate a cipherText generated by the frontend SDK\n *\n * The cipherText contains encrypted device fingerprint and optional location data.\n * This method decrypts and validates the data, returning device info, location,\n * and risk assessment.\n *\n * @param cipherText - The encrypted cipherText string from generateCipherText()\n * @param userId - User ID associated with this verification\n * @param eventType - Reason for verification (login, registration, etc.)\n * @param expectedIP - Optional expected IP address for additional validation\n * @returns Validation result with device info, location, and risk assessment\n *\n * @example\n * ```typescript\n * // Validate cipherText during login\n * const result = await client.validateCipherText(\n * cipherText,\n * \"user_123\",\n * \"login\"\n * );\n *\n * if (!result.valid) {\n * console.log(\"CipherText validation failed:\", result.errors);\n * return;\n * }\n *\n * console.log(\"Device UUID:\", result.device_uuid);\n * console.log(\"IP Address:\", result.ip_address);\n * console.log(\"Risk Level:\", result.risk.level);\n *\n * if (result.risk.is_vpn) {\n * console.log(\"VPN detected\");\n * }\n * ```\n */\n async validateCipherText(\n cipherText: string,\n userId: string,\n eventType: CipherTextReason,\n expectedIP?: string\n ): Promise<ValidateCipherTextResponse> {\n const request: ValidateCipherTextRequest = {\n cipher_text: cipherText,\n user_id: userId,\n event_type: eventType,\n expected_ip: expectedIP,\n };\n\n return this.requestWithRetry<ValidateCipherTextResponse>(\n '/api/v1/geo/validate-ciphertext',\n {\n method: 'POST',\n body: JSON.stringify(request),\n }\n );\n }\n\n /**\n * Validate cipherText and verify IP in a single call\n *\n * Combines cipherText validation with IP verification for complete\n * location and device verification in one request.\n *\n * @param cipherText - The encrypted cipherText string\n * @param ipAddress - Client IP address\n * @param userId - User ID\n * @param eventType - Event type (login, registration, etc.)\n * @returns Combined validation and verification result\n *\n * @example\n * ```typescript\n * const result = await client.validateAndVerify(\n * cipherText,\n * clientIP,\n * \"user_123\",\n * \"registration\"\n * );\n *\n * if (!result.ciphertext_valid) {\n * throw new Error(\"Device verification failed\");\n * }\n *\n * if (result.location.is_blocked) {\n * throw new Error(\"Location not allowed\");\n * }\n * ```\n */\n async validateAndVerify(\n cipherText: string,\n ipAddress: string,\n userId: string,\n eventType: CipherTextReason\n ): Promise<{\n ciphertext_valid: boolean;\n ciphertext_result: ValidateCipherTextResponse;\n location: LocationVerification;\n }> {\n // First validate cipherText to get device info\n const cipherTextResult = await this.validateCipherText(\n cipherText,\n userId,\n eventType,\n ipAddress\n );\n\n // Then verify IP with device fingerprint from cipherText\n const locationResult = await this.verifyIP({\n ip_address: ipAddress,\n user_id: userId,\n event_type: eventType,\n device_fingerprint: cipherTextResult.valid && cipherTextResult.device\n ? {\n device_id: cipherTextResult.device_uuid,\n user_agent: '',\n platform: cipherTextResult.device.platform,\n browser: cipherTextResult.device.browser,\n os: cipherTextResult.device.os,\n }\n : undefined,\n });\n\n return {\n ciphertext_valid: cipherTextResult.valid,\n ciphertext_result: cipherTextResult,\n location: locationResult,\n };\n }\n\n /**\n * Get location history for a user\n *\n * @param userId - User ID to retrieve history for\n * @param limit - Maximum number of records to return (default: 100)\n * @returns Array of geolocation records\n */\n async getUserLocationHistory(\n userId: string,\n limit: number = 100\n ): Promise<GeolocationRecord[]> {\n return this.request<GeolocationRecord[]>(\n `/api/v1/geo/user/?user_id=${userId}&limit=${limit}`\n );\n }\n\n // ============================================================================\n // Alert Management\n // ============================================================================\n\n /**\n * Get a specific alert by ID\n *\n * @param alertId - Alert ID\n * @returns Alert details\n */\n async getAlert(alertId: string): Promise<GeolocationAlert> {\n return this.request<GeolocationAlert>(`/api/v1/alerts/${alertId}`);\n }\n\n /**\n * List alerts with filters and pagination\n *\n * @param filters - Optional filters (status, severity, type, user, dates)\n * @param pagination - Optional pagination (page, page_size)\n * @returns Paginated list of alerts\n *\n * @example\n * ```typescript\n * const alerts = await client.listAlerts(\n * { status: \"active\", severity: \"critical\" },\n * { page: 1, page_size: 20 }\n * );\n * console.log(`Found ${alerts.total} critical alerts`);\n * ```\n */\n async listAlerts(\n filters?: AlertFilters,\n pagination?: PaginationParams\n ): Promise<AlertListResponse> {\n const params: Record<string, unknown> = {\n ...filters,\n ...pagination,\n };\n\n return this.request<AlertListResponse>(`/api/v1/alerts${this.buildQueryString(params)}`);\n }\n\n /**\n * Update alert status\n *\n * @param alertId - Alert ID\n * @param status - New status\n */\n async updateAlertStatus(alertId: string, status: AlertStatus): Promise<void> {\n await this.request(`/api/v1/alerts/${alertId}/status`, {\n method: 'PUT',\n body: JSON.stringify({ status }),\n });\n }\n\n /**\n * Assign an alert to an analyst\n *\n * @param alertId - Alert ID\n * @param assignedTo - User ID to assign to\n */\n async assignAlert(alertId: string, assignedTo: string): Promise<void> {\n await this.request(`/api/v1/alerts/${alertId}/assign`, {\n method: 'POST',\n body: JSON.stringify({ assigned_to: assignedTo }),\n });\n }\n\n /**\n * Resolve an alert\n *\n * @param alertId - Alert ID\n * @param resolution - Resolution type\n * @param notes - Optional notes\n */\n async resolveAlert(\n alertId: string,\n resolution: string,\n notes?: string\n ): Promise<void> {\n await this.request(`/api/v1/alerts/${alertId}/resolve`, {\n method: 'POST',\n body: JSON.stringify({ resolution, notes }),\n });\n }\n\n /**\n * Dismiss an alert as false positive\n *\n * @param alertId - Alert ID\n * @param notes - Optional notes explaining why it's a false positive\n */\n async dismissAlert(alertId: string, notes?: string): Promise<void> {\n await this.request(`/api/v1/alerts/${alertId}/dismiss`, {\n method: 'POST',\n body: JSON.stringify({ notes }),\n });\n }\n\n /**\n * Escalate an alert to higher severity or different assignee\n *\n * @param alertId - Alert ID\n * @param assignedTo - New assignee user ID\n * @param severity - New severity level\n * @param notes - Escalation notes\n */\n async escalateAlert(\n alertId: string,\n assignedTo: string,\n severity: string,\n notes: string\n ): Promise<void> {\n await this.request(`/api/v1/alerts/${alertId}/escalate`, {\n method: 'POST',\n body: JSON.stringify({ assigned_to: assignedTo, severity, notes }),\n });\n }\n\n /**\n * Block an alert (mark as blocked)\n *\n * @param alertId - Alert ID\n * @param notes - Optional notes\n */\n async blockAlert(alertId: string, notes?: string): Promise<void> {\n await this.request(`/api/v1/alerts/${alertId}/block`, {\n method: 'POST',\n body: JSON.stringify({ notes }),\n });\n }\n\n /**\n * Get dashboard metrics\n *\n * @param timeRangeHours - Time range in hours (default: 24)\n * @returns Dashboard metrics and statistics\n *\n * @example\n * ```typescript\n * const metrics = await client.getDashboardMetrics(168); // Last 7 days\n * console.log(`${metrics.critical_alerts} critical alerts in last week`);\n * ```\n */\n async getDashboardMetrics(timeRangeHours: number = 24): Promise<DashboardMetrics> {\n return this.request<DashboardMetrics>(\n `/api/v1/alerts/metrics?time_range_hours=${timeRangeHours}`\n );\n }\n\n // ============================================================================\n // Jurisdiction Configuration\n // ============================================================================\n\n /**\n * List all jurisdiction configurations\n *\n * @returns Array of jurisdiction configurations\n */\n async listJurisdictions(): Promise<JurisdictionConfig[]> {\n return this.request<JurisdictionConfig[]>('/api/v1/jurisdictions');\n }\n\n /**\n * Get a jurisdiction configuration by ID\n *\n * @param jurisdictionId - Jurisdiction ID\n * @returns Jurisdiction configuration\n */\n async getJurisdiction(jurisdictionId: string): Promise<JurisdictionConfig> {\n return this.request<JurisdictionConfig>(`/api/v1/jurisdictions/${jurisdictionId}`);\n }\n\n /**\n * Create a new jurisdiction configuration\n *\n * @param request - Jurisdiction configuration data\n * @returns Created jurisdiction\n *\n * @example\n * ```typescript\n * const jurisdiction = await client.createJurisdiction({\n * country_iso: \"US\",\n * country_name: \"United States\",\n * status: \"allowed\",\n * risk_level: \"low\",\n * allow_login: true,\n * allow_registration: true,\n * allow_transactions: true,\n * require_kyc: false,\n * require_enhanced_verification: false\n * });\n * ```\n */\n async createJurisdiction(request: CreateJurisdictionRequest): Promise<JurisdictionConfig> {\n return this.request<JurisdictionConfig>('/api/v1/jurisdictions', {\n method: 'POST',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Update a jurisdiction configuration\n *\n * @param jurisdictionId - Jurisdiction ID\n * @param request - Updated fields\n * @returns Updated jurisdiction\n */\n async updateJurisdiction(\n jurisdictionId: string,\n request: UpdateJurisdictionRequest\n ): Promise<JurisdictionConfig> {\n return this.request<JurisdictionConfig>(`/api/v1/jurisdictions/${jurisdictionId}`, {\n method: 'PUT',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Delete a jurisdiction configuration\n *\n * @param jurisdictionId - Jurisdiction ID\n */\n async deleteJurisdiction(jurisdictionId: string): Promise<void> {\n await this.request(`/api/v1/jurisdictions/${jurisdictionId}`, {\n method: 'DELETE',\n });\n }\n\n // ============================================================================\n // Geofence Rules\n // ============================================================================\n\n /**\n * List all geofence rules\n *\n * @returns Array of geofence rules\n */\n async listGeofenceRules(): Promise<GeofenceRule[]> {\n return this.request<GeofenceRule[]>('/api/v1/geofence-rules');\n }\n\n /**\n * Get a geofence rule by ID\n *\n * @param ruleId - Geofence rule ID\n * @returns Geofence rule\n */\n async getGeofenceRule(ruleId: string): Promise<GeofenceRule> {\n return this.request<GeofenceRule>(`/api/v1/geofence-rules/${ruleId}`);\n }\n\n /**\n * Create a new geofence rule\n *\n * @param request - Geofence rule data\n * @returns Created geofence rule\n *\n * @example\n * ```typescript\n * const rule = await client.createGeofenceRule({\n * name: \"Block High Risk Countries\",\n * rule_type: \"block_list\",\n * action: \"block\",\n * countries: [\"KP\", \"IR\", \"SY\"],\n * event_types: [\"login\", \"transaction\"],\n * priority: 100\n * });\n * ```\n */\n async createGeofenceRule(request: CreateGeofenceRuleRequest): Promise<GeofenceRule> {\n return this.request<GeofenceRule>('/api/v1/geofence-rules', {\n method: 'POST',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Update a geofence rule\n *\n * @param ruleId - Geofence rule ID\n * @param request - Updated fields\n * @returns Updated geofence rule\n */\n async updateGeofenceRule(\n ruleId: string,\n request: UpdateGeofenceRuleRequest\n ): Promise<GeofenceRule> {\n return this.request<GeofenceRule>(`/api/v1/geofence-rules/${ruleId}`, {\n method: 'PUT',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Delete a geofence rule\n *\n * @param ruleId - Geofence rule ID\n */\n async deleteGeofenceRule(ruleId: string): Promise<void> {\n await this.request(`/api/v1/geofence-rules/${ruleId}`, {\n method: 'DELETE',\n });\n }\n\n // ============================================================================\n // Device Fingerprinting\n // ============================================================================\n\n /**\n * Get all devices for a user\n *\n * @param userId - User ID\n * @returns Array of device fingerprints\n */\n async getUserDevices(userId: string): Promise<DeviceFingerprint[]> {\n return this.request<DeviceFingerprint[]>(`/api/v1/devices/user/?user_id=${userId}`);\n }\n\n /**\n * Get a specific device by device ID\n *\n * @param deviceId - Device ID\n * @returns Device fingerprint\n */\n async getDevice(deviceId: string): Promise<DeviceFingerprint> {\n return this.request<DeviceFingerprint>(`/api/v1/devices/?device_id=${deviceId}`);\n }\n\n /**\n * Update device trust status\n *\n * @param deviceId - Device ID\n * @param action - \"trust\" or \"untrust\"\n *\n * @example\n * ```typescript\n * // Mark a device as trusted\n * await client.updateDeviceTrust(\"device_abc\", \"trust\");\n *\n * // Mark a device as untrusted\n * await client.updateDeviceTrust(\"device_xyz\", \"untrust\");\n * ```\n */\n async updateDeviceTrust(\n deviceId: string,\n action: 'trust' | 'untrust'\n ): Promise<void> {\n await this.request(`/api/v1/devices/?device_id=${deviceId}&action=${action}`, {\n method: 'POST',\n });\n }\n\n // ============================================================================\n // Location Request (Live Location Tracking)\n // ============================================================================\n\n /**\n * Create a location request to get customer's live location\n *\n * @param request - Location request details\n * @returns Location request result with share link\n *\n * @example\n * ```typescript\n * const result = await client.createLocationRequest({\n * user_id: \"customer_123\",\n * channel: \"sms\",\n * phone: \"+1234567890\",\n * reason: \"Verification for high-value transaction\"\n * });\n *\n * console.log(`Share link sent: ${result.share_link}`);\n * console.log(`Expires at: ${result.token_expiry}`);\n * ```\n */\n async createLocationRequest(\n request: CreateLocationRequestRequest\n ): Promise<LocationRequestResult> {\n return this.request<LocationRequestResult>('/api/v1/location-requests', {\n method: 'POST',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Get a location request by ID\n *\n * @param requestId - Location request ID\n * @returns Location request details\n */\n async getLocationRequest(requestId: string): Promise<LocationRequest> {\n return this.request<LocationRequest>(`/api/v1/location-requests/${requestId}`);\n }\n\n /**\n * List location requests with filters and pagination\n *\n * @param filters - Optional filters\n * @param pagination - Optional pagination\n * @returns Paginated list of location requests\n *\n * @example\n * ```typescript\n * const requests = await client.listLocationRequests(\n * { status: \"completed\", user_id: \"customer_123\" },\n * { page: 1, limit: 20 }\n * );\n * ```\n */\n async listLocationRequests(\n filters?: LocationRequestFilters,\n pagination?: PaginationParams\n ): Promise<LocationRequestListResponse> {\n const params: Record<string, unknown> = {\n ...filters,\n ...pagination,\n };\n\n return this.request<LocationRequestListResponse>(\n `/api/v1/location-requests${this.buildQueryString(params)}`\n );\n }\n\n /**\n * Cancel a pending location request\n *\n * @param requestId - Location request ID\n */\n async cancelLocationRequest(requestId: string): Promise<void> {\n await this.request(`/api/v1/location-requests/${requestId}/cancel`, {\n method: 'POST',\n });\n }\n\n /**\n * Resend notification for a location request\n *\n * @param requestId - Location request ID\n * @param contact - Email or phone to send to\n */\n async resendLocationRequest(\n requestId: string,\n contact: ResendLocationRequestRequest\n ): Promise<void> {\n await this.request(`/api/v1/location-requests/${requestId}/resend`, {\n method: 'POST',\n body: JSON.stringify(contact),\n });\n }\n\n // ============================================================================\n // Location Share (Customer-facing - for SDK integration in customer apps)\n // ============================================================================\n\n /**\n * Get location share info (customer-facing)\n * This is called from the customer's device to get request details\n *\n * @param token - Secure token from share link\n * @returns Location share info\n */\n async getLocationShareInfo(token: string): Promise<LocationShareInfo> {\n return this.request<LocationShareInfo>(`/api/v1/location/share/${token}`);\n }\n\n /**\n * Submit location capture (customer-facing)\n * This is called from the customer's device to submit their location\n *\n * @param token - Secure token from share link\n * @param capture - Location capture data (GPS or WiFi)\n * @returns Capture response\n *\n * @example\n * ```typescript\n * // Using GPS (preferred)\n * const result = await client.captureLocation(token, {\n * latitude: 37.7749,\n * longitude: -122.4194,\n * accuracy: 10\n * });\n *\n * // Using WiFi positioning (fallback)\n * const result = await client.captureLocation(token, {\n * wifi_networks: [\n * { macAddress: \"00:11:22:33:44:55\", signalStrength: -50 },\n * { macAddress: \"AA:BB:CC:DD:EE:FF\", signalStrength: -70 }\n * ]\n * });\n * ```\n */\n async captureLocation(\n token: string,\n capture: LocationCaptureRequest\n ): Promise<LocationCaptureResponse> {\n return this.request<LocationCaptureResponse>(`/api/v1/location/share/${token}`, {\n method: 'POST',\n body: JSON.stringify(capture),\n });\n }\n\n // ============================================================================\n // Utility Methods (inherited from BaseClient: healthCheck, updateConfig, getConfig, buildQueryString)\n // ============================================================================\n}\n","/**\n * RiskProfileClient - Customer Risk Profile Management\n *\n * Provides methods to create, retrieve, and manage customer risk profiles\n * in the Vesant Compliance Platform.\n */\n\nimport { BaseClient } from '../core/client';\nimport type { BaseClientConfig } from '../core/config';\nimport type {\n CustomerProfile,\n CreateProfileRequest,\n UpdateProfileRequest,\n ProfileDetailsResponse,\n ProfileFilters,\n ProfileListResponse,\n RiskDashboardMetrics,\n RiskConfiguration,\n} from './types';\n\nexport class RiskProfileClient extends BaseClient {\n constructor(config: BaseClientConfig) {\n super(config);\n }\n\n // ============================================================================\n // Profile Management\n // ============================================================================\n\n /**\n * Create a new customer risk profile\n *\n * @param request - Profile creation data\n * @returns Created customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.createProfile({\n * customer_id: 'CUST-12345',\n * entity_type: 'individual',\n * customer_status: 'active',\n * full_name: 'John Doe',\n * email_address: 'john@example.com',\n * date_of_birth: '1990-01-15',\n * country_of_residence: 'US'\n * });\n * ```\n */\n async createProfile(request: CreateProfileRequest): Promise<CustomerProfile> {\n return this.request<CustomerProfile>('/api/v1/profiles', {\n method: 'POST',\n body: JSON.stringify(request),\n });\n }\n\n /**\n * Get customer profile by customer ID\n *\n * Note: This searches for the profile using the customer_id field.\n * Returns the first matching profile for the tenant.\n *\n * @param customerId - Customer ID to search for\n * @returns Customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.getProfile('CUST-12345');\n * console.log('Risk score:', profile.risk_score);\n * ```\n */\n async getProfile(customerId: string): Promise<CustomerProfile> {\n const response = await this.queryProfiles({\n search: customerId,\n page: 1,\n page_size: 1,\n });\n\n if (response.data.length === 0) {\n throw new Error(`Profile not found for customer ID: ${customerId}`);\n }\n\n return response.data[0];\n }\n\n /**\n * Get profile by UUID\n *\n * @param profileId - Profile UUID\n * @returns Customer profile\n */\n async getProfileById(profileId: string): Promise<CustomerProfile> {\n // Note: The dashboard endpoint provides detailed profile view\n const details = await this.getProfileDetails(profileId);\n return details.profile;\n }\n\n /**\n * Get detailed profile information including risk factors and history\n *\n * @param profileId - Profile UUID\n * @returns Detailed profile response with risk factors and history\n *\n * @example\n * ```typescript\n * const details = await client.getProfileDetails(profileId);\n * console.log('Risk factors:', details.risk_factors);\n * console.log('Risk history:', details.risk_history);\n * console.log('Alert counts:', {\n * watchlist: details.watchlist_alert_count,\n * fraud: details.fraud_alert_count,\n * geo: details.geolocation_alert_count\n * });\n * ```\n */\n async getProfileDetails(profileId: string): Promise<ProfileDetailsResponse> {\n return this.request<ProfileDetailsResponse>(\n `/api/v1/risk-dashboard/profiles/${profileId}`\n );\n }\n\n /**\n * Update customer profile\n *\n * @param profileId - Profile UUID\n * @param updates - Fields to update\n * @returns Updated customer profile\n *\n * @example\n * ```typescript\n * const updated = await client.updateProfile(profileId, {\n * location: 'New York, USA',\n * location_compliance: 'compliant',\n * last_recorded_activity: new Date().toISOString()\n * });\n * ```\n */\n async updateProfile(\n profileId: string,\n updates: UpdateProfileRequest\n ): Promise<CustomerProfile> {\n return this.request<CustomerProfile>(`/api/v1/profiles/${profileId}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n });\n }\n\n /**\n * Manually recalculate risk score for a profile\n *\n * Triggers immediate risk score recalculation based on current risk factors.\n *\n * @param profileId - Profile UUID\n * @param reason - Optional reason for recalculation\n *\n * @example\n * ```typescript\n * await client.recalculateRiskScore(profileId, 'Manual review completed');\n * ```\n */\n async recalculateRiskScore(profileId: string, reason?: string): Promise<void> {\n const body = reason ? JSON.stringify({ reason }) : undefined;\n await this.request(`/api/v1/profiles/recalculate/${profileId}`, {\n method: 'POST',\n body,\n });\n }\n\n // ============================================================================\n // Query & Search\n // ============================================================================\n\n /**\n * Query profiles with advanced filters\n *\n * @param filters - Filter criteria and pagination\n * @returns Paginated list of profiles\n *\n * @example\n * ```typescript\n * const results = await client.queryProfiles({\n * risk_category: ['high', 'critical'],\n * kyc_status: ['pending'],\n * is_pep: true,\n * page: 1,\n * page_size: 20,\n * sort_by: 'risk_score',\n * sort_order: 'desc'\n * });\n *\n * console.log(`Found ${results.total} high-risk profiles`);\n * results.data.forEach(profile => {\n * console.log(`${profile.full_name}: ${profile.risk_score}`);\n * });\n * ```\n */\n async queryProfiles(filters: ProfileFilters = {}): Promise<ProfileListResponse> {\n const queryString = this.buildQueryString(filters as Record<string, unknown>);\n return this.request<ProfileListResponse>(\n `/api/v1/risk-dashboard/profiles${queryString}`\n );\n }\n\n /**\n * Search profiles by text (searches name, email, customer_id, account_number)\n *\n * @param searchText - Text to search for\n * @param limit - Maximum results to return (default: 10)\n * @returns Array of matching profiles\n */\n async searchProfiles(searchText: string, limit: number = 10): Promise<CustomerProfile[]> {\n const response = await this.queryProfiles({\n search: searchText,\n page: 1,\n page_size: limit,\n });\n return response.data;\n }\n\n /**\n * Get all high-risk profiles (high + critical)\n *\n * @param limit - Maximum results to return (default: 50)\n * @returns Array of high-risk profiles\n */\n async getHighRiskProfiles(limit: number = 50): Promise<CustomerProfile[]> {\n const response = await this.queryProfiles({\n risk_category: ['high', 'critical'],\n page: 1,\n page_size: limit,\n sort_by: 'risk_score',\n sort_order: 'desc',\n });\n return response.data;\n }\n\n /**\n * Get profiles requiring PEP review\n *\n * @param limit - Maximum results to return (default: 50)\n * @returns Array of PEP profiles\n */\n async getPEPProfiles(limit: number = 50): Promise<CustomerProfile[]> {\n const response = await this.queryProfiles({\n is_pep: true,\n page: 1,\n page_size: limit,\n });\n return response.data;\n }\n\n /**\n * Get profiles with sanctions matches\n *\n * @param limit - Maximum results to return (default: 50)\n * @returns Array of sanctioned profiles\n */\n async getSanctionedProfiles(limit: number = 50): Promise<CustomerProfile[]> {\n const response = await this.queryProfiles({\n has_sanctions: true,\n page: 1,\n page_size: limit,\n });\n return response.data;\n }\n\n // ============================================================================\n // Dashboard & Metrics\n // ============================================================================\n\n /**\n * Get risk dashboard metrics and statistics\n *\n * @param startDate - Optional start date for metrics (ISO format)\n * @param endDate - Optional end date for metrics (ISO format)\n * @returns Dashboard metrics\n *\n * @example\n * ```typescript\n * const metrics = await client.getDashboardMetrics();\n * console.log('Total risky profiles:', metrics.total_risky_profiles);\n * console.log('Critical profiles:', metrics.total_critical_profiles);\n * console.log('Average risk score:', metrics.average_risk_score);\n *\n * metrics.risk_distribution.forEach(item => {\n * console.log(`${item.category}: ${item.count} (${item.percentage}%)`);\n * });\n * ```\n */\n async getDashboardMetrics(\n startDate?: string,\n endDate?: string\n ): Promise<RiskDashboardMetrics> {\n const params: Record<string, string> = {};\n if (startDate) params.start_date = startDate;\n if (endDate) params.end_date = endDate;\n\n const queryString = this.buildQueryString(params);\n return this.request<RiskDashboardMetrics>(\n `/api/v1/risk-dashboard/metrics${queryString}`\n );\n }\n\n // ============================================================================\n // Bulk Operations\n // ============================================================================\n\n /**\n * Get or create profile (idempotent operation)\n *\n * Attempts to get existing profile by customer_id, creates if not found.\n *\n * @param customerId - Customer ID\n * @param createRequest - Profile data to use if creating new profile\n * @returns Existing or newly created profile\n *\n * @example\n * ```typescript\n * const profile = await client.getOrCreateProfile('CUST-123', {\n * customer_id: 'CUST-123',\n * entity_type: 'individual',\n * full_name: 'John Doe',\n * email_address: 'john@example.com'\n * });\n * ```\n */\n async getOrCreateProfile(\n customerId: string,\n createRequest: CreateProfileRequest\n ): Promise<CustomerProfile> {\n try {\n return await this.getProfile(customerId);\n } catch (error) {\n // Profile doesn't exist, create it\n return await this.createProfile(createRequest);\n }\n }\n\n /**\n * Batch get profiles by customer IDs\n *\n * @param customerIds - Array of customer IDs\n * @returns Array of profiles (may be less than input if some not found)\n */\n async batchGetProfiles(customerIds: string[]): Promise<CustomerProfile[]> {\n // Note: Current API doesn't have batch endpoint, so we query with search\n // In production, this should use a dedicated batch endpoint\n const profiles: CustomerProfile[] = [];\n\n for (const customerId of customerIds) {\n try {\n const profile = await this.getProfile(customerId);\n profiles.push(profile);\n } catch (error) {\n // Profile not found, skip\n if (this.config.debug) {\n console.warn(`[RiskProfileClient] Profile not found for: ${customerId}`);\n }\n }\n }\n\n return profiles;\n }\n\n // ============================================================================\n // Configuration\n // ============================================================================\n\n /**\n * Get risk configuration for tenant\n *\n * Returns the risk scoring weights and thresholds configured for the tenant.\n *\n * @returns Risk configuration\n */\n async getRiskConfiguration(): Promise<RiskConfiguration> {\n return this.request<RiskConfiguration>('/api/v1/risk-config');\n }\n\n /**\n * Update risk configuration for tenant\n *\n * Updates risk scoring weights and/or thresholds.\n *\n * @param config - Configuration updates\n * @returns Updated risk configuration\n */\n async updateRiskConfiguration(\n config: Partial<RiskConfiguration>\n ): Promise<RiskConfiguration> {\n return this.request<RiskConfiguration>('/api/v1/risk-config', {\n method: 'PUT',\n body: JSON.stringify(config),\n });\n }\n}\n","/**\n * Compliance orchestration types\n *\n * Types for unified compliance verification flows that combine\n * geolocation verification with customer risk profiling.\n */\n\nimport type { LocationVerification, DeviceFingerprintRequest } from '../geolocation/types';\nimport type { CustomerProfile, EntityType } from '../risk-profile/types';\n\n// ============================================================================\n// Registration Verification Types\n// ============================================================================\n\nexport interface RegistrationVerificationRequest {\n // Identity\n customerId: string;\n fullName: string;\n emailAddress: string;\n phoneNumber?: string;\n dateOfBirth?: string;\n address?: string;\n entityType?: EntityType;\n\n // Geolocation\n ipAddress: string;\n deviceFingerprint?: DeviceFingerprintRequest;\n\n // Additional data\n metadata?: Record<string, unknown>;\n}\n\nexport interface RegistrationVerificationResponse {\n allowed: boolean;\n geolocation: LocationVerification;\n profile: CustomerProfile;\n requiresKYC: boolean;\n requiresEDD: boolean;\n blockReasons: string[];\n processingTime: number;\n}\n\n// ============================================================================\n// Login Verification Types\n// ============================================================================\n\nexport interface LoginVerificationRequest {\n customerId: string;\n ipAddress: string;\n deviceFingerprint?: DeviceFingerprintRequest;\n metadata?: Record<string, unknown>;\n}\n\nexport interface LoginVerificationResponse {\n allowed: boolean;\n geolocation: LocationVerification;\n profile: CustomerProfile;\n requiresStepUp: boolean;\n blockReasons: string[];\n processingTime: number;\n}\n\n// ============================================================================\n// Transaction Verification Types\n// ============================================================================\n\nexport interface TransactionVerificationRequest {\n customerId: string;\n ipAddress: string;\n amount: number;\n currency: string;\n transactionType?: 'deposit' | 'withdrawal' | 'bet' | 'transfer' | 'payout';\n deviceFingerprint?: DeviceFingerprintRequest;\n metadata?: Record<string, unknown>;\n}\n\nexport interface TransactionVerificationResponse {\n allowed: boolean;\n geolocation: LocationVerification;\n profile: CustomerProfile;\n transactionRisk: TransactionRiskResult;\n requiresApproval: boolean;\n blockReasons: string[];\n processingTime: number;\n}\n\nexport interface TransactionRiskResult {\n score: number;\n level: 'low' | 'medium' | 'high' | 'critical';\n factors: string[];\n allowed: boolean;\n requiresManualReview: boolean;\n}\n\n// ============================================================================\n// Generic Event Verification Types\n// ============================================================================\n\nexport interface EventVerificationRequest {\n customerId: string;\n ipAddress: string;\n eventType: string;\n deviceFingerprint?: DeviceFingerprintRequest;\n metadata?: Record<string, unknown>;\n}\n\nexport interface EventVerificationResponse {\n allowed: boolean;\n geolocation: LocationVerification;\n blockReasons: string[];\n processingTime: number;\n}\n\n// ============================================================================\n// Currency Exchange Rates (for transaction risk calculation)\n// ============================================================================\n\nexport interface CurrencyRates {\n [currency: string]: number; // Rate to USD\n}\n\nexport const DEFAULT_CURRENCY_RATES: CurrencyRates = {\n USD: 1.0,\n EUR: 1.1,\n GBP: 1.27,\n CAD: 0.74,\n AUD: 0.66,\n JPY: 0.0067,\n CHF: 1.13,\n CNY: 0.14,\n INR: 0.012,\n BRL: 0.20,\n MXN: 0.058,\n ZAR: 0.055,\n};\n\n// ============================================================================\n// Pre-check Types\n// ============================================================================\n\nexport interface RegistrationPreCheckResult {\n canRegister: boolean;\n jurisdiction: import('../geolocation/types').JurisdictionConfig | null;\n blockReasons: string[];\n riskLevel: 'low' | 'medium' | 'high' | 'critical';\n requiresKYC: boolean;\n requiresEDD: boolean;\n location: {\n country: string;\n countryISO: string;\n city: string;\n };\n}\n\n// ============================================================================\n// Sync Registration Types\n// ============================================================================\n\nexport interface RegistrationSyncOptions {\n /** Maximum time to wait for risk calculation in milliseconds (default: 5000) */\n maxWaitMs?: number;\n /** Polling interval in milliseconds (default: 500) */\n pollIntervalMs?: number;\n}\n\nexport interface RegistrationVerificationResponseWithSync extends RegistrationVerificationResponse {\n /** Whether the risk score was successfully synchronized */\n riskSynced: boolean;\n}\n\n// ============================================================================\n// Location Request Types (re-exported from geolocation for convenience)\n// ============================================================================\n\nexport type {\n LocationRequest,\n LocationRequestStatus,\n LocationRequestChannel,\n CreateLocationRequestRequest,\n LocationRequestResult,\n LocationRequestFilters,\n LocationRequestListResponse,\n ResendLocationRequestRequest,\n LocationShareInfo,\n LocationCaptureRequest,\n LocationCaptureResponse,\n} from '../geolocation/types';\n\n// ============================================================================\n// Compliance-specific Location Request Types\n// ============================================================================\n\nexport interface ComplianceLocationRequestInput {\n /** Customer user ID to request location from */\n customerId: string;\n /** Notification channel to use */\n channel: 'sms' | 'email' | 'push';\n /** Reason for requesting location (for compliance/audit) */\n reason: string;\n /** Customer email (required for email channel) */\n email?: string;\n /** Customer phone (required for SMS channel) */\n phone?: string;\n /** Custom expiry time in hours (default: 24) */\n expiryHours?: number;\n}\n\nexport interface ComplianceLocationRequestResult {\n /** The created location request */\n request: import('../geolocation/types').LocationRequest;\n /** Shareable link for the customer */\n shareLink: string;\n /** Token expiration time */\n tokenExpiry: string;\n /** Customer profile (if available) */\n profile?: import('../risk-profile/types').CustomerProfile;\n}\n","/**\n * ComplianceClient - Unified Compliance Orchestration\n *\n * Main integration point for casino platforms. Orchestrates geolocation\n * verification with customer risk profiling for complete compliance coverage.\n *\n * GeoComply-style approach: SDK is the primary data injection point.\n */\n\nimport { GeolocationClient } from '../geolocation/client';\nimport { RiskProfileClient } from '../risk-profile/client';\nimport type { CGSConfig, RequiredCGSConfig } from '../core/config';\nimport { ComplianceError, ValidationError } from '../core/errors';\nimport type { JurisdictionConfig, LocationVerification } from '../geolocation/types';\nimport type { CustomerProfile } from '../risk-profile/types';\nimport type {\n RegistrationVerificationRequest,\n RegistrationVerificationResponse,\n LoginVerificationRequest,\n LoginVerificationResponse,\n TransactionVerificationRequest,\n TransactionVerificationResponse,\n TransactionRiskResult,\n EventVerificationRequest,\n EventVerificationResponse,\n CurrencyRates,\n ComplianceLocationRequestInput,\n ComplianceLocationRequestResult,\n} from './types';\nimport { DEFAULT_CURRENCY_RATES } from './types';\nimport type {\n LocationRequest,\n LocationRequestFilters,\n LocationRequestListResponse,\n PaginationParams,\n} from '../geolocation/types';\n\nexport class ComplianceClient {\n private geoClient: GeolocationClient;\n private riskClient: RiskProfileClient;\n private config: RequiredCGSConfig;\n private currencyRates: CurrencyRates;\n\n constructor(config: CGSConfig) {\n this.config = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey || '',\n headers: config.headers || {},\n timeout: config.timeout || 10000,\n retries: config.retries || 3,\n debug: config.debug || false,\n autoCreateProfiles: config.autoCreateProfiles !== false, // default true\n syncMode: config.syncMode || 'sync',\n };\n\n this.geoClient = new GeolocationClient({\n baseURL: this.config.baseURL,\n tenantId: this.config.tenantId,\n apiKey: this.config.apiKey,\n headers: this.config.headers,\n timeout: this.config.timeout,\n debug: this.config.debug,\n });\n\n this.riskClient = new RiskProfileClient({\n baseURL: this.config.baseURL,\n tenantId: this.config.tenantId,\n apiKey: this.config.apiKey,\n headers: this.config.headers,\n timeout: this.config.timeout,\n debug: this.config.debug,\n });\n\n this.currencyRates = DEFAULT_CURRENCY_RATES;\n }\n\n // ============================================================================\n // Main Verification Methods\n // ============================================================================\n\n /**\n * Verify customer registration with automatic profile creation\n *\n * This is the primary integration point for new customer sign-ups.\n * Combines geolocation verification with customer risk profile creation.\n *\n * Important: Profile is only created if geolocation verification passes.\n * This prevents orphaned geolocation records when registration is blocked.\n *\n * @param request - Registration verification request\n * @returns Verification response with profile and compliance status\n *\n * @example\n * ```typescript\n * const result = await sdk.verifyAtRegistration({\n * customerId: 'CUST-12345',\n * fullName: 'John Doe',\n * emailAddress: 'john@example.com',\n * ipAddress: req.ip,\n * deviceFingerprint: getDeviceFingerprint()\n * });\n *\n * if (result.allowed) {\n * // Create account\n * console.log('Profile created:', result.profile);\n * if (result.requiresKYC) {\n * // Redirect to KYC flow\n * }\n * } else {\n * // Block registration\n * console.log('Blocked:', result.blockReasons);\n * }\n * ```\n */\n async verifyAtRegistration(\n request: RegistrationVerificationRequest\n ): Promise<RegistrationVerificationResponse> {\n const startTime = Date.now();\n\n // Validate required fields before making any API calls\n this.validateRegistrationRequest(request);\n\n let geoVerification: LocationVerification | null = null;\n\n try {\n // Step 1: Verify geolocation\n if (this.config.debug) {\n console.log('[ComplianceSDK] Starting registration verification for:', request.customerId);\n }\n\n geoVerification = await this.geoClient.verifyIP({\n ip_address: request.ipAddress,\n user_id: request.customerId,\n event_type: 'registration',\n device_fingerprint: request.deviceFingerprint,\n });\n\n // Step 2: Check if registration should be blocked BEFORE creating profile\n // This prevents orphaned geo records and ensures atomic behavior\n const blockReasons = this.evaluateRegistrationBlock(geoVerification);\n\n if (blockReasons.length > 0) {\n if (this.config.debug) {\n console.log('[ComplianceSDK] Registration blocked at geo stage:', blockReasons);\n }\n\n // Return early without creating profile - prevents orphaned records\n return {\n allowed: false,\n geolocation: geoVerification,\n profile: null as unknown as CustomerProfile, // Type assertion for blocked case\n requiresKYC: false,\n requiresEDD: false,\n blockReasons: blockReasons,\n processingTime: Date.now() - startTime,\n };\n }\n\n // Step 3: Create customer risk profile (only if geo passed)\n const profile = await this.riskClient.createProfile({\n customer_id: request.customerId,\n entity_type: request.entityType || 'individual',\n customer_status: 'active',\n full_name: request.fullName,\n email_address: request.emailAddress,\n primary_phone_number: request.phoneNumber,\n date_of_birth: request.dateOfBirth,\n residential_address: request.address,\n country_of_residence: geoVerification.location.country_iso,\n\n // Geolocation data\n location: `${geoVerification.location.city}, ${geoVerification.location.country}`,\n location_compliance: geoVerification.is_compliant ? 'compliant' : 'non-compliant',\n\n // Initial KYC status\n kyc_status: 'pending',\n });\n\n // Step 4: Determine final status and requirements\n const requiresKYC = geoVerification.jurisdiction?.require_kyc || false;\n const requiresEDD = geoVerification.jurisdiction?.require_enhanced_verification || false;\n\n if (this.config.debug) {\n console.log('[ComplianceSDK] Registration verification complete:', {\n allowed: true,\n riskScore: geoVerification.risk_score,\n profileId: profile.id,\n requiresKYC,\n requiresEDD,\n });\n }\n\n return {\n allowed: true,\n geolocation: geoVerification,\n profile: profile,\n requiresKYC: requiresKYC,\n requiresEDD: requiresEDD,\n blockReasons: [],\n processingTime: Date.now() - startTime,\n };\n } catch (error) {\n if (this.config.debug) {\n console.error('[ComplianceSDK] Registration verification failed:', error);\n }\n\n // Provide detailed error context for debugging\n throw new ComplianceError(\n 'Registration verification failed',\n {\n stage: geoVerification ? 'profile_creation' : 'geo_verification',\n geoRecordId: geoVerification?.record_id,\n customerId: request.customerId,\n cause: error,\n },\n geoVerification ? 'PROFILE_CREATION_FAILED' : 'GEO_VERIFICATION_FAILED'\n );\n }\n }\n\n /**\n * Evaluate if registration should be blocked based on geolocation verification\n *\n * Checks:\n * 1. General compliance status (is_compliant)\n * 2. Explicit block flag (is_blocked)\n * 3. Jurisdiction-specific registration allowance (allow_registration)\n * 4. Risk level thresholds\n *\n * @param geoVerification - Geolocation verification result\n * @returns Array of block reasons (empty if allowed)\n */\n private evaluateRegistrationBlock(geoVerification: LocationVerification): string[] {\n const blockReasons: string[] = [];\n\n // Check if explicitly blocked\n if (geoVerification.is_blocked) {\n blockReasons.push(...geoVerification.risk_reasons);\n }\n\n // Check general compliance\n if (!geoVerification.is_compliant) {\n if (!blockReasons.includes('non_compliant_jurisdiction')) {\n blockReasons.push('non_compliant_jurisdiction');\n }\n }\n\n // CRITICAL: Check if registration is specifically allowed in this jurisdiction\n // Some jurisdictions may allow login but not new registrations\n const jurisdiction = geoVerification.jurisdiction;\n if (jurisdiction) {\n if (jurisdiction.allow_registration === false) {\n blockReasons.push('registration_not_allowed_in_jurisdiction');\n }\n\n // Check jurisdiction status for registration-specific blocks\n if (jurisdiction.status === 'blocked' || jurisdiction.status === 'sanctioned') {\n if (!blockReasons.includes('blocked_jurisdiction')) {\n blockReasons.push('blocked_jurisdiction');\n }\n }\n\n // Restricted jurisdictions need explicit registration permission\n if (jurisdiction.status === 'restricted' && jurisdiction.allow_registration === false) {\n if (!blockReasons.includes('restricted_jurisdiction_no_registration')) {\n blockReasons.push('restricted_jurisdiction_no_registration');\n }\n }\n }\n\n // Check geofence rule evaluation\n if (geoVerification.geofence_evaluation?.blocked) {\n blockReasons.push(...geoVerification.geofence_evaluation.reasons);\n }\n\n // Critical risk level should block registration\n if (geoVerification.risk_level === 'critical') {\n if (!blockReasons.includes('critical_risk_level')) {\n blockReasons.push('critical_risk_level');\n }\n }\n\n return [...new Set(blockReasons)]; // Deduplicate\n }\n\n /**\n * Validate registration request has all required fields\n *\n * @param request - Registration request to validate\n * @throws ValidationError if required fields are missing or invalid\n */\n private validateRegistrationRequest(request: RegistrationVerificationRequest): void {\n const errors: string[] = [];\n\n if (!request.customerId?.trim()) {\n errors.push('customerId is required');\n }\n\n if (!request.ipAddress?.trim()) {\n errors.push('ipAddress is required');\n } else if (!this.isValidIP(request.ipAddress)) {\n errors.push('ipAddress format is invalid');\n }\n\n if (!request.emailAddress?.trim()) {\n errors.push('emailAddress is required');\n } else if (!this.isValidEmail(request.emailAddress)) {\n errors.push('emailAddress format is invalid');\n }\n\n if (!request.fullName?.trim()) {\n errors.push('fullName is required');\n }\n\n if (errors.length > 0) {\n throw new ValidationError(`Invalid registration request: ${errors.join(', ')}`, errors);\n }\n }\n\n /**\n * Validate IP address format (IPv4 or IPv6)\n */\n private isValidIP(ip: string): boolean {\n // IPv4 pattern\n const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n // Simplified IPv6 pattern (covers most common cases)\n const ipv6Regex = /^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$|^::(?:[0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,7}:$|^(?:[0-9a-fA-F]{1,4}:){0,6}::(?:[0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}$/;\n\n return ipv4Regex.test(ip) || ipv6Regex.test(ip);\n }\n\n /**\n * Validate email address format\n */\n private isValidEmail(email: string): boolean {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email);\n }\n\n /**\n * Verify customer login with profile activity update\n *\n * Verifies geolocation and updates customer profile with latest activity.\n *\n * @param request - Login verification request\n * @returns Verification response with compliance status\n *\n * @example\n * ```typescript\n * const result = await sdk.verifyAtLogin({\n * customerId: 'CUST-12345',\n * ipAddress: req.ip,\n * deviceFingerprint: getDeviceFingerprint()\n * });\n *\n * if (result.allowed) {\n * // Allow login\n * if (result.requiresStepUp) {\n * // Trigger MFA or additional verification\n * }\n * } else {\n * // Block login\n * console.log('Blocked:', result.blockReasons);\n * }\n * ```\n */\n async verifyAtLogin(\n request: LoginVerificationRequest\n ): Promise<LoginVerificationResponse> {\n const startTime = Date.now();\n\n try {\n if (this.config.debug) {\n console.log('[ComplianceSDK] Starting login verification for:', request.customerId);\n }\n\n // Step 1: Verify geolocation\n const geoVerification = await this.geoClient.verifyIP({\n ip_address: request.ipAddress,\n user_id: request.customerId,\n event_type: 'login',\n device_fingerprint: request.deviceFingerprint,\n });\n\n // Step 2: Get or create profile\n let profile: CustomerProfile;\n try {\n profile = await this.riskClient.getProfile(request.customerId);\n\n // Update last activity and location\n if (this.shouldUpdateProfile(profile, geoVerification.location.city)) {\n await this.riskClient.updateProfile(profile.id, {\n last_recorded_activity: new Date().toISOString(),\n location: `${geoVerification.location.city}, ${geoVerification.location.country}`,\n location_compliance: geoVerification.is_compliant ? 'compliant' : 'non-compliant',\n });\n\n // Refresh profile\n profile = await this.riskClient.getProfile(request.customerId);\n }\n } catch (error) {\n // Profile doesn't exist - this shouldn't happen for login\n if (this.config.autoCreateProfiles && this.config.debug) {\n console.warn('[ComplianceSDK] Profile not found for login, creating...');\n }\n profile = await this.createProfileFromGeo(request.customerId, geoVerification);\n }\n\n // Step 3: Determine if login allowed\n const isAllowed =\n geoVerification.is_compliant &&\n !geoVerification.is_blocked &&\n profile.customer_status !== 'suspended';\n\n const requiresStepUp =\n geoVerification.risk_level === 'high' || geoVerification.risk_level === 'critical';\n\n return {\n allowed: isAllowed,\n geolocation: geoVerification,\n profile: profile,\n requiresStepUp: requiresStepUp,\n blockReasons: this.getBlockReasons(geoVerification, profile),\n processingTime: Date.now() - startTime,\n };\n } catch (error) {\n throw new ComplianceError('Login verification failed', error);\n }\n }\n\n /**\n * Verify transaction with amount-based risk assessment\n *\n * Combines geolocation verification with transaction amount analysis\n * and customer risk profile for comprehensive transaction screening.\n *\n * @param request - Transaction verification request\n * @returns Verification response with transaction risk assessment\n *\n * @example\n * ```typescript\n * const result = await sdk.verifyAtTransaction({\n * customerId: 'CUST-12345',\n * ipAddress: req.ip,\n * amount: 5000,\n * currency: 'USD',\n * transactionType: 'withdrawal',\n * deviceFingerprint: getDeviceFingerprint()\n * });\n *\n * if (result.allowed) {\n * // Process transaction\n * } else if (result.requiresApproval) {\n * // Queue for manual review\n * } else {\n * // Block transaction\n * console.log('Blocked:', result.blockReasons);\n * }\n * ```\n */\n async verifyAtTransaction(\n request: TransactionVerificationRequest\n ): Promise<TransactionVerificationResponse> {\n const startTime = Date.now();\n\n try {\n if (this.config.debug) {\n console.log('[ComplianceSDK] Starting transaction verification:', {\n customerId: request.customerId,\n amount: request.amount,\n currency: request.currency,\n });\n }\n\n // Step 1: Verify geolocation\n const geoVerification = await this.geoClient.verifyIP({\n ip_address: request.ipAddress,\n user_id: request.customerId,\n event_type: 'transaction',\n device_fingerprint: request.deviceFingerprint,\n });\n\n // Step 2: Get profile\n const profile = await this.riskClient.getProfile(request.customerId);\n\n // Step 3: Calculate transaction risk\n const transactionRisk = this.calculateTransactionRisk(\n request.amount,\n request.currency,\n geoVerification,\n profile\n );\n\n // Step 4: Check jurisdiction limits\n const jurisdictionAllowed = this.checkJurisdictionLimits(\n request.amount,\n request.currency,\n geoVerification.jurisdiction\n );\n\n // Step 5: Determine if transaction is allowed\n const isAllowed =\n geoVerification.is_compliant &&\n !geoVerification.is_blocked &&\n jurisdictionAllowed &&\n transactionRisk.allowed;\n\n return {\n allowed: isAllowed,\n geolocation: geoVerification,\n profile: profile,\n transactionRisk: transactionRisk,\n requiresApproval: transactionRisk.requiresManualReview,\n blockReasons: this.getTransactionBlockReasons(\n geoVerification,\n transactionRisk,\n jurisdictionAllowed\n ),\n processingTime: Date.now() - startTime,\n };\n } catch (error) {\n throw new ComplianceError('Transaction verification failed', error);\n }\n }\n\n /**\n * Generic event verification (for other touchpoints)\n *\n * @param request - Event verification request\n * @returns Verification response\n */\n async verifyEvent(request: EventVerificationRequest): Promise<EventVerificationResponse> {\n const startTime = Date.now();\n\n const geoVerification = await this.geoClient.verifyIP({\n ip_address: request.ipAddress,\n user_id: request.customerId,\n event_type: request.eventType,\n device_fingerprint: request.deviceFingerprint,\n });\n\n // Optionally update profile activity\n if (this.config.autoCreateProfiles) {\n try {\n const profile = await this.riskClient.getProfile(request.customerId);\n await this.riskClient.updateProfile(profile.id, {\n last_recorded_activity: new Date().toISOString(),\n });\n } catch (error) {\n // Profile doesn't exist, ignore or create based on config\n if (this.config.debug) {\n console.warn('[ComplianceSDK] Profile not found for event');\n }\n }\n }\n\n return {\n allowed: geoVerification.is_compliant && !geoVerification.is_blocked,\n geolocation: geoVerification,\n blockReasons: geoVerification.risk_reasons,\n processingTime: Date.now() - startTime,\n };\n }\n\n // ============================================================================\n // Helper Methods\n // ============================================================================\n\n private shouldUpdateProfile(profile: CustomerProfile, newCity: string): boolean {\n // Update if location changed significantly\n return !profile.location || !profile.location.includes(newCity);\n }\n\n private async createProfileFromGeo(\n customerId: string,\n geoVerification: any\n ): Promise<CustomerProfile> {\n return this.riskClient.createProfile({\n customer_id: customerId,\n entity_type: 'individual',\n customer_status: 'active',\n email_address: `${customerId}@placeholder.local`, // Temporary email\n location: `${geoVerification.location.city}, ${geoVerification.location.country}`,\n location_compliance: geoVerification.is_compliant ? 'compliant' : 'non-compliant',\n country_of_residence: geoVerification.location.country_iso,\n kyc_status: 'pending',\n });\n }\n\n private calculateTransactionRisk(\n amount: number,\n currency: string,\n geoVerification: any,\n profile: CustomerProfile\n ): TransactionRiskResult {\n let riskScore = 0;\n const factors: string[] = [];\n\n // Amount-based risk (normalized to USD)\n const normalizedAmount = this.normalizeToUSD(amount, currency);\n if (normalizedAmount > 10000) {\n riskScore += 30;\n factors.push('high_transaction_amount');\n } else if (normalizedAmount > 5000) {\n riskScore += 15;\n factors.push('elevated_transaction_amount');\n }\n\n // Geo risk\n riskScore += geoVerification.risk_score * 0.4;\n if (geoVerification.risk_level === 'high' || geoVerification.risk_level === 'critical') {\n factors.push('high_risk_location');\n }\n\n // Profile risk\n riskScore += profile.risk_score * 0.3;\n if (profile.risk_category === 'high' || profile.risk_category === 'critical') {\n factors.push('high_risk_customer');\n }\n\n // VPN/anonymizer during transaction\n if (geoVerification.location.is_vpn || geoVerification.location.is_proxy) {\n riskScore += 20;\n factors.push('anonymization_detected');\n }\n\n // Suspended account\n if (profile.customer_status === 'suspended') {\n riskScore += 50;\n factors.push('account_suspended');\n }\n\n return {\n score: Math.min(riskScore, 100),\n level: this.getRiskLevel(riskScore),\n factors: factors,\n allowed: riskScore < 70,\n requiresManualReview: riskScore >= 60 && riskScore < 70,\n };\n }\n\n private checkJurisdictionLimits(\n amount: number,\n currency: string,\n jurisdiction?: JurisdictionConfig\n ): boolean {\n if (!jurisdiction || !jurisdiction.max_transaction_amount) {\n return true;\n }\n\n const normalizedAmount = this.normalizeToUSD(amount, currency);\n return normalizedAmount <= jurisdiction.max_transaction_amount;\n }\n\n private normalizeToUSD(amount: number, currency: string): number {\n const rate = this.currencyRates[currency.toUpperCase()] || 1;\n return amount * rate;\n }\n\n private getRiskLevel(score: number): 'low' | 'medium' | 'high' | 'critical' {\n if (score >= 80) return 'critical';\n if (score >= 60) return 'high';\n if (score >= 40) return 'medium';\n return 'low';\n }\n\n private getBlockReasons(geoVerification: any, profile: CustomerProfile): string[] {\n const reasons: string[] = [];\n\n if (geoVerification.is_blocked) {\n reasons.push(...geoVerification.risk_reasons);\n }\n\n if (profile.customer_status === 'suspended') {\n reasons.push('account_suspended');\n }\n\n if (profile.has_sanctions) {\n reasons.push('sanctions_match');\n }\n\n return reasons;\n }\n\n private getTransactionBlockReasons(\n geoVerification: any,\n transactionRisk: TransactionRiskResult,\n jurisdictionAllowed: boolean\n ): string[] {\n const reasons: string[] = [];\n\n if (!geoVerification.is_compliant) {\n reasons.push('non_compliant_jurisdiction');\n }\n\n if (!jurisdictionAllowed) {\n reasons.push('exceeds_jurisdiction_limit');\n }\n\n if (!transactionRisk.allowed) {\n reasons.push(...transactionRisk.factors);\n }\n\n return reasons;\n }\n\n // ============================================================================\n // Advanced Registration Methods\n // ============================================================================\n\n /**\n * Verify registration with synchronized risk calculation\n *\n * This method extends verifyAtRegistration by waiting for the geolocation\n * risk factor to be processed by the backend. Use this when you need\n * the accurate risk score immediately after registration.\n *\n * Note: This adds latency (up to `maxWaitMs`) but provides accurate risk data.\n *\n * @param request - Registration verification request\n * @param options - Sync options\n * @returns Verification response with updated risk score\n *\n * @example\n * ```typescript\n * const result = await sdk.verifyAtRegistrationWithSync(\n * {\n * customerId: 'CUST-12345',\n * fullName: 'John Doe',\n * emailAddress: 'john@example.com',\n * ipAddress: req.ip,\n * },\n * { maxWaitMs: 5000, pollIntervalMs: 500 }\n * );\n *\n * // profile.risk_score now reflects geolocation risk factor\n * console.log('Synced risk score:', result.profile?.risk_score);\n * ```\n */\n async verifyAtRegistrationWithSync(\n request: RegistrationVerificationRequest,\n options: {\n maxWaitMs?: number;\n pollIntervalMs?: number;\n } = {}\n ): Promise<RegistrationVerificationResponse & { riskSynced: boolean }> {\n const { maxWaitMs = 5000, pollIntervalMs = 500 } = options;\n\n // First, do the standard registration verification\n const result = await this.verifyAtRegistration(request);\n\n // If registration was blocked, no need to wait for risk sync\n if (!result.allowed || !result.profile) {\n return { ...result, riskSynced: false };\n }\n\n // Wait for risk score to be calculated (initial score is 0)\n const syncedProfile = await this.waitForRiskCalculation(\n result.profile.id,\n maxWaitMs,\n pollIntervalMs\n );\n\n if (syncedProfile) {\n return {\n ...result,\n profile: syncedProfile,\n riskSynced: true,\n };\n }\n\n // Return original result if sync failed\n if (this.config.debug) {\n console.warn('[ComplianceSDK] Risk sync timed out, returning unsynchronized profile');\n }\n return { ...result, riskSynced: false };\n }\n\n /**\n * Wait for risk score to be calculated\n *\n * Polls the profile until risk_score > 0 or risk_last_calculated is set,\n * indicating that risk factors have been processed.\n *\n * @param profileId - Profile UUID to poll\n * @param maxWaitMs - Maximum wait time in milliseconds\n * @param pollIntervalMs - Polling interval in milliseconds\n * @returns Updated profile or null if timeout\n */\n private async waitForRiskCalculation(\n profileId: string,\n maxWaitMs: number,\n pollIntervalMs: number\n ): Promise<CustomerProfile | null> {\n const startTime = Date.now();\n\n while (Date.now() - startTime < maxWaitMs) {\n try {\n const profile = await this.riskClient.getProfileById(profileId);\n\n // Check if risk has been calculated\n // risk_last_calculated is set when first risk factor is processed\n if (profile.risk_last_calculated || profile.risk_score > 0) {\n return profile;\n }\n } catch (error) {\n if (this.config.debug) {\n console.warn('[ComplianceSDK] Error polling profile:', error);\n }\n }\n\n // Wait before next poll\n await this.sleep(pollIntervalMs);\n }\n\n return null;\n }\n\n /**\n * Pre-check if registration would be allowed from an IP address\n *\n * Use this before showing the registration form to provide early feedback\n * to users in blocked jurisdictions.\n *\n * @param ipAddress - IP address to check\n * @returns Pre-check result with jurisdiction info\n *\n * @example\n * ```typescript\n * const preCheck = await sdk.preCheckRegistration(req.ip);\n *\n * if (!preCheck.canRegister) {\n * return res.render('blocked', { reasons: preCheck.blockReasons });\n * }\n *\n * if (preCheck.requiresKYC) {\n * // Prepare KYC flow\n * }\n * ```\n */\n async preCheckRegistration(ipAddress: string): Promise<{\n canRegister: boolean;\n jurisdiction: JurisdictionConfig | null;\n blockReasons: string[];\n riskLevel: 'low' | 'medium' | 'high' | 'critical';\n requiresKYC: boolean;\n requiresEDD: boolean;\n location: {\n country: string;\n countryISO: string;\n city: string;\n };\n }> {\n // Verify without creating any records (using temporary user ID)\n const geoCheck = await this.geoClient.verifyIP({\n ip_address: ipAddress,\n user_id: `_precheck_${Date.now()}`, // Temporary ID for pre-check\n event_type: 'registration',\n });\n\n const blockReasons = this.evaluateRegistrationBlock(geoCheck);\n const jurisdiction = geoCheck.jurisdiction || null;\n\n return {\n canRegister: blockReasons.length === 0,\n jurisdiction,\n blockReasons,\n riskLevel: geoCheck.risk_level,\n requiresKYC: jurisdiction?.require_kyc || false,\n requiresEDD: jurisdiction?.require_enhanced_verification || false,\n location: {\n country: geoCheck.location.country,\n countryISO: geoCheck.location.country_iso,\n city: geoCheck.location.city,\n },\n };\n }\n\n // ============================================================================\n // Location Request Methods\n // ============================================================================\n\n /**\n * Request live location from a customer\n *\n * Creates a location request and sends a notification to the customer\n * via the specified channel (SMS, email, or push). The customer receives\n * a link to share their location.\n *\n * @param input - Location request details\n * @returns Location request result with share link\n *\n * @example\n * ```typescript\n * // Request location via SMS for transaction verification\n * const result = await sdk.requestCustomerLocation({\n * customerId: 'CUST-12345',\n * channel: 'sms',\n * phone: '+1234567890',\n * reason: 'Verification required for high-value transaction'\n * });\n *\n * console.log('Share link sent:', result.shareLink);\n * console.log('Expires at:', result.tokenExpiry);\n *\n * // Request location via email\n * const emailResult = await sdk.requestCustomerLocation({\n * customerId: 'CUST-12345',\n * channel: 'email',\n * email: 'customer@example.com',\n * reason: 'Account verification',\n * expiryHours: 48\n * });\n * ```\n */\n async requestCustomerLocation(\n input: ComplianceLocationRequestInput\n ): Promise<ComplianceLocationRequestResult> {\n if (this.config.debug) {\n console.log('[ComplianceSDK] Creating location request for customer:', input.customerId);\n }\n\n // Validate input\n this.validateLocationRequestInput(input);\n\n // Get customer profile if available\n let profile: CustomerProfile | undefined;\n try {\n profile = await this.riskClient.getProfile(input.customerId);\n } catch (error) {\n if (this.config.debug) {\n console.warn('[ComplianceSDK] Customer profile not found:', input.customerId);\n }\n }\n\n // Use profile data if contact info not provided\n const phone = input.phone || profile?.primary_phone_number;\n const email = input.email || profile?.email_address;\n\n // Create the location request\n const result = await this.geoClient.createLocationRequest({\n user_id: input.customerId,\n channel: input.channel,\n reason: input.reason,\n phone: phone,\n email: email,\n expiry_hours: input.expiryHours,\n });\n\n if (this.config.debug) {\n console.log('[ComplianceSDK] Location request created:', {\n requestId: result.request.id,\n channel: input.channel,\n expiresAt: result.token_expiry,\n });\n }\n\n return {\n request: result.request,\n shareLink: result.share_link,\n tokenExpiry: result.token_expiry,\n profile: profile,\n };\n }\n\n /**\n * Get a specific location request by ID\n *\n * @param requestId - Location request ID\n * @returns Location request details\n *\n * @example\n * ```typescript\n * const request = await sdk.getLocationRequest('req_abc123');\n * console.log('Status:', request.status);\n * if (request.latitude && request.longitude) {\n * console.log('Location captured:', request.latitude, request.longitude);\n * }\n * ```\n */\n async getLocationRequest(requestId: string): Promise<LocationRequest> {\n return this.geoClient.getLocationRequest(requestId);\n }\n\n /**\n * List location requests with filters and pagination\n *\n * @param filters - Optional filters\n * @param pagination - Optional pagination\n * @returns Paginated list of location requests\n *\n * @example\n * ```typescript\n * // Get pending requests for a customer\n * const pending = await sdk.listLocationRequests(\n * { status: 'pending', user_id: 'CUST-12345' },\n * { page: 1, limit: 20 }\n * );\n *\n * // Get all completed requests from last week\n * const completed = await sdk.listLocationRequests({\n * status: 'completed',\n * date_from: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString()\n * });\n * ```\n */\n async listLocationRequests(\n filters?: LocationRequestFilters,\n pagination?: PaginationParams\n ): Promise<LocationRequestListResponse> {\n return this.geoClient.listLocationRequests(filters, pagination);\n }\n\n /**\n * Cancel a pending location request\n *\n * @param requestId - Location request ID\n *\n * @example\n * ```typescript\n * await sdk.cancelLocationRequest('req_abc123');\n * ```\n */\n async cancelLocationRequest(requestId: string): Promise<void> {\n if (this.config.debug) {\n console.log('[ComplianceSDK] Cancelling location request:', requestId);\n }\n await this.geoClient.cancelLocationRequest(requestId);\n }\n\n /**\n * Resend notification for a location request\n *\n * @param requestId - Location request ID\n * @param contact - Contact details (email or phone)\n *\n * @example\n * ```typescript\n * // Resend to a different phone number\n * await sdk.resendLocationRequest('req_abc123', { phone: '+0987654321' });\n *\n * // Resend to email\n * await sdk.resendLocationRequest('req_abc123', { email: 'new@example.com' });\n * ```\n */\n async resendLocationRequest(\n requestId: string,\n contact: { email?: string; phone?: string }\n ): Promise<void> {\n if (this.config.debug) {\n console.log('[ComplianceSDK] Resending location request:', requestId);\n }\n await this.geoClient.resendLocationRequest(requestId, contact);\n }\n\n /**\n * Validate location request input\n */\n private validateLocationRequestInput(input: ComplianceLocationRequestInput): void {\n const errors: string[] = [];\n\n if (!input.customerId?.trim()) {\n errors.push('customerId is required');\n }\n\n if (!input.channel) {\n errors.push('channel is required');\n }\n\n if (!input.reason?.trim()) {\n errors.push('reason is required for compliance/audit purposes');\n }\n\n // Channel-specific validation\n if (input.channel === 'sms' && !input.phone) {\n errors.push('phone is required for SMS channel');\n }\n\n if (input.channel === 'email' && !input.email) {\n errors.push('email is required for email channel');\n }\n\n if (errors.length > 0) {\n throw new ValidationError(`Invalid location request: ${errors.join(', ')}`, errors);\n }\n }\n\n // ============================================================================\n // Configuration\n // ============================================================================\n\n /**\n * Update currency exchange rates\n *\n * Use this to keep currency rates current for accurate transaction risk\n * calculation. Rates should be updated regularly (e.g., daily).\n *\n * @param rates - Currency to USD exchange rates\n *\n * @example\n * ```typescript\n * // Update specific rates\n * sdk.updateCurrencyRates({\n * EUR: 1.08,\n * GBP: 1.25,\n * BTC: 42000, // For crypto support\n * });\n *\n * // Or fetch from external service\n * const rates = await fetchExchangeRates();\n * sdk.updateCurrencyRates(rates);\n * ```\n */\n updateCurrencyRates(rates: CurrencyRates): void {\n this.currencyRates = { ...this.currencyRates, ...rates };\n }\n\n /**\n * Get current currency rates\n *\n * @returns Current currency to USD exchange rates\n */\n getCurrencyRates(): Readonly<CurrencyRates> {\n return { ...this.currencyRates };\n }\n\n /**\n * Fetch and update currency rates from an external API\n *\n * This method allows integration with external exchange rate providers.\n * Pass a fetcher function that returns the new rates.\n *\n * @param fetcher - Async function that returns currency rates\n * @returns The fetched rates\n *\n * @example\n * ```typescript\n * // Using a rate provider\n * const rates = await sdk.fetchCurrencyRates(async () => {\n * const response = await fetch('https://api.exchangerate.host/latest?base=USD');\n * const data = await response.json();\n * return data.rates;\n * });\n *\n * console.log('Updated rates:', rates);\n * ```\n */\n async fetchCurrencyRates(\n fetcher: () => Promise<CurrencyRates>\n ): Promise<CurrencyRates> {\n try {\n const rates = await fetcher();\n this.updateCurrencyRates(rates);\n return rates;\n } catch (error) {\n if (this.config.debug) {\n console.error('[ComplianceSDK] Failed to fetch currency rates:', error);\n }\n throw new ComplianceError('Failed to fetch currency rates', error);\n }\n }\n\n /**\n * Get underlying geolocation client\n */\n getGeolocationClient(): GeolocationClient {\n return this.geoClient;\n }\n\n /**\n * Get underlying risk profile client\n */\n getRiskProfileClient(): RiskProfileClient {\n return this.riskClient;\n }\n\n /**\n * Update configuration\n */\n updateConfig(config: Partial<CGSConfig>): void {\n this.config = { ...this.config, ...config };\n this.geoClient.updateConfig(config as any);\n this.riskClient.updateConfig(config as any);\n }\n\n /**\n * Helper to create a delay\n */\n private sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n}\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { b as CipherTextOptions, c as CipherTextResult, C as CipherTextPayload } from '../client-DMNkESa0.mjs';
|
|
2
|
+
export { z as APIError, o as AlertFilters, p as AlertListResponse, l as AlertSeverity, A as AlertStatus, m as AlertType, a as CipherTextReason, k as ComplianceCheckResponse, v as CreateGeofenceRuleRequest, r as CreateJurisdictionRequest, O as CreateLocationRequestRequest, q as DashboardMetrics, d as DecryptedCipherText, i as DeviceFingerprint, D as DeviceFingerprintRequest, j as DeviceTrustResult, g as GeoIPResult, t as GeofenceAction, h as GeofenceEvaluation, u as GeofenceRule, s as GeofenceRuleType, n as GeolocationAlert, G as GeolocationClient, B as GeolocationClientConfig, y as GeolocationRecord, J as JurisdictionConfig, T as LocationCaptureRequest, Y as LocationCaptureResponse, N as LocationRequest, M as LocationRequestChannel, Q as LocationRequestFilters, R as LocationRequestListResponse, P as LocationRequestResult, K as LocationRequestStatus, X as LocationShareInfo, L as LocationVerification, S as ResendLocationRequestRequest, x as UpdateDeviceTrustRequest, w as UpdateGeofenceRuleRequest, U as UpdateJurisdictionRequest, H as UseAlertsOptions, I as UseAlertsResult, E as UseGeolocationOptions, F as UseGeolocationResult, $ as UseLocationCaptureOptions, a0 as UseLocationCaptureResult, Z as UseLocationRequestsOptions, _ as UseLocationRequestsResult, V as ValidateCipherTextRequest, e as ValidateCipherTextResponse, f as VerifyIPRequest, W as WiFiNetwork } from '../client-DMNkESa0.mjs';
|
|
3
|
+
export { P as PaginationParams } from '../types-Bnsnejor.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CipherText Generation Utility
|
|
7
|
+
*
|
|
8
|
+
* Collects device fingerprint and location data from the browser,
|
|
9
|
+
* encrypts it into a cipherText that can be validated by the server.
|
|
10
|
+
*
|
|
11
|
+
* The cipherText is used for:
|
|
12
|
+
* - Registration verification
|
|
13
|
+
* - Login verification
|
|
14
|
+
* - Transaction verification
|
|
15
|
+
* - Periodic location checks
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Generate a cipherText containing encrypted device and location data
|
|
20
|
+
*
|
|
21
|
+
* @param options - Options for cipherText generation
|
|
22
|
+
* @returns CipherText result with the encrypted string
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Basic usage for login
|
|
27
|
+
* const result = await generateCipherText({ reason: 'login' });
|
|
28
|
+
* console.log(result.cipherText);
|
|
29
|
+
*
|
|
30
|
+
* // With GPS location for registration
|
|
31
|
+
* const result = await generateCipherText({
|
|
32
|
+
* reason: 'registration',
|
|
33
|
+
* requestLocation: true,
|
|
34
|
+
* locationTimeout: 15000
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* if (result.locationCaptured) {
|
|
38
|
+
* console.log('GPS location included');
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function generateCipherText(options: CipherTextOptions): Promise<CipherTextResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Decode a cipherText (for debugging/testing - not for production use)
|
|
45
|
+
* In production, decryption happens on the server
|
|
46
|
+
*/
|
|
47
|
+
declare function decodeCipherText(cipherText: string): CipherTextPayload | null;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a cipherText is expired
|
|
50
|
+
*/
|
|
51
|
+
declare function isCipherTextExpired(cipherText: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* React hook for generating cipherText
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* function LoginForm() {
|
|
58
|
+
* const { generate, isGenerating, error } = useCipherText();
|
|
59
|
+
*
|
|
60
|
+
* const handleLogin = async () => {
|
|
61
|
+
* const result = await generate({ reason: 'login' });
|
|
62
|
+
* if (result) {
|
|
63
|
+
* await loginMutation({ email, password, cipherText: result.cipherText });
|
|
64
|
+
* }
|
|
65
|
+
* };
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
declare function useCipherText(): {
|
|
70
|
+
generate: (options: CipherTextOptions) => Promise<CipherTextResult | null>;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { CipherTextOptions, CipherTextPayload, CipherTextResult, decodeCipherText, generateCipherText, isCipherTextExpired, useCipherText };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { b as CipherTextOptions, c as CipherTextResult, C as CipherTextPayload } from '../client-CA9Wr_qb.js';
|
|
2
|
+
export { z as APIError, o as AlertFilters, p as AlertListResponse, l as AlertSeverity, A as AlertStatus, m as AlertType, a as CipherTextReason, k as ComplianceCheckResponse, v as CreateGeofenceRuleRequest, r as CreateJurisdictionRequest, O as CreateLocationRequestRequest, q as DashboardMetrics, d as DecryptedCipherText, i as DeviceFingerprint, D as DeviceFingerprintRequest, j as DeviceTrustResult, g as GeoIPResult, t as GeofenceAction, h as GeofenceEvaluation, u as GeofenceRule, s as GeofenceRuleType, n as GeolocationAlert, G as GeolocationClient, B as GeolocationClientConfig, y as GeolocationRecord, J as JurisdictionConfig, T as LocationCaptureRequest, Y as LocationCaptureResponse, N as LocationRequest, M as LocationRequestChannel, Q as LocationRequestFilters, R as LocationRequestListResponse, P as LocationRequestResult, K as LocationRequestStatus, X as LocationShareInfo, L as LocationVerification, S as ResendLocationRequestRequest, x as UpdateDeviceTrustRequest, w as UpdateGeofenceRuleRequest, U as UpdateJurisdictionRequest, H as UseAlertsOptions, I as UseAlertsResult, E as UseGeolocationOptions, F as UseGeolocationResult, $ as UseLocationCaptureOptions, a0 as UseLocationCaptureResult, Z as UseLocationRequestsOptions, _ as UseLocationRequestsResult, V as ValidateCipherTextRequest, e as ValidateCipherTextResponse, f as VerifyIPRequest, W as WiFiNetwork } from '../client-CA9Wr_qb.js';
|
|
3
|
+
export { P as PaginationParams } from '../types-Bnsnejor.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CipherText Generation Utility
|
|
7
|
+
*
|
|
8
|
+
* Collects device fingerprint and location data from the browser,
|
|
9
|
+
* encrypts it into a cipherText that can be validated by the server.
|
|
10
|
+
*
|
|
11
|
+
* The cipherText is used for:
|
|
12
|
+
* - Registration verification
|
|
13
|
+
* - Login verification
|
|
14
|
+
* - Transaction verification
|
|
15
|
+
* - Periodic location checks
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Generate a cipherText containing encrypted device and location data
|
|
20
|
+
*
|
|
21
|
+
* @param options - Options for cipherText generation
|
|
22
|
+
* @returns CipherText result with the encrypted string
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Basic usage for login
|
|
27
|
+
* const result = await generateCipherText({ reason: 'login' });
|
|
28
|
+
* console.log(result.cipherText);
|
|
29
|
+
*
|
|
30
|
+
* // With GPS location for registration
|
|
31
|
+
* const result = await generateCipherText({
|
|
32
|
+
* reason: 'registration',
|
|
33
|
+
* requestLocation: true,
|
|
34
|
+
* locationTimeout: 15000
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* if (result.locationCaptured) {
|
|
38
|
+
* console.log('GPS location included');
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function generateCipherText(options: CipherTextOptions): Promise<CipherTextResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Decode a cipherText (for debugging/testing - not for production use)
|
|
45
|
+
* In production, decryption happens on the server
|
|
46
|
+
*/
|
|
47
|
+
declare function decodeCipherText(cipherText: string): CipherTextPayload | null;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a cipherText is expired
|
|
50
|
+
*/
|
|
51
|
+
declare function isCipherTextExpired(cipherText: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* React hook for generating cipherText
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* function LoginForm() {
|
|
58
|
+
* const { generate, isGenerating, error } = useCipherText();
|
|
59
|
+
*
|
|
60
|
+
* const handleLogin = async () => {
|
|
61
|
+
* const result = await generate({ reason: 'login' });
|
|
62
|
+
* if (result) {
|
|
63
|
+
* await loginMutation({ email, password, cipherText: result.cipherText });
|
|
64
|
+
* }
|
|
65
|
+
* };
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
declare function useCipherText(): {
|
|
70
|
+
generate: (options: CipherTextOptions) => Promise<CipherTextResult | null>;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { CipherTextOptions, CipherTextPayload, CipherTextResult, decodeCipherText, generateCipherText, isCipherTextExpired, useCipherText };
|