# Changelog ## 2025-07-29 - 4.2.0 - feat(client) Add handle429Backoff method for intelligent rate limit handling **Features:** - Added `handle429Backoff()` method to SmartRequest class for automatic HTTP 429 handling - Respects `Retry-After` headers with support for both seconds and HTTP date formats - Configurable exponential backoff when no Retry-After header is present - Added `RateLimitConfig` interface with customizable retry behavior - Optional callback for monitoring rate limit events - Maximum wait time capping to prevent excessive delays **Improvements:** - Updated test endpoints to use more reliable services (jsonplaceholder, echo.zuplo.io) - Added timeout parameter to test script for better CI/CD compatibility **Documentation:** - Added comprehensive rate limiting section to README with examples - Documented all configuration options for handle429Backoff ## 2025-07-29 - 4.1.0 - feat(client) Add missing options() method to SmartRequest client **Features:** - Added `options()` method to SmartRequest class for setting arbitrary request options - Enables setting keepAlive and other platform-specific options via fluent API - Added test coverage for keepAlive functionality **Documentation:** - Updated README with examples of using the `options()` method - Added specific examples for enabling keepAlive connections - Corrected all documentation to use `options()` instead of `option()` ## 2025-07-28 - 4.0.0 - BREAKING CHANGE(core) Complete architectural overhaul with cross-platform support **Breaking Changes:** - Renamed `SmartRequestClient` to `SmartRequest` for simpler, cleaner API - Removed legacy API entirely (no more `/legacy` import path) - Major architectural refactoring: - Added abstraction layer with `core_base` containing abstract classes - Split implementations into `core_node` (Node.js) and `core_fetch` (browser) - Dynamic implementation selection based on environment - Response streaming API changes: - `stream()` now always returns web-style `ReadableStream` - Added `streamNode()` for Node.js streams (throws error in browser) - Unified type system with single `ICoreRequestOptions` interface - Removed all "Abstract" prefixes from type names **Features:** - Full cross-platform support (Node.js and browsers) - Automatic platform detection using @push.rocks/smartenv - Consistent API across platforms with platform-specific capabilities - Web Streams API support in both environments - Better error messages for unsupported platform features **Documentation:** - Completely rewritten README with platform-specific examples - Added architecture overview section - Added migration guide from v2.x and v3.x - Updated all examples to use the new `SmartRequest` class name ## 2025-07-27 - 3.0.0 - BREAKING CHANGE(core) Major architectural refactoring with fetch-like API **Breaking Changes:** - Legacy API functions are now imported from `@push.rocks/smartrequest/legacy` instead of the main export - Modern API response objects now use fetch-like methods (`.json()`, `.text()`, `.arrayBuffer()`, `.stream()`) instead of direct `.body` access - Renamed `responseType()` method to `accept()` in modern API - Removed automatic defaults: - No default keepAlive (must be explicitly set) - No default timeouts - No automatic JSON parsing in core - Complete internal architecture refactoring: - Core module now always returns raw streams - Response parsing happens in SmartResponse methods - Legacy API is now just an adapter over the core module **Features:** - New fetch-like response API with single-use body consumption - Better TypeScript support and type safety - Cleaner separation of concerns between request and response - More predictable behavior aligned with fetch API standards **Documentation:** - Updated all examples to show correct import paths - Added comprehensive examples for the new response API - Enhanced migration guide ## 2025-04-03 - 2.1.0 - feat(docs) Enhance documentation and tests with modern API usage examples and migration guide - Updated README to include detailed examples for the modern fluent API, covering GET, POST, headers, query, timeout, retries, and pagination - Added a migration guide comparing the legacy API and modern API usage - Improved installation instructions with npm, pnpm, and yarn examples - Added and updated test files for both legacy and modern API functionalities - Minor formatting improvements in the code and documentation examples ## 2024-11-06 - 2.0.23 - fix(core) Enhance type safety for response in binary requests - Updated the dependency versions in package.json to their latest versions. - Improved type inference for the response body in getBinary method of smartrequest.binaryrest.ts. - Introduced generic typing to IExtendedIncomingMessage interface for better type safety. ## 2024-05-29 - 2.0.22 - Documentation update description ## 2024-04-01 - 2.0.21 - Configuration Updated configuration files - Updated `tsconfig` - Updated `npmextra.json`: githost ## 2023-07-10 - 2.0.15 - Structure Refactored the organization structure - Switched to a new organization scheme ## 2022-07-29 - 1.1.57 to 2.0.0 - Major Update Significant changes and improvements leading to a major version update - **BREAKING CHANGE**: Switched the core to use ECMAScript modules (ESM) ## 2018-08-14 - 1.1.12 to 1.1.13 - Functional Enhancements Enhanced request capabilities and removed unnecessary dependencies - Fixed request module to allow sending strings - Removed CI dependencies ## 2018-07-19 - 1.1.1 to 1.1.11 - Various Fixes and Improvements Improvements and fixes across various components - Added formData capability - Corrected path resolution to use current working directory (CWD) - Improved formData handling - Included correct headers - Updated request ending method ## 2018-06-19 - 1.0.14 - Structural Fix Resolved conflicts with file extensions - Changed `.json.ts` to `.jsonrest.ts` to avoid conflicts ## 2018-06-13 - 1.0.8 to 1.0.10 - Core Updates Ensured binary handling compliance - Enhanced core to uphold latest standards - Correct binary file handling response - Fix for handling and returning binary responses ## 2017-06-09 - 1.0.4 to 1.0.6 - Infrastructure and Type Improvements Types and infrastructure updates - Improved types - Removed need for content type on post requests - Updated for new infrastructure