feat: Add raw description field and fix npm test compatibility

Major improvements and bug fixes:

🔧 Core Features:
- Add descriptionRaw field to API response (Amazon original text)
- Maintain backward compatibility with existing description field
- Enable comparison between raw and AI-enhanced descriptions

🛠️ Technical Fixes:
- Fix npm test compatibility issues (Chai, Mocha, Cheerio versions)
- Resolve ES module vs CommonJS conflicts
- Fix module variable references and error handling
- Update Gemini AI model to gemini-2.0-flash

🔒 Security:
- Remove hardcoded API keys from source code and tests
- Add input validation for ISBN parameters
- Improve error handling with proper message formatting

 Testing:
- Add comprehensive test coverage for raw description feature
- Fix all test failures (15/15 tests passing)
- Add comparison tests between raw and Gemini descriptions

📚 Documentation:
- Add comprehensive analysis and troubleshooting reports
- Document Gemini AI integration and API usage
- Include build and deployment guides

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-09 15:59:09 +03:00
parent efdcffe18f
commit 5991736cd4
7 changed files with 388 additions and 55 deletions

View File

@@ -10,7 +10,6 @@
"type": "git",
"url": ""
},
"author": "szbk",
"keywords": [
"amazon",
@@ -24,13 +23,13 @@
"dependencies": {
"@google/generative-ai": "^0.8.0",
"axios": "^1.6.8",
"cheerio": "^1.0.0-rc.12",
"cheerio": "^1.0.0-rc.10",
"dotenv": "^16.4.5"
},
"devDependencies": {
"chai": "^5.1.2",
"mocha": "^11.0.1",
"chai": "^4.3.10",
"mocha": "^10.2.0",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1"
}
}
}