@fin.cx/einvoice 6.2.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist_ts/00_commitinfo_data.js +1 -1
  2. package/dist_ts/einvoice.js +3 -2
  3. package/dist_ts/formats/ubl/xrechnung/xrechnung.encoder.d.ts +7 -0
  4. package/dist_ts/formats/ubl/xrechnung/xrechnung.encoder.js +19 -3
  5. package/dist_ts/formats/validation/conformance.harness.js +1 -1
  6. package/dist_ts/formats/validation/schematron.downloader.d.ts +43 -15
  7. package/dist_ts/formats/validation/schematron.downloader.js +122 -77
  8. package/dist_ts/formats/validation/schematron.integration.d.ts +5 -1
  9. package/dist_ts/formats/validation/schematron.integration.js +16 -40
  10. package/dist_ts/formats/validation/schematron.validator.d.ts +35 -15
  11. package/dist_ts/formats/validation/schematron.validator.js +136 -138
  12. package/dist_ts/formats/validation/schematron.worker.d.ts +12 -9
  13. package/dist_ts/formats/validation/schematron.worker.js +148 -108
  14. package/dist_ts/plugins.d.ts +3 -1
  15. package/dist_ts/plugins.js +7 -2
  16. package/dist_ts_install/download-schematron.js +6 -3
  17. package/dist_ts_install/index.js +15 -11
  18. package/package.json +6 -8
  19. package/ts/00_commitinfo_data.ts +1 -1
  20. package/ts/einvoice.ts +2 -1
  21. package/ts/formats/ubl/xrechnung/xrechnung.encoder.ts +19 -2
  22. package/ts/formats/validation/conformance.harness.ts +1 -1
  23. package/ts/formats/validation/schematron.downloader.ts +146 -97
  24. package/ts/formats/validation/schematron.integration.ts +18 -44
  25. package/ts/formats/validation/schematron.validator.ts +181 -181
  26. package/ts/formats/validation/schematron.worker.ts +191 -135
  27. package/ts/plugins.ts +8 -0
  28. package/ts/vendor/modules.d.ts +0 -19
  29. package/dist_ts/vendor/saxonjs.d.ts +0 -23
  30. package/dist_ts/vendor/saxonjs.js +0 -9
  31. package/readme.hints.md +0 -1134
  32. package/readme.howtofixtests.md +0 -38
  33. package/readme.literature.md +0 -1
  34. package/readme.plan.md +0 -497
  35. package/ts/vendor/saxonjs.ts +0 -36
@@ -1,38 +0,0 @@
1
- # How to Fix Tests in the einvoice Library
2
-
3
- ## Important: You CAN Modify the Library Code!
4
-
5
- When tests fail, the goal is to fix the root causes in the einvoice library itself, not just adjust test expectations.
6
-
7
- ### Key Points:
8
-
9
- 1. **Tests reveal bugs** - If a test shows that UTF-8 characters aren't preserved, that's a bug in the library
10
- 2. **Fix the library** - Modify the code in `ts/` to make the tests pass
11
- 3. **Maintain spec compliance** - The goal is to be as spec-compliant as possible
12
- 4. **Don't lower expectations** - Don't make tests pass by accepting broken behavior
13
-
14
- ### Common Issues to Fix:
15
-
16
- 1. **UTF-8 Character Preservation**
17
- - Special characters should be preserved in all fields
18
- - Invoice IDs with special characters should work
19
- - Subject and notes fields should maintain their content
20
-
21
- 2. **Round-trip Conversion**
22
- - Data exported to XML and imported back should remain the same
23
- - All fields should be preserved during import/export
24
-
25
- 3. **Character Encoding**
26
- - XML should properly handle all UTF-8 characters
27
- - Special XML characters (&, <, >, ", ') should be properly escaped
28
- - Unicode characters should be preserved, not converted to entities
29
-
30
- ### Process:
31
-
32
- 1. Run the failing test
33
- 2. Identify what the library is doing wrong
34
- 3. Fix the library code in `ts/`
35
- 4. Verify the test now passes
36
- 5. Ensure no other tests break
37
-
38
- Remember: The tests are there to improve the einvoice library!
@@ -1 +0,0 @@
1
- https://www.ufz.de/export/data/2/260196_04_Dokumentation%20XRechnung%20und%20ZUGFeRD.pdf
package/readme.plan.md DELETED
@@ -1,497 +0,0 @@
1
- # EInvoice Improvement Plan
2
-
3
- Command: Reread /home/philkunz/.claude/CLAUDE.md
4
-
5
- ## Verified status audit (2026-07-28)
6
-
7
- - The configured unit suite and production build are release gates.
8
- - CII XRechnung is routed by namespace-qualified XML syntax. The exact KoSIT
9
- v2026-01-31 CII/UBL twin was verified during release preparation; tracked
10
- regression coverage uses a repository KoSIT CII fixture and prefixed UBL XML.
11
- - Factur-X PDF embedding uses `factur-x.xml`,
12
- `AFRelationship=Alternative`, and a catalog `AF` entry; both PDF literal and
13
- hexadecimal attachment names are supported during extraction.
14
- - PDF attachment mechanics are verified. PDF/A-3 conversion and formal
15
- conformance are not: the implementation does not add output intents, ICC
16
- profiles, XMP conformance metadata, embedded fonts, or run veraPDF.
17
- - The detailed completion counts below are historical planning records, not a
18
- statement that every listed corpus or compliance test is currently
19
- configured and green.
20
-
21
- ## Vision
22
- Transform @fin.cx/einvoice into the definitive, production-ready solution for handling all electronic invoice formats globally, with unmatched accuracy, performance, and reliability.
23
-
24
- ## Phase 0: Project Rebranding
25
-
26
- ### 0.1 Rename from XInvoice to EInvoice
27
- - [x] Update package name from @fin.cx/xinvoice to @fin.cx/einvoice
28
- - [x] Rename main class from XInvoice to EInvoice
29
- - [x] Update all error classes (XInvoice* to EInvoice*)
30
- - [x] Update all imports and references
31
- - [x] Update documentation and examples
32
- - [x] Create migration guide for existing users
33
- - [ ] Set up package alias for backward compatibility
34
- - [x] Update repository name and URLs
35
-
36
- **Rationale**: "EInvoice" (electronic invoice) is more inclusive and universally understood than "XInvoice", better representing our goal to support all electronic invoice formats globally.
37
-
38
- ### 0.2 Architectural Improvements During Rebranding
39
- - [x] Rename classes.xinvoice.ts to einvoice.ts
40
- - [ ] Split EInvoice class into smaller, focused components
41
- - [ ] Create clean separation between data model and operations
42
- - [ ] Implement proper domain-driven design structure
43
-
44
- ## Phase 1: Core Infrastructure Improvements (Foundation)
45
-
46
- ### 1.1 Enhanced Error Handling System
47
- - [x] Create specialized error classes for each operation type
48
- - `EInvoiceParsingError` for XML parsing failures
49
- - `EInvoiceValidationError` for validation failures
50
- - `EInvoicePDFError` for PDF operations
51
- - `EInvoiceFormatError` for format-specific issues
52
- - [x] Implement error recovery mechanisms
53
- - Partial data extraction on parser failures
54
- - Fallback strategies for corrupted data
55
- - Detailed error context with actionable solutions
56
- - [ ] Add error telemetry and logging infrastructure
57
-
58
- ### 1.2 Performance Optimization
59
- - [ ] Implement streaming XML parsing for large files (>10MB)
60
- - Use SAX parser for memory efficiency
61
- - Progressive validation during parsing
62
- - [ ] Add caching layer for frequent operations
63
- - Format detection cache
64
- - Validation schema cache
65
- - Compiled XPath expression cache
66
- - [ ] Optimize PDF operations
67
- - Streaming PDF processing for large documents
68
- - Parallel extraction strategies
69
- - Memory-mapped file access for huge PDFs
70
-
71
- ### 1.3 Type Safety Enhancements
72
- - [ ] Create comprehensive type definitions for all invoice formats
73
- - [ ] Add strict validation types with branded types
74
- - [ ] Implement type guards for runtime safety
75
- - [ ] Create format-specific interfaces extending TInvoice
76
-
77
- ## Phase 2: Comprehensive Test Suite Implementation
78
-
79
- **Rationale**: A robust test suite is fundamental to ensuring reliability and maintainability. By leveraging the extensive corpus of 646+ test files across multiple formats, we can build confidence in our implementation and catch regressions early. This phase is positioned early in the roadmap because comprehensive testing underpins all subsequent development.
80
-
81
- **Documentation**: See [test/readme.md](test/readme.md) for the complete test suite specification, including:
82
- - 12 test categories (144 total tests) covering all aspects of e-invoicing
83
- - Detailed test corpus overview (646+ real-world invoice files)
84
- - Performance benchmarks and production readiness criteria
85
- - Test naming conventions and organization structure
86
- - Security requirements and CI/CD pipeline stages
87
-
88
- ### 2.1 Test Infrastructure Overhaul
89
- - [x] Reorganize test structure for better maintainability
90
- - Group tests by feature (format detection, validation, conversion, PDF operations)
91
- - Create test utilities for common operations
92
- - Implement test data factories for generating test invoices
93
- - [x] Set up automated test categorization
94
- - Unit tests for individual components
95
- - Integration tests for format workflows
96
- - End-to-end tests for complete invoice processing
97
- - Performance benchmarks
98
- - Compliance tests against official standards
99
-
100
- ### 2.2 Format Detection Test Suite
101
- - [x] Create exhaustive format detection tests using corpus assets
102
- - Test all 28 CII samples from XML-Rechnung
103
- - Test all 28 UBL samples from XML-Rechnung
104
- - Test 24 ZUGFeRD v1 PDFs (both valid and invalid)
105
- - Test 97 ZUGFeRD v2/Factur-X PDFs
106
- - Test PEPPOL large invoice samples
107
- - Test 15 FatturaPA samples
108
- - Test edge cases: malformed files, empty files, wrong extensions
109
- - [x] Add format confidence scoring tests
110
- - [x] Test format detection performance with large files
111
- - [ ] Test streaming detection for huge documents
112
-
113
- ### 2.3 Validation Test Suite ✅ COMPLETED
114
- - [x] **VAL-01**: EN16931 Business Rules (BR-*) validation
115
- - [x] **VAL-02**: EN16931 Codelist Validation (BR-CL-*)
116
- - [x] **VAL-03**: EN16931 Calculation Rules (BR-CO-*)
117
- - [x] **VAL-04**: XRechnung CIUS Validation
118
- - [x] **VAL-05**: ZUGFeRD Profile Validation
119
- - [x] **VAL-06**: FatturaPA Schema Validation
120
- - [x] **VAL-07**: PEPPOL BIS Validation
121
- - [x] **VAL-08**: Syntax Level Validation
122
- - [x] **VAL-09**: Semantic Level Validation
123
- - [x] **VAL-10**: Business Level Validation
124
- - [x] **VAL-11**: Custom Validation Rules
125
- - [x] **VAL-12**: Validation Performance
126
- - [x] **VAL-13**: Validation Error Reporting
127
- - [x] **VAL-14**: Multi-Format Validation
128
-
129
- **Implementation Status**: Complete test suite with 14 comprehensive validation tests covering syntax, semantic, business rules, performance, error reporting, and cross-format consistency. All tests include performance tracking, corpus integration, and detailed error analysis.
130
-
131
- ### 2.4 PDF Operations Test Suite
132
- - [x] PDF extraction testing
133
- - Test XML extraction from all ZUGFeRD v1 samples (24 files)
134
- - Test extraction from ZUGFeRD v2/Factur-X samples (97 files)
135
- - Test handling of PDFs without embedded XML
136
- - Test corrupted PDF handling
137
- - Test large PDF performance (using PEPPOL large samples)
138
- - [x] PDF embedding testing
139
- - Test embedding into existing PDFs
140
- - Test creating new PDF/A-3 compliant files
141
- - Test multiple attachment handling
142
- - Test metadata preservation
143
- - [x] PDF signature testing
144
- - Test signature validation on signed PDFs
145
- - Test signature preservation during embedding
146
-
147
- ### 2.5 Cross-Format Conversion Testing
148
- - [x] Create conversion matrix tests
149
- - CII to UBL conversion using XML-Rechnung pairs
150
- - UBL to CII conversion validation
151
- - ZUGFeRD to XRechnung conversion
152
- - Test data loss detection during conversion
153
- - Verify mandatory field mapping
154
- - [x] Test conversion edge cases
155
- - Missing optional fields
156
- - Format-specific extensions
157
- - Character encoding issues
158
- - Number format variations
159
- - [x] Performance testing for batch conversions
160
-
161
- ### 2.6 Error Handling and Recovery Testing
162
- - [x] Parser error recovery testing
163
- - Test with corpus/other/eicar.*.xml virus test files
164
- - Test with truncated XML files
165
- - Test with invalid character encodings
166
- - Test with mixed format files
167
- - [x] Implement chaos testing
168
- - Random byte corruption
169
- - Memory pressure scenarios
170
- - Concurrent access testing
171
- - Network failure simulation for remote schemas
172
-
173
- ### 2.7 Performance Benchmark Suite
174
- - [ ] Create performance baselines
175
- - Measure parsing speed for each format
176
- - Track memory usage patterns
177
- - Monitor CPU utilization
178
- - Test with corpus large files (PEPPOL samples)
179
- - [ ] Implement regression testing
180
- - Automated performance tracking per commit
181
- - Alert on performance degradation >10%
182
- - Generate performance reports
183
- - [ ] Load testing
184
- - Parallel processing of 1000+ invoices
185
- - Memory leak detection over long runs
186
- - Resource cleanup verification
187
-
188
- ### 2.8 Compliance and Certification Testing
189
- - [ ] Official test suite integration
190
- - Automate EN16931 official test execution
191
- - XRechnung certification test suite
192
- - PEPPOL validation test suite
193
- - FatturaPA compliance tests
194
- - [ ] Create compliance reports
195
- - Generate format support matrix
196
- - Document known limitations
197
- - Track standards compliance percentage
198
- - [ ] Regression testing against standards updates
199
-
200
- ### 2.9 Test Data Management
201
- - [ ] Organize test corpus
202
- - Index all test files with metadata
203
- - Create test file catalog with descriptions
204
- - Tag files by features they test
205
- - Version control test file changes
206
- - [ ] Synthetic test data generation
207
- - Invoice generator for edge cases
208
- - Fuzz testing data creation
209
- - Performance testing datasets
210
- - Internationalization test data (all languages/scripts)
211
-
212
- ### 2.10 Test Reporting and Analytics
213
- - [ ] Implement comprehensive test reporting
214
- - Coverage reports by format
215
- - Feature coverage mapping
216
- - Test execution time tracking
217
- - Failure pattern analysis
218
- - [ ] Create test dashboard
219
- - Real-time test status
220
- - Historical trend analysis
221
- - Format support coverage
222
- - Performance metrics visualization
223
-
224
- **Phase 2 Achievement Summary**:
225
- - ✅ **Format Detection (FD)**: Complete (12/12 tests) - All format detection tests implemented
226
- - ✅ **Validation (VAL)**: Complete (14/14 tests) - Comprehensive validation test suite implemented
227
- - ✅ **PDF Operations (PDF)**: Complete (12/12 tests) - Comprehensive PDF functionality implemented
228
- - PDF-01: XML Extraction ✅, PDF-02: ZUGFeRD v1 Extraction ✅, PDF-03: ZUGFeRD v2/Factur-X Extraction ✅
229
- - PDF-04: XML Embedding ✅, PDF-05: PDF/A-3 Creation ✅, PDF-06: Multiple Attachments ✅
230
- - PDF-07: Metadata Preservation ✅, PDF-08: Large PDF Performance ✅, PDF-09: Corrupted PDF Recovery ✅
231
- - PDF-10: PDF Signature Validation ✅, PDF-11: PDF/A Compliance ✅, PDF-12: PDF Version Compatibility ✅
232
- - ✅ **Conversion (CONV)**: Complete (12/12 tests) - Comprehensive format conversion testing implemented
233
- - CONV-01: Format Conversion ✅, CONV-02: UBL to CII ✅, CONV-03: ZUGFeRD to XRechnung ✅
234
- - CONV-04: Field Mapping ✅, CONV-05: Mandatory Fields ✅, CONV-06: Data Loss Detection ✅
235
- - CONV-07: Character Encoding ✅, CONV-08: Extension Preservation ✅, CONV-09: Round-Trip ✅
236
- - CONV-10: Batch Conversion ✅, CONV-11: Encoding Edge Cases ✅, CONV-12: Performance ✅
237
- - ✅ **Error Handling (ERR)**: Complete (10/10 tests) - Comprehensive error recovery implemented
238
- - ERR-01: Parsing Recovery ✅, ERR-02: Validation Error Details ✅, ERR-03: PDF Operation Errors ✅
239
- - ERR-04: Network/API Errors ✅, ERR-05: Memory/Resource Errors ✅, ERR-06: Concurrent Operation Errors ✅
240
- - ERR-07: Character Encoding Errors ✅, ERR-08: File System Errors ✅, ERR-09: Transformation Errors ✅
241
- - ERR-10: Configuration Errors ✅
242
- - ✅ **XML Parsing (PARSE)**: Complete (12/12 tests) - Comprehensive XML parsing functionality implemented
243
- - PARSE-01: Well-Formed XML ✅, PARSE-02: Malformed Recovery ✅, PARSE-03: Encoding Detection ✅
244
- - PARSE-04: BOM Handling ✅, PARSE-05: Namespace Resolution ✅, PARSE-06: Large XML Streaming ✅
245
- - PARSE-07: XML Schema Validation ✅, PARSE-08: XPath Evaluation ✅, PARSE-09: Entity Resolution ✅
246
- - PARSE-10: CDATA Handling ✅, PARSE-11: Processing Instructions ✅, PARSE-12: Memory Efficiency ✅
247
- - ✅ **XML Encoding (ENC)**: Complete (10/10 tests) - Character encoding and special character handling implemented
248
- - ENC-01: UTF-8 Encoding ✅, ENC-02: UTF-16 Encoding ✅, ENC-03: ISO-8859-1 Encoding ✅
249
- - ENC-04: Character Escaping ✅, ENC-05: Special Characters ✅, ENC-06: Namespace Declarations ✅
250
- - ENC-07: Attribute Encoding ✅, ENC-08: Mixed Content ✅, ENC-09: Encoding Errors ✅
251
- - ENC-10: Cross-Format Encoding ✅
252
- - ✅ **Performance (PERF)**: Complete (12/12 tests) - Performance benchmarking fully implemented
253
- - PERF-01: Format Detection Speed ✅, PERF-02: Validation Performance ✅
254
- - PERF-03: PDF Extraction Speed ✅, PERF-04: Conversion Throughput ✅
255
- - PERF-05: Memory Usage Profiling ✅, PERF-06: CPU Utilization ✅
256
- - PERF-07: Concurrent Processing ✅, PERF-08: Large File Processing ✅
257
- - PERF-09: Streaming Performance ✅, PERF-10: Cache Efficiency ✅
258
- - PERF-11: Batch Processing ✅, PERF-12: Resource Cleanup ✅
259
- - ✅ **Security (SEC)**: Complete (10/10 tests) - Security testing fully implemented
260
- - SEC-01: XXE Prevention ✅, SEC-02: XML Bomb Prevention ✅
261
- - SEC-03: PDF Malware Detection ✅, SEC-04: Input Validation ✅
262
- - SEC-05: Path Traversal Prevention ✅, SEC-06: Memory DoS Prevention ✅
263
- - SEC-07: Schema Validation Security ✅, SEC-08: Cryptographic Signature Validation ✅
264
- - SEC-09: Safe Error Messages ✅, SEC-10: Resource Limits ✅
265
- - ✅ **Edge Cases (EDGE)**: Complete (10/10 tests) - Edge case handling fully implemented
266
- - EDGE-01: Empty Invoice Files ✅, EDGE-02: Gigabyte-Size Invoices ✅
267
- - EDGE-03: Deeply Nested XML Structures ✅, EDGE-04: Unusual Character Sets ✅
268
- - EDGE-05: Zero-Byte PDFs ✅, EDGE-06: Circular References ✅
269
- - EDGE-07: Maximum Field Lengths ✅, EDGE-08: Mixed Format Documents ✅
270
- - EDGE-09: Corrupted ZIP Containers ✅, EDGE-10: Time Zone Edge Cases ✅
271
- - 🔄 **Standards Compliance (STD)**: In progress (6/10 tests)
272
- - STD-01: EN16931 Core Compliance ✅
273
- - STD-02: XRechnung CIUS Compliance ✅
274
- - STD-03: PEPPOL BIS 3.0 Compliance ✅
275
- - STD-04: ZUGFeRD 2.1 Compliance ✅
276
- - STD-05: Factur-X 1.0 Compliance ✅
277
- - STD-06: FatturaPA 1.2 Compliance ✅
278
- - 🔄 **Remaining Categories**: Rest of STD (4 tests), CORP tests planned
279
-
280
- **Current Status**: 117 of 144 planned tests implemented (~81% complete). Core functionality now comprehensively tested across format detection, validation, PDF operations, format conversion, error handling, XML parsing, encoding, performance, security, edge cases, and major standards compliance including European and Italian requirements. The test suite provides robust coverage of production-critical features with real-world corpus integration, performance tracking, and comprehensive error analysis. Full documentation available in [test/readme.md](test/readme.md).
281
-
282
- ## Phase 3: Format Support Expansion
283
-
284
- ### 3.1 Complete Missing Implementations
285
- - [ ] Implement FatturaPA (Italian format)
286
- - Create FatturaPADecoder
287
- - Create FatturaPAEncoder
288
- - Create FatturaPAValidator
289
- - Add comprehensive test suite
290
- - [ ] Add support for additional formats:
291
- - [ ] PEPPOL BIS 3.0 (Pan-European)
292
- - [ ] e-Invoice (India GST)
293
- - [ ] CFDI (Mexico)
294
- - [ ] Fatura-e (Brazil)
295
- - [ ] e-Fatura (Turkey)
296
- - [ ] Swiss QR-bill integration
297
-
298
- ### 3.2 Enhanced Format Conversion
299
- - [ ] Implement intelligent field mapping between formats
300
- - [ ] Add conversion quality scoring
301
- - [ ] Create conversion loss reports
302
- - [ ] Support partial conversions with warnings
303
- - [ ] Add format-specific extension preservation
304
-
305
- ## Phase 4: Advanced Validation System
306
-
307
- ### 4.1 Comprehensive Business Rule Engine
308
- - [ ] Implement rule engine for complex validations
309
- - Cross-field validations
310
- - Country-specific business rules
311
- - Industry-specific validations
312
- - Tax calculation verification
313
- - [ ] Add configurable validation profiles
314
- - [ ] Support custom validation rules via plugins
315
- - [ ] Real-time validation with incremental updates
316
-
317
- ### 4.2 Smart Validation Features
318
- - [ ] Auto-correction suggestions for common errors
319
- - [ ] Machine learning-based anomaly detection
320
- - [ ] Historical validation pattern analysis
321
- - [ ] Compliance checking against latest regulations
322
- - [ ] Multi-language validation messages
323
-
324
- ## Phase 5: PDF Processing Excellence
325
-
326
- ### 5.1 Advanced PDF Features
327
- - [ ] Support for digitally signed PDFs
328
- - Signature validation
329
- - Certificate chain verification
330
- - Timestamp validation
331
- - [ ] Handle encrypted PDFs
332
- - [ ] Support PDF/A-1, PDF/A-2, PDF/A-3 standards
333
- - [ ] Add PDF repair capabilities for corrupted files
334
- - [ ] Implement OCR fallback for scanned invoices
335
-
336
- ### 5.2 Enhanced Embedding
337
- - [ ] Support multiple XML attachments
338
- - [ ] Add invoice visualization layer
339
- - [ ] Embed human-readable HTML representation
340
- - [ ] Support for additional metadata standards
341
- - [ ] Compression optimization for smaller file sizes
342
-
343
- ## Phase 6: Enterprise Features
344
-
345
- ### 6.1 Batch Processing
346
- - [ ] CLI tool for bulk operations
347
- - Parallel processing with worker threads
348
- - Progress tracking and resumable operations
349
- - Detailed batch reports
350
- - [ ] API for streaming operations
351
- - [ ] Queue-based processing system
352
- - [ ] Webhook notifications for async operations
353
-
354
- ### 6.2 Integration Capabilities
355
- - [ ] REST API server mode
356
- - [ ] GraphQL API support
357
- - [ ] Message queue integrations (RabbitMQ, Kafka)
358
- - [ ] Database storage adapters
359
- - PostgreSQL with JSONB
360
- - MongoDB
361
- - ElasticSearch for search
362
- - [ ] Cloud storage integrations (S3, Azure Blob, GCS)
363
-
364
- ### 6.3 Security Features
365
- - [ ] Field-level encryption support
366
- - [ ] GDPR compliance tools
367
- - Data anonymization
368
- - Right to be forgotten
369
- - Audit trails
370
- - [ ] Role-based access control for API mode
371
- - [ ] Rate limiting and DDoS protection
372
-
373
- ## Phase 7: Developer Experience
374
-
375
- ### 7.1 Documentation Excellence
376
- - [ ] Interactive API documentation
377
- - [ ] Video tutorials for common use cases
378
- - [ ] Migration guides from other libraries
379
- - [ ] Best practices guide
380
- - [ ] Performance tuning guide
381
- - [ ] Troubleshooting decision tree
382
-
383
- ### 7.2 Development Tools
384
- - [ ] Invoice format playground/sandbox
385
- - [ ] Visual invoice builder
386
- - [ ] Format comparison tool
387
- - [ ] Validation rule designer
388
- - [ ] Test data generator
389
- - [ ] VS Code extension for e-invoice files
390
-
391
- ### 7.3 Testing Infrastructure Enhancement
392
- - [ ] Integrate with comprehensive test suite from Phase 2
393
- - [ ] Create testing best practices documentation
394
- - [ ] Develop testing plugins for IDEs
395
- - [ ] Build test case contribution portal
396
- - [ ] Establish testing certification program
397
-
398
- ## Phase 8: Advanced Features
399
-
400
- ### 8.1 AI/ML Integration
401
- - [ ] Automatic data extraction from unstructured invoices
402
- - [ ] Invoice fraud detection
403
- - [ ] Duplicate invoice detection
404
- - [ ] Automatic categorization and tagging
405
- - [ ] Predictive validation
406
-
407
- ### 8.2 Analytics and Reporting
408
- - [ ] Invoice analytics dashboard
409
- - [ ] Compliance reporting
410
- - [ ] Format usage statistics
411
- - [ ] Error pattern analysis
412
- - [ ] Performance metrics tracking
413
-
414
- ### 8.3 Ecosystem Development
415
- - [ ] Plugin system for custom formats
416
- - [ ] Marketplace for validation rules
417
- - [ ] Community contribution portal
418
- - [ ] Certification program for implementations
419
- - [ ] Reference implementation status
420
-
421
- ## Phase 9: Global Standards Leadership
422
-
423
- ### 9.1 Standards Participation
424
- - [ ] Contribute to invoice format standards
425
- - [ ] Maintain compatibility matrix
426
- - [ ] Provide feedback to standards bodies
427
- - [ ] Host interoperability testing events
428
-
429
- ### 9.2 Compliance Automation
430
- - [ ] Automatic updates for regulation changes
431
- - [ ] Compliance certification generation
432
- - [ ] Audit trail generation
433
- - [ ] Regulatory reporting tools
434
-
435
- ## Implementation Priority
436
-
437
- 1. **Pre-Sprint (Week 1)**
438
- - Complete rebranding from XInvoice to EInvoice
439
- - Update all documentation and examples
440
- - Create migration guide
441
-
442
- 2. **Immediate (Sprint 1-2)**
443
- - Enhanced error handling (Phase 1)
444
- - Comprehensive test suite setup (Phase 2)
445
- - Test infrastructure using existing corpus
446
-
447
- 3. **Short-term (Sprint 3-4)**
448
- - Complete test implementation (Phase 2)
449
- - FatturaPA implementation (Phase 3)
450
- - Additional format support (PEPPOL, e-Invoice India)
451
-
452
- 4. **Medium-term (Sprint 5-6)**
453
- - Advanced validation engine (Phase 4)
454
- - PDF signature support (Phase 5)
455
- - Performance optimization
456
-
457
- 5. **Long-term (Sprint 7-10)**
458
- - Enterprise features (Phase 6)
459
- - Developer experience (Phase 7)
460
- - AI/ML features (Phase 8)
461
-
462
- 6. **Vision (Sprint 11-12+)**
463
- - Global standards participation (Phase 9)
464
- - Full ecosystem development
465
- - Market leadership position
466
-
467
- ## Success Metrics
468
-
469
- - **Test Coverage**: 95%+ code coverage, 100% critical path coverage
470
- - **Test Suite**: 1000+ automated tests across all formats
471
- - **Accuracy**: 99.99% format detection accuracy (validated by test corpus)
472
- - **Performance**: <100ms processing for average invoice
473
- - **Coverage**: Support for 20+ invoice formats
474
- - **Reliability**: 99.9% uptime for API mode
475
- - **Compliance**: Pass 100% of official validation test suites
476
- - **Quality**: Zero critical bugs in production
477
- - **Adoption**: 10,000+ active users
478
- - **Standards**: Certified by major standards bodies
479
-
480
- ## Technical Debt Reduction
481
-
482
- - [ ] Refactor redundant code in format implementations
483
- - [ ] Standardize error messages across all formats
484
- - [ ] Improve test coverage to 95%+
485
- - [ ] Update all dependencies to latest versions
486
- - [ ] Implement consistent logging throughout
487
- - [ ] Add performance benchmarks to CI/CD
488
-
489
- ## Community Building
490
-
491
- - [ ] Create Discord/Slack community
492
- - [ ] Monthly office hours
493
- - [ ] Contribution guidelines
494
- - [ ] Bug bounty program
495
- - [ ] Annual conference/meetup
496
-
497
- This plan positions @fin.cx/einvoice as the definitive solution for electronic invoice processing, with enterprise-grade features, global format support, and a thriving ecosystem.
@@ -1,36 +0,0 @@
1
- export interface ISaxonJSCompileOptions {
2
- stylesheetText: string;
3
- warnings?: string;
4
- [key: string]: unknown;
5
- }
6
-
7
- export interface ISaxonJSTransformOptions {
8
- stylesheetInternal?: unknown;
9
- stylesheetFileName?: string;
10
- sourceText: string;
11
- destination?: string;
12
- stylesheetParams?: Record<string, unknown>;
13
- [key: string]: unknown;
14
- }
15
-
16
- export interface ISaxonJSTransformResult {
17
- principalResult: string;
18
- [key: string]: unknown;
19
- }
20
-
21
- export interface ISaxonJSModule {
22
- compile?: (options: ISaxonJSCompileOptions) => Promise<unknown>;
23
- transform(options: ISaxonJSTransformOptions, executionMode?: 'async' | 'sync'): Promise<ISaxonJSTransformResult> | ISaxonJSTransformResult;
24
- [key: string]: unknown;
25
- }
26
-
27
- let cachedSaxonJS: Promise<ISaxonJSModule> | undefined;
28
-
29
- export const loadSaxonJS = async (): Promise<ISaxonJSModule> => {
30
- cachedSaxonJS ||= import('saxon-js').then((saxonJSRuntime) => {
31
- const runtime = (saxonJSRuntime as any).default ?? saxonJSRuntime;
32
- return runtime as ISaxonJSModule;
33
- });
34
-
35
- return cachedSaxonJS;
36
- };