Skip to content

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 22:37
· 26 commits to main since this release
cab2c3a

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 ClientError with OpenAPI runtime exception classes:
    • ResponseError: Thrown for HTTP 4xx/5xx responses containing raw Response and parsed RFC 7807 ErrorResponse payloads.
    • FetchError: Thrown on network/transport-level connection failures.
    • RequiredError: Thrown when required parameter validations fail before network transmission.
  • Method Renaming & Signature Alignment:
    • enrichTransactionCollection is now enrichTransactions (or client.enrichment.enrichTransactions).
    • enrichTransactionCollectionStatus is now getEnrichmentStatus (or client.enrichment.getEnrichmentStatus).
  • Client Class Standardization: Primary client is now XYOClient (with Client exported 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.json and 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.gz batch results directly into typed EnrichmentResponse[] records without third-party runtime dependencies.

3. Middleware & Lifecycle Interceptors

  • Exposes Configuration and Middleware hooks (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 granular type, title, status, detail, and instance attributes.

🧪 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.gz decompression.
  • Dockerfile Security Audit: Updated deploy/Dockerfile security gate to run npm audit --omit=dev --audit-level=low, ensuring audits focus on runtime production dependencies.

📚 Documentation, Governance & Security

  • Enterprise Documentation: Overhauled README.md with 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