BREAKING CHANGE(core): Rebrand XInvoice to EInvoice: update package name, class names, imports, and documentation
This commit is contained in:
36
ts/index.ts
36
ts/index.ts
@ -1,5 +1,5 @@
|
||||
// Import main class
|
||||
import { XInvoice } from './classes.xinvoice.js';
|
||||
import { EInvoice } from './einvoice.js';
|
||||
|
||||
// Import interfaces
|
||||
import * as common from './interfaces/common.js';
|
||||
@ -37,6 +37,17 @@ import {
|
||||
// Import format detector
|
||||
import { FormatDetector } from './formats/utils/format.detector.js';
|
||||
|
||||
// Import error classes
|
||||
import {
|
||||
EInvoiceError,
|
||||
EInvoiceParsingError,
|
||||
EInvoiceValidationError,
|
||||
EInvoicePDFError,
|
||||
EInvoiceFormatError,
|
||||
ErrorRecovery,
|
||||
ErrorContext
|
||||
} from './errors.js';
|
||||
|
||||
// Import Factur-X implementation
|
||||
import { FacturXDecoder } from './formats/cii/facturx/facturx.decoder.js';
|
||||
import { FacturXEncoder } from './formats/cii/facturx/facturx.encoder.js';
|
||||
@ -66,7 +77,7 @@ export type {
|
||||
|
||||
// Format interfaces
|
||||
ExportFormat,
|
||||
XInvoiceOptions
|
||||
EInvoiceOptions
|
||||
} from './interfaces/common.js';
|
||||
|
||||
export { ValidationLevel, InvoiceFormat } from './interfaces/common.js';
|
||||
@ -75,7 +86,7 @@ export { ValidationLevel, InvoiceFormat } from './interfaces/common.js';
|
||||
export { common as interfaces };
|
||||
|
||||
// Export main class
|
||||
export { XInvoice };
|
||||
export { EInvoice };
|
||||
|
||||
// Export factories
|
||||
export { DecoderFactory, EncoderFactory, ValidatorFactory };
|
||||
@ -108,6 +119,17 @@ export {
|
||||
// Export format detector
|
||||
export { FormatDetector };
|
||||
|
||||
// Export error classes
|
||||
export {
|
||||
EInvoiceError,
|
||||
EInvoiceParsingError,
|
||||
EInvoiceValidationError,
|
||||
EInvoicePDFError,
|
||||
EInvoiceFormatError,
|
||||
ErrorRecovery,
|
||||
ErrorContext
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates an XML string against the appropriate format rules
|
||||
* @param xml XML content to validate
|
||||
@ -134,9 +156,9 @@ export function validateXml(
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new XInvoice instance
|
||||
* @returns A new XInvoice instance
|
||||
* Creates a new EInvoice instance
|
||||
* @returns A new EInvoice instance
|
||||
*/
|
||||
export function createXInvoice(): XInvoice {
|
||||
return new XInvoice();
|
||||
export function createEInvoice(): EInvoice {
|
||||
return new EInvoice();
|
||||
}
|
||||
|
Reference in New Issue
Block a user