chore: Regional API domain processing#1150
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces automatic edge value mapping based on region codes and adds a deprecation warning for direct edge assignment. The implementation adds a regionToEdgeMap that translates region codes (like "au1", "us1") to their corresponding edge locations (like "sydney", "ashburn"), and modifies the request flow to automatically set the edge from the region when only region is specified.
Key Changes:
- Added
regionToEdgeMapwith 9 region-to-edge mappings - Modified
request()method to show deprecation warning when edge is set directly and to automatically map region to edge - Added basic test to verify edge and region properties can be set
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/base/BaseTwilio.ts | Adds regionToEdgeMap constant and logic in request() to handle automatic edge mapping from region with deprecation warning for direct edge setting |
| spec/unit/rest/Twilio.spec.js | Adds test to verify edge and region properties can be assigned (though test doesn't verify the new mapping behavior) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|



Fixes
Raising Deprecation warning and setting edge using region.
Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.