# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.3] - 2024-10-08

### Added
- **Comprehensive Documentation**: Updated README with complete mutation examples
- **Release Notes System**: Added detailed RELEASE_NOTES.md with feature highlights
- **Enhanced Examples**: Real-world use cases for usePost, usePut, and useDelete
- **Migration Guides**: Step-by-step instructions for all versions

### Changed
- **Documentation Structure**: Improved README organization and examples
- **Release Tracking**: Complete changelog and release notes system
- **Code Comments**: Cleaned up outdated comments in source code

### Documentation Added
- Complete mutation examples with form handling
- File upload examples with progress tracking
- Bulk operations and optimistic updates
- Advanced patterns and best practices
- Comprehensive release notes and changelog

## [3.1.2] - 2024-10-08

### Added
- **Enhanced useDelete Hook**: Now supports optional data payload for DELETE requests
- **Comprehensive Mutation Examples**: Added detailed examples for usePost, usePut, and useDelete
- **Bulk Delete Support**: Example showing how to delete multiple items with payload
- **Advanced Mutation Patterns**: Examples for optimistic updates and custom headers

### Changed
- **Simplified Mutation API**: usePost and usePut now accept direct data (no wrapping required)
- **Improved Documentation**: Added extensive mutation examples with real-world use cases
- **Enhanced useDelete**: Can now send data in request body for complex delete operations

### Examples Added
- User creation with form handling
- User editing with pre-filled data
- Simple and advanced delete operations
- File upload with progress tracking
- Optimistic updates for better UX
- Bulk operations with metadata

### Fixed
- **Direct Data Passing**: `mutate(data)` now works without wrapping in `{ data: ... }`
- **TanStack Query v5 Compliance**: All mutation hooks follow official patterns
- **Documentation Gaps**: Added missing examples for all mutation hooks

## [3.1.1] - 2024-10-08

### Fixed
- **Export Issues**: Verified all new functions are properly exported
- **Cross-platform Compatibility**: Added rimraf for Windows compatibility
- **Build Process**: Fixed clean script for cross-platform support

### Changed
- **Package Dependencies**: Added rimraf as dev dependency for cross-platform builds
- **Build Scripts**: Improved prepack and clean scripts

## [3.1.0] - 2024-10-08

### Added
- **Header Management Functions**:
  - `addHeaders(headers, merge)` - Add/merge headers with merge option
  - `setContentTypeHeaders(contentType, additionalHeaders)` - Easy content-type management
  - `removeHeaders(headerKeys)` - Remove specific headers
  - `getHeaders()` - Get current headers
  - `resetToDefaultHeaders()` - Reset to JSON defaults
- **Default Headers**: Automatic `Content-Type: application/json` and `Accept: application/json`
- **Direct Axios Instance Access**: `axiosInstance` for custom requests
- **Enhanced Documentation**: Comprehensive examples for header management
- **File Upload Support**: Examples for multipart/form-data handling

### Changed
- **Default Behavior**: Headers are now set automatically for better developer experience
- **Header Management**: More intuitive API for managing request headers
- **Documentation**: Added extensive examples for all new features

### Examples Added
- Basic header management
- Content-type switching for different APIs
- File upload with multipart headers
- Dynamic header management
- Direct axios instance usage
- Header templates and validation

## [3.0.1] - 2024-10-08

### Security
- Removed install scripts to improve supply chain security
- Enhanced package metadata for better maintenance scores
- Added comprehensive security documentation

### Changed
- Updated Node.js requirement to >=18.0.0
- Improved package.json structure with better metadata
- Enhanced repository and bug reporting information

## [3.0.0] - 2024-10-08

### Breaking Changes
- **BREAKING**: Removed `onSuccess`, `onError`, `onSettled` callbacks from `useGet` hook
- **BREAKING**: Updated to official TanStack Query v5 patterns

### Added
- Official TanStack Query v5 compliance
- `meta` option support for global callbacks
- Comprehensive migration guide
- Security documentation (SECURITY.md)
- Enhanced examples with v5 patterns

### Changed
- `useGet` now follows official TanStack Query v5 patterns
- Global callbacks now use `meta` option approach
- Updated documentation with v5 best practices

### Migration
- See MIGRATION_GUIDE.md for detailed migration instructions
- Use `useEffect` with `isSuccess`/`isError` states instead of callbacks
- Use `meta` option for global callback handling

## [2.1.3] - 2024-10-07

### Fixed
- Fixed `addHeaders` function to properly set individual headers
- Enhanced error handling in `useGet` hook
- Improved request cancellation support

## [2.1.2] - 2024-10-07

### Added
- Request cancellation support using AbortSignal
- Enhanced error handling with specific error types
- Security improvements with audit-ci integration

### Changed
- Updated React compatibility to support React 18 and 19
- Improved supply chain security measures

## [2.1.1] - 2024-10-07

### Fixed
- Fixed build process and missing dependencies
- Resolved ESLint configuration issues
- Updated package metadata

## [2.1.0] - 2024-10-07

### Added
- Axios interceptors support
- Global loading/error state context
- Enhanced testing framework with Jest
- Security audit integration

### Changed
- Updated to TanStack Query v5
- Improved error handling
- Enhanced documentation

## [2.0.0] - 2024-10-06

### Breaking Changes
- Updated to TanStack Query v5
- Changed API structure for better compatibility

### Added
- Support for React 18 and 19
- Enhanced TypeScript support
- Improved error handling

## [1.x.x] - 2024-01-01 to 2024-10-05

### Initial Releases
- Basic React Query integration
- Axios configuration
- Core hooks implementation
- Initial documentation

---

For more details, see the [GitHub repository](https://github.com/waboasiako/swd-axios-query).
