# Changelog

All notable changes to this project will be documented in this file.

## [1.1.0] - 2025-06-02

### Added
- ⚡ **Rate Limit Compliance**: Default 6-second delays for code redemption (HoYoLab's actual API limit)
- 🔄 **Smart Cooldown Handling**: Automatic detection and retry for API cooldowns
- 📊 **RateLimits Constants**: Easy access to timing configurations
- 🛡️ **Enhanced Error Handling**: Better error categorization and retry logic
- 📈 **Attempt Tracking**: Detailed logging of retry attempts for each code

### Changed
- 🕒 **Breaking**: Default `redeemMultipleCodes` delay increased from 1s to 6s for API compliance
- 🔧 **Improved**: ErrorCodes now properly exported in main package
- 📝 **Enhanced**: Documentation updated with rate limit warnings and best practices

### Fixed
- ✅ **Cooldown Detection**: Automatic parsing of "Please try again in X second(s)" messages
- ✅ **Retry Logic**: Smart waiting based on API-provided cooldown times
- ✅ **Export Issues**: All constants and error codes now properly accessible

## [1.0.0] - 2025-06-02

### Added
- 🎉 **Initial release** of hoyolab-core package!
- Daily check-in functionality for Genshin Impact, Honkai: Star Rail, and Zenless Zone Zero
- Code redemption system with game-specific validation  
- Game-specific region mapping system (each game has its own region codes)
- HTTP client with rate limiting and retry logic
- Comprehensive error handling with custom error codes
- TypeScript definitions included
- Full test suite with 17 test cases
- Documentation and usage examples

### Core Features
- **HoyoLabClient**: Main client class for HoYoLab APIs
- **Games Support**: Genshin Impact, Honkai: Star Rail, Zenless Zone Zero
- **Region Mapping**: Game-specific region code to name mapping
- **Error Handling**: Custom error types with descriptive codes  
- **Zero Dependencies**: Pure Node.js implementation
- **Rate Limiting**: Built-in API protection
- **TypeScript Ready**: Full type definitions

### Game-Specific Region Mappings
- **Genshin Impact**: `os_usa`→NA, `os_euro`→EU, `os_asia`→SEA, `os_cht`→TW/HK/MO
- **Honkai Star Rail**: `prod_official_usa`→NA, `prod_official_eur`→EU, `prod_official_asia`→SEA, `prod_official_cht`→TW/HK/MO  
- **Zenless Zone Zero**: `prod_gf_us`→NA, `prod_gf_eu`→EU, `prod_gf_jp`→SEA, `prod_gf_sg`→TW/HK/MO
