@aidalinfo/pdf-processor
Version:
Powerful PDF data extraction library powered by AI vision models. Transform PDFs into structured, validated data using TypeScript, Zod, and AI providers like Scaleway and Ollama.
936 lines (935 loc) • 68 kB
TypeScript
/**
* PDF Vision Processor - Point d'entrée principal
*
* Cette bibliothèque propose deux modes d'utilisation :
* 1. API Server : Créer un serveur REST pour traiter les PDFs via HTTP
* 2. Library : Utiliser directement les fonctions d'extraction dans votre code
*/
export { createVisionAPI, type APIServerConfig } from './api/server';
export { extractPdf, extractPdfWithMetadata, extractInvoicePdf, extractTablesPdf, extractReceiptPdf, schemas, providers, type ExtractOptions, type ExtractResult, type ComprehensiveInvoice, type TablesOnly, type BasicReceipt, type VisionExtractionOptions, type PdfProcessorConfig } from './lib';
export { aiVisionProcessor, extractWithAI, extractInvoice, extractTables } from './core/vision';
export { ComprehensiveInvoiceSchema, TablesOnlySchema, BasicReceiptSchema, SchemaFactory } from './core/schemas';
import * as API from './api/server';
import * as Library from './lib';
/**
* Export par défaut combinant API et Library
*/
declare const _default: {
createServer: typeof API.createVisionAPI;
extractPdf: typeof Library.extractPdf;
extractPdfWithMetadata: typeof Library.extractPdfWithMetadata;
extractInvoice: typeof Library.extractInvoicePdf;
extractTables: typeof Library.extractTablesPdf;
extractReceipt: typeof Library.extractReceiptPdf;
schemas: {
invoice: import("zod").ZodObject<{
document_info: import("zod").ZodOptional<import("zod").ZodObject<{
document_type: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
language: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
total_pages: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
}, "strip", import("zod").ZodTypeAny, {
document_type?: string;
language?: string;
currency?: string;
total_pages?: number;
}, {
document_type?: string;
language?: string;
currency?: string;
total_pages?: number;
}>>;
invoice_details: import("zod").ZodOptional<import("zod").ZodObject<{
invoice_number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
invoice_date: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
due_date: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
purchase_order: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
reference_number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
invoice_number?: string;
invoice_date?: string;
due_date?: string;
purchase_order?: string;
reference_number?: string;
}, {
invoice_number?: string;
invoice_date?: string;
due_date?: string;
purchase_order?: string;
reference_number?: string;
}>>;
seller_info: import("zod").ZodOptional<import("zod").ZodObject<{
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
company_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
address: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
street: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
city: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
postal_code: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
country: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
street?: string;
city?: string;
postal_code?: string;
country?: string;
}, {
street?: string;
city?: string;
postal_code?: string;
country?: string;
}>>>;
phone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
email: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodNullable<import("zod").ZodString>, import("zod").ZodLiteral<any>]>>;
website: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
vat_number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
tax_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
name?: string;
company_name?: string;
address?: {
street?: string;
city?: string;
postal_code?: string;
country?: string;
};
phone?: string;
email?: any;
website?: string;
vat_number?: string;
tax_id?: string;
}, {
name?: string;
company_name?: string;
address?: {
street?: string;
city?: string;
postal_code?: string;
country?: string;
};
phone?: string;
email?: any;
website?: string;
vat_number?: string;
tax_id?: string;
}>>;
buyer_info: import("zod").ZodOptional<import("zod").ZodObject<{
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
company_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
address: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
street: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
city: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
postal_code: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
country: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
street?: string;
city?: string;
postal_code?: string;
country?: string;
}, {
street?: string;
city?: string;
postal_code?: string;
country?: string;
}>>>;
phone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
email: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodNullable<import("zod").ZodString>, import("zod").ZodLiteral<any>]>>;
website: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
vat_number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
tax_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
name?: string;
company_name?: string;
address?: {
street?: string;
city?: string;
postal_code?: string;
country?: string;
};
phone?: string;
email?: any;
website?: string;
vat_number?: string;
tax_id?: string;
}, {
name?: string;
company_name?: string;
address?: {
street?: string;
city?: string;
postal_code?: string;
country?: string;
};
phone?: string;
email?: any;
website?: string;
vat_number?: string;
tax_id?: string;
}>>;
line_items: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
item_number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
description: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
quantity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
unit: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
unit_price: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
discount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_rate: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_amount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
line_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
quantite: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
prix_unitaire: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
taux_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}, {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>, "many">>;
financial_totals: import("zod").ZodOptional<import("zod").ZodObject<{
subtotal: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
discount_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
shipping_cost: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_amount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
amount_paid: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
balance_due: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}>>;
payment_info: import("zod").ZodOptional<import("zod").ZodObject<{
payment_terms: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
payment_method: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
payment_due_date: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
bank_details: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
iban: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
swift_code: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
payment_terms?: string;
payment_method?: string;
payment_due_date?: string;
bank_details?: string;
iban?: string;
swift_code?: string;
}, {
payment_terms?: string;
payment_method?: string;
payment_due_date?: string;
bank_details?: string;
iban?: string;
swift_code?: string;
}>>;
pages: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
page: import("zod").ZodNumber;
page_tables: import("zod").ZodArray<import("zod").ZodObject<{
billed_services: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
item_number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
description: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
quantity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
unit: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
unit_price: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
discount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_rate: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_amount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
line_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
quantite: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
prix_unitaire: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
taux_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}, {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>, "many">>;
totals: import("zod").ZodOptional<import("zod").ZodObject<{
subtotal: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
discount_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
shipping_cost: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_amount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
amount_paid: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
balance_due: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}>>;
sections_detaillees: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
items: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
quantite: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
prix_unitaire: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
taux_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
}, "strip", import("zod").ZodTypeAny, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>>;
sous_total: import("zod").ZodOptional<import("zod").ZodObject<{
subtotal: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
discount_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
shipping_cost: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_amount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
amount_paid: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
balance_due: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}>>;
}, "strip", import("zod").ZodTypeAny, {
items?: Record<string, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>;
sous_total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
}, {
items?: Record<string, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>;
sous_total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
}>>>;
total: import("zod").ZodOptional<import("zod").ZodObject<{
subtotal: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
discount_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
tax_total: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
shipping_cost: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_amount: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
amount_paid: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
balance_due: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
total_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ht: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_tva: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}, {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
}>>;
reference: import("zod").ZodOptional<import("zod").ZodString>;
exercice: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
montant_ttc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
currency: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
raw_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
}, "strip", import("zod").ZodTypeAny, {
currency?: string;
montant_ttc?: number;
billed_services?: {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}[];
totals?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
sections_detaillees?: Record<string, {
items?: Record<string, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>;
sous_total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
}>;
total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
reference?: string;
exercice?: string;
raw_data?: Record<string, any>;
}, {
currency?: string;
montant_ttc?: number;
billed_services?: {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}[];
totals?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
sections_detaillees?: Record<string, {
items?: Record<string, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>;
sous_total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
}>;
total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
reference?: string;
exercice?: string;
raw_data?: Record<string, any>;
}>, "many">;
}, "strip", import("zod").ZodTypeAny, {
page?: number;
page_tables?: {
currency?: string;
montant_ttc?: number;
billed_services?: {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}[];
totals?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
sections_detaillees?: Record<string, {
items?: Record<string, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>;
sous_total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
}>;
total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
reference?: string;
exercice?: string;
raw_data?: Record<string, any>;
}[];
}, {
page?: number;
page_tables?: {
currency?: string;
montant_ttc?: number;
billed_services?: {
currency?: string;
item_number?: string;
description?: string;
quantity?: number;
unit?: string;
unit_price?: number;
discount?: number;
tax_rate?: number;
tax_amount?: number;
line_total?: number;
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}[];
totals?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
sections_detaillees?: Record<string, {
items?: Record<string, {
quantite?: number;
prix_unitaire?: number;
montant_ht?: number;
montant_ttc?: number;
taux_tva?: number;
montant_tva?: number;
}>;
sous_total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
}>;
total?: {
currency?: string;
montant_ht?: number;
montant_ttc?: number;
montant_tva?: number;
subtotal?: number;
discount_total?: number;
tax_total?: number;
shipping_cost?: number;
total_amount?: number;
amount_paid?: number;
balance_due?: number;
total_ht?: number;
total_tva?: number;
total_ttc?: number;
};
reference?: string;
exercice?: string;
raw_data?: Record<string, any>;
}[];
}>, "many">>;
extraction_metadata: import("zod").ZodOptional<import("zod").ZodObject<{
confidence_score: import("zod").ZodNullable<import("zod").ZodNumber>;
fields_found: import("zod").ZodNullable<import("zod").ZodNumber>;
fields_empty: import("zod").ZodNullable<import("zod").ZodNumber>;
processing_notes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
}, "strip", import("zod").ZodTypeAny, {
confidence_score?: number;
fields_found?: number;
fields_empty?: number;
processing_notes?: string[];
}, {
confidence_score?: number;
fields_found?: number;
fields_empty?: number;
processing_notes?: string[];
}>>;
}, "strip", import("zod").ZodTypeAny, {
document_info?: {
document_type?: string;
language?: string;
currency?: string;
total_pages?: number;
};
invoice_details?: {
invoice_number?: string;
invoice_date?: string;
due_date?: string;
purchase_order?: string;
reference_number?: string;
};
seller_info?: {
name?: string;
company_name?: string;
address?: {
street?: string;
city?: string;
postal_code?: string;
country?: string;
};
phone?: string;
email?: any;