Skip to content

chore: Regional API domain processing#1150

Merged
manisha1997 merged 14 commits intomainfrom
regional-api-domain-processing
Nov 28, 2025
Merged

chore: Regional API domain processing#1150
manisha1997 merged 14 commits intomainfrom
regional-api-domain-processing

Conversation

@manisha1997
Copy link
Contributor

@manisha1997 manisha1997 commented Nov 27, 2025

Fixes

Raising Deprecation warning and setting edge using region.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 regionToEdgeMap with 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.

@sonarqubecloud
Copy link

Copy link
Contributor

@tiwarishubham635 tiwarishubham635 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@manisha1997 manisha1997 merged commit 476badc into main Nov 28, 2025
19 checks passed
@manisha1997 manisha1997 deleted the regional-api-domain-processing branch November 28, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants