Refactor XInvoice API for XML handling and PDF export by replacing deprecated methods (addXmlString and getParsedXmlData) with fromXml and loadXml, and by introducing a new ExportFormat type for type-safe export. Update tests accordingly.
- Removed usage of addXmlString and getParsedXmlData in favor of XInvoice.fromXml and loadXml for XML processing.
- Added ExportFormat type and enforced type-safety in exportXml and exportPdf methods.
- Updated test files to adapt to the new API, ensuring proper error handling and API consistency.
- Revised expectations in tests to check for new methods (loadXml, validate, exportXml, exportPdf) and properties.
Refactor contact and PDF handling across the library by replacing IContact with TContact and updating PDF processing to use a structured IPdf object. These changes ensure that empty contact objects include registration details, founded/closed dates, and status, and that PDF loading/exporting uniformly wraps buffers in a proper object.
- Updated createEmptyContact (renamed in documentation to reflect TContact) to return a complete TContact object with registrationDetails, foundedDate, closedDate, and status.
- Modified loadPdf and exportPdf in XInvoice to wrap PDF buffers in an IPdf object with name, id, and metadata instead of using a raw Uint8Array.
- Replaced IContact with TContact in FacturXEncoder, FacturXDecoder, and XInvoiceDecoder to standardize contact structure.
- Aligned address and contact data across decoders and encoders for consistency.
Update readme to enhance installation instructions and expand feature documentation for Factur-X/ZUGFeRD, UBL, and FatturaPA support, including details on circular encoding/decoding.
- Added pnpm installation instructions
- Expanded description of supported European e-invoicing standards
- Clarified usage of FacturXEncoder and ZUGFeRDXmlDecoder for XML encoding/decoding
- Included detailed feature summary for PDF integration, encoding/decoding, and format detection
Rename encoder class from ZugferdXmlEncoder to FacturXEncoder to better reflect Factur-X compliance. All related imports, exports, and tests have been updated while maintaining backward compatibility.
- Renamed the encoder class to FacturXEncoder and added an alias for backward compatibility (FacturXEncoder as ZugferdXmlEncoder)
- Updated test files and TS index exports to reference the new class name
- Improved XML creation formatting and documentation within the encoder module