/** * Backend-validated challenge actions. Only these 5 are accepted. */ export type ChallengeAction = "BLINK" | "TURN_LEFT" | "TURN_RIGHT" | "TURN_HEAD" | "OPEN_MOUTH"; /** * Parameters for creating a liveness entry. * Sent as multipart to POST /v1/sdk/liveness/create/ */ export interface LivenessCreateRequest { identifier: string; identifier_type: string; country: string; challenge_actions: ChallengeAction[]; autoshot_file?: File | Blob; id_file?: File | Blob; document?: File | Blob; document_front?: File | Blob; document_back?: File | Blob; snapshot_file?: File | Blob; identity_check?: number; device_type?: string; os_name?: string; browser_timezone?: string; fingerprint_id?: string; } /** * Mirrors LivenessEntry.STATUS_CHOICES on the backend (sdk/models.py). */ export type LivenessEntryStatus = "pending" | "processing" | "passed" | "failed" | "expired"; /** * Mirrors DocumentVerification.STATUS_CHOICES on the backend (sdk/models.py). */ export type DocumentVerificationStatus = "pending" | "ocr_complete" | "verified" | "failed" | "expired_document"; /** * Response from POST /v1/sdk/liveness/create/ (unwrapped). */ export interface LivenessCreateResponse { id: number; client_id: string; challenge_actions: ChallengeAction[]; challenge_instructions?: Record; expires_at: string | null; status: "pending"; } /** * Response from POST /v1/sdk/liveness/submit/ (unwrapped). * Matches the response_data dict built in LivenessSubmitAPIView.post * (sdk/views.py) — there is no `metadata` field on this response. */ export interface LivenessSubmitResponse { id: number; status: LivenessEntryStatus; submitted_at: string | null; completed_at: string | null; failure_reason: string | null; result_url: string; document?: { status: DocumentVerificationStatus; document_type: string; is_expired: boolean; document_number: string | null; extracted_name: string | null; date_of_birth: string | null; expiry_date: string | null; nationality: string | null; gender: string | null; face_match: { attempted: boolean; verified: boolean | null; confidence_percentage: number | null; }; }; } /** * Webhook payload shape for liveness.completed event. * This is what the backend POSTs to the client's webhook_url. */ export interface LivenessWebhookPayload { event: "liveness.completed"; verification_id: number; verification_type: "data_verification" | "document_verification" | "liveness_only"; status: "passed" | "failed"; failure_reason: string | null; timestamp: string; subject: { identifier: string; identifier_type: string; country: string; }; biometrics: { liveness_verified: boolean; face_match: { attempted: boolean; verified: boolean | null; confidence_percentage: number | null; }; selfie_url: string | null; face_analysis: { gender: string | null; dominant_emotion: string | null; face_quality: { face_detected: boolean; face_confidence: number | null; blur_score: number | null; is_blurry: boolean | null; }; } | null; }; activity: { session_id: string | null; started_at: string; submitted_at: string | null; completed_at: string; duration_seconds: number | null; }; request_context: { ip: { address: string | null; city: string | null; region: string | null; country_code: string | null; org: string | null; asn_number: string | null; asn_name: string | null; latitude: string | null; longitude: string | null; timezone: string | null; country_matches_document: boolean | null; timezone_matches_browser: boolean | null; }; device: { user_agent: string | null; type: string | null; os: string | null; timezone: string | null; fingerprint_id: string | null; }; }; customer_profile?: { first_name: string | null; last_name: string | null; other_name: string | null; date_of_birth: string | null; age: number | null; gender: string | null; id_number: string | null; serial_number: string | null; occupation: string | null; place_of_birth: string | null; place_of_live: string | null; date_of_issue: string | null; photo_url: string | null; }; document?: { status: string; document_type: string; is_expired: boolean; first_name: string | null; last_name: string | null; date_of_birth: string | null; age: number | null; gender: string | null; nationality: string | null; place_of_birth: string | null; document_number: string | null; expiry_date: string | null; issue_date: string | null; issuing_authority: string | null; place_of_issue: string | null; address: string | null; district: string | null; division: string | null; location: string | null; sub_location: string | null; serial_number: string | null; barcode_number: string | null; document_url: string | null; document_back_url: string | null; face_match: { attempted: boolean; verified: boolean | null; confidence_percentage: number | null; threshold_percentage: number | null; reason: string | null; selfie_url: string | null; document_face_url: string | null; }; }; } //# sourceMappingURL=liveness.d.ts.map