feat: Add return/replace items functionality#3
Open
davidvasandani wants to merge 3 commits intorigwild:mainfrom
Open
feat: Add return/replace items functionality#3davidvasandani wants to merge 3 commits intorigwild:mainfrom
davidvasandani wants to merge 3 commits intorigwild:mainfrom
Conversation
- Break out monolithic amazon.ts into separate modules: - products.ts: Product search and details functions - cart.ts: Cart management functions (add, clear, get content) - orders.ts: Order history functions - Add dynamic Amazon domain extraction from cookies: - Automatically detects regional Amazon sites (amazon.co.uk, amazon.de, etc.) - Falls back to amazon.com if no cookies found - All URLs now use the detected domain instead of hardcoded values - Update all imports and test files to use new module structure - Add CLAUDE.md documentation for future Claude Code instances - Fix TypeScript diagnostic issues This refactoring improves code maintainability and enables the MCP server to work with any regional Amazon site based on the provided cookies. π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update getProductDetails test to dynamically search for products before testing - Update addToCart test to find available products through search - Fix cart confirmation message check to support both "Added to cart" and "Added to basket" - Add helper functions to find suitable test products - Tests now adapt to product availability instead of using hardcoded ASINs This ensures tests remain functional even when specific products become unavailable. π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add returnUrl field to order history data - Create new MCP tool 'initiate-return' for starting returns - Implement return page navigation and item extraction - Extract returnable items with eligibility status - Support both live and mock modes π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
initiate-returnthat navigates to Amazon's return pageChanges
Order History Enhancement:
returnUrlfield to each order in order historyhttps://www.amazon.com/spr/returns/cart?orderId=XXX&ref=ppx_yo2ov_dt_b_return_replaceNew MCP Tool:
initiate-return: Accepts an order ID and navigates to the return pageReturn Page Scraping:
Test Results
Successfully tested with real Amazon orders:
Usage
π€ Generated with Claude Code