/** Structured log event emitted during Data verification. */ export interface DataLogEvent { event: DataLogEventName; transactionId?: string; timestamp: number; durationMs?: number; metadata?: Record; } export type DataLogEventName = "data_verify_start" | "data_verify_submitted" | "data_poll_attempt" | "data_poll_terminal" | "data_verify_complete" | "data_verify_error" | "data_verify_timeout" | "data_verify_cancelled" | "data_state_change"; /** Callback for receiving structured observability events. */ export type DataObservabilityHandler = (event: DataLogEvent) => void; export interface DataVerificationConfig { countryCode: string; personInfo?: PersonInfo; location?: Location; communication?: Communication; nationalIds?: NationalId[]; } export interface PersonInfo { firstName?: string; lastName?: string; middleName?: string; dateOfBirth?: string; gender?: string; } export interface Location { buildingNumber?: string; streetName?: string; streetType?: string; unitNumber?: string; city?: string; stateProvinceCode?: string; postalCode?: string; country?: string; } export interface Communication { telephone?: string; emailAddress?: string; mobileNumber?: string; } export interface NationalId { number: string; type?: string; country?: string; } /** Terminal result -- no PII. For PII, call GET /data/result via the session client directly (apps only). */ export interface DataVerificationResult { transactionId: string; outcome: DataOutcome; recordMatch: boolean; watchlistState?: string; fraudFlag?: boolean; isDeceased?: boolean; } export type DataOutcome = "ACCEPT" | "DECLINE" | "REVIEW" | "ERROR"; export type DataState = "IDLE" | "SUBMITTING" | "POLLING" | "COMPLETED" | "FAILED"; /** POST /transactions/data/verify -- transactionId is in the JWT; not in the request body. */ export interface DataVerifyRequest { countryCode: string; inputFields: DataVerifyRequestField[]; packageId?: string; } export interface DataVerifyRequestField { name: string; value: string; } /** POST /transactions/data/verify response -- 202 accepted. */ export interface DataVerifyResponse { transactionId: string; status: "ACCEPTED"; } /** Known poll status values from the server. */ export type DataPollStatus = "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED"; /** GET /transactions/{id}/data -- poll status only. */ export interface DataPollResponse { transactionId: string; status: DataPollStatus | string; /** Present when status is COMPLETED. */ outcome?: DataOutcome | string; recordMatch?: boolean; watchlistState?: string; fraudFlag?: boolean; isDeceased?: boolean; }