UNPKG

ci-validation

Version:

🇺🇾 Complete TypeScript/JavaScript library for validating Uruguayan CI (Cédula de Identidad) with official algorithm and government service integration

47 lines • 1.49 kB
import { CiQueryResponse, ICiService } from "../lib"; export interface ContactOption { type: "email" | "mobile" | "phone" | "other"; value: string; masked?: boolean; } export interface FriendlyServiceData { service: string; status: "available" | "registered" | "not_registered" | "error" | "needs_action"; points?: number; balance?: number; message?: string; contactOptions?: ContactOption[]; actionRequired?: string; } export interface FriendlyCiResponse { success: boolean; cedula: string; data: { persona: { summary: { totalServices: number; availableServices: number; totalPoints: number; hasRegistrations: boolean; }; services: FriendlyServiceData[]; }; }; error?: string; errors?: string[]; } export declare class ExternalCiService implements ICiService { check(document: string, options?: { ignoreCache?: boolean; forceRefresh?: boolean; }, att?: number): Promise<FriendlyCiResponse>; queryCiInfoRaw(ci: string): Promise<CiQueryResponse>; /** * Transforms the raw queryCiInfo response into a user-friendly format * @param ci - The CI number * @returns Promise with user-friendly formatted data */ queryCiInfo(ci: string): Promise<FriendlyCiResponse>; isServiceAvailable(): Promise<boolean>; } //# sourceMappingURL=ExternalCiService.d.ts.map