Repository navigation
v2.0.0
Release v2.0.0 (Major Release)
Version 2.0.0 represents a complete architectural overhaul of the XYO Financial Node.js SDK, transitioning to an automated OpenAPI Generator foundation while providing a high-level XYOClient wrapper with native bulk .tar.gz decompression and strict RFC 7807 Problem Details error handling.
💥 Breaking Changes
- New Error Class Hierarchy: Replaced legacy
ClientErrorwith OpenAPI runtime exception classes:ResponseError: Thrown for HTTP 4xx/5xx responses containing rawResponseand parsed RFC 7807ErrorResponsepayloads.FetchError: Thrown on network/transport-level connection failures.RequiredError: Thrown when required parameter validations fail before network transmission.
- Method Renaming & Signature Alignment:
enrichTransactionCollectionis nowenrichTransactions(orclient.enrichment.enrichTransactions).enrichTransactionCollectionStatusis nowgetEnrichmentStatus(orclient.enrichment.getEnrichmentStatus).
- Client Class Standardization: Primary client is now
XYOClient(withClientexported as a backward-compatible alias).
🚀 Key Features & Enhancements
1. OpenAPI-Generated Core (src/generated)
- Generated strictly typed API client models and endpoints (
EnrichmentApi,EnrichmentRequest,EnrichmentResponse,ErrorResponse,APIError). - Added
openapitools.jsonand a dedicated GitHub Action workflow (.github/workflows/generate.yml) for continuous spec synchronization.
2. High-Level XYOClient Wrapper (src/index.ts)
- Provides intuitive synchronous and asynchronous enrichment methods:
enrichTransaction(request): Real-time single transaction enrichment.enrichTransactions(transactions): Asynchronous bulk batch submission.getEnrichmentStatus(id): Bulk job status polling (READY,PENDING,FAILED).downloadEnrichmentCollection(downloadUrl): Built-in native gzip streaming decompression and POSIX/ustar tar archive parser that unpacks.tar.gzbatch results directly into typedEnrichmentResponse[]records without third-party runtime dependencies.
3. Middleware & Lifecycle Interceptors
- Exposes
ConfigurationandMiddlewarehooks (pre,post,onError) for custom request mutation, logging, metrics, and telemetry injection.
4. Comprehensive RFC 7807 Problem Details Support
- Native parsing and model mapping for RFC 7807 Problem Details payloads (
ErrorResponseFromJSON), handling multi-error responses with granulartype,title,status,detail, andinstanceattributes.
🧪 Testing & CI/CD Hardening
- Expanded Test Suite: Replaced legacy tests with a comprehensive 1,600+ line test suite (
src/index.test.ts) covering constructor options, request construction, RFC 7807 parsing, middleware execution, mock fetch transport errors, and bulk.tar.gzdecompression. - Dockerfile Security Audit: Updated
deploy/Dockerfilesecurity gate to runnpm audit --omit=dev --audit-level=low, ensuring audits focus on runtime production dependencies.
📚 Documentation, Governance & Security
- Enterprise Documentation: Overhauled
README.mdwith complete integration guides, architectural principles, polling patterns, and error resolution matrices. - Security Policy: Added SECURITY.md outlining vulnerability disclosure guidelines.
- License: Relicensed to Apache-2.0.
📊 Summary of Diff (v1.2.3...v2.0.0)
- Commits: 2
- Files Changed: 43
- Additions: +4,901
- Deletions: -1,721