import { z } from 'zod'; import { VelrimClient, type DocumentInput } from '@velrim/sdk'; // Replace this illustrative legacy contract with your application's exact model. const Invoice = z.object({ invoice_number: z.string(), total: z.number(), currency: z.enum(['USD', 'EUR']), po_number: z.string().nullable().optional(), }); export async function extractForExistingApp(client: VelrimClient, document: DocumentInput) { const result = await client.extract(Invoice, document); return { // Existing consumers can read invoice; review code retains the evidence. invoice: result.data, evidence: { fields: result.fields, meta: result.meta }, }; }