UNPKG

facturapi

Version:

SDK oficial de Facturapi para Node.js y navegadores. Integra facturación electrónica en México (CFDI) de forma simple y obtén una perspectiva fiscal completa de tu operación, con búsquedas indexadas, envío de documentos y trazabilidad.

60 lines (59 loc) 1.77 kB
type FormDataLike = { append: (name: string, value: unknown, fileName?: string) => void; }; export type UniversalFormData = FormData | FormDataLike; export interface FacturapiErrorDetail { code?: string; message?: string; path?: string; location?: string; source?: string; [key: string]: unknown; } export interface FacturapiErrorOptions { message: string; status: number; code?: string; path?: string; location?: string; errors?: FacturapiErrorDetail[]; logId?: string; headers?: Record<string, string>; } export declare class FacturapiError extends Error { status: number; code?: string; path?: string; location?: string; errors?: FacturapiErrorDetail[]; logId?: string; headers: Record<string, string>; constructor(options: FacturapiErrorOptions); } export declare const createWrapper: (apiKey: string, apiVersion?: "v1" | "v2", headers?: Record<string, string>) => { baseURL: string; request(url: string, options?: { params?: Record<string, any> | null; body?: any; formData?: UniversalFormData; method?: string; }): Promise<any>; get(url: string, options?: { params?: Record<string, any> | null; }): Promise<any>; post(url: string, options?: { body?: any; formData?: UniversalFormData; params?: Record<string, any> | null; }): Promise<any>; put(url: string, options?: { body?: any; formData?: UniversalFormData; params?: Record<string, any> | null; }): Promise<any>; delete(url: string, options?: { params?: Record<string, any> | null; }): Promise<any>; }; export type WrapperClient = ReturnType<typeof createWrapper>; export {};