File tree Expand file tree Collapse file tree 2 files changed +0
-52
lines changed
Expand file tree Collapse file tree 2 files changed +0
-52
lines changed Original file line number Diff line number Diff line change @@ -128,31 +128,6 @@ describe("client", () => {
128128 . then ( ( ) => scope . done ( ) ) ;
129129 } ) ;
130130 } ) ;
131-
132- it ( "should not change the value of edge and region" , ( ) => {
133- client = new Twilio ( "ACXXXXXXXX" , "test-password" ) ;
134- client . region = "us1" ;
135- client . edge = "sydney" ;
136- expect ( client . region ) . toEqual ( "us1" ) ;
137- expect ( client . edge ) . toEqual ( "sydney" ) ;
138- } ) ;
139-
140- it ( "should not change the value of edge" , ( ) => {
141- client = new Twilio ( "ACXXXXXXXX" , "test-password" , { edge : "dublin" } ) ;
142- expect ( client . edge ) . toEqual ( "dublin" ) ;
143- } ) ;
144-
145- it ( "should use edge set in request function when region is given" , ( ) => {
146- client = new Twilio ( "ACXXXXXXXX" , "test-password" , { region : "au1" } ) ;
147- expect ( client . region ) . toEqual ( "au1" ) ;
148- const scope = nock ( "https://api.sydney.au1.twilio.com" )
149- . get ( "/" )
150- . reply ( 200 , "test response" ) ;
151- client
152- . request ( { method : "GET" , uri : "https://api.twilio.com" } )
153- . then ( ( ) => scope . done ( ) ) ;
154- expect ( client . edge ) . toEqual ( "sydney" ) ;
155- } ) ;
156131 } ) ;
157132
158133 describe ( "adding user agent extensions" , ( ) => {
Original file line number Diff line number Diff line change @@ -12,18 +12,6 @@ const util = require("util"); /* jshint ignore:line */
1212const RestException = require ( "../base/RestException" ) ; /* jshint ignore:line */
1313
1414namespace Twilio {
15- export const regionToEdgeMap = new Map < string , string > ( [
16- [ "au1" , "sydney" ] ,
17- [ "br1" , "sao-paulo" ] ,
18- [ "de1" , "frankfurt" ] ,
19- [ "ie1" , "dublin" ] ,
20- [ "jp1" , "tokyo" ] ,
21- [ "jp2" , "osaka" ] ,
22- [ "sg1" , "singapore" ] ,
23- [ "us1" , "ashburn" ] ,
24- [ "us2" , "umatilla" ] ,
25- ] ) ;
26-
2715 export interface ClientOpts {
2816 httpClient ?: RequestClient ;
2917 accountSid ?: string ;
@@ -224,21 +212,6 @@ namespace Twilio {
224212 /* jshint ignore:end */
225213
226214 request ( opts : RequestOpts ) : Promise < any > {
227- if (
228- ( this . edge !== undefined && this . region === undefined ) ||
229- ( this . edge === undefined && this . region !== undefined )
230- ) {
231- console . warn (
232- "[DEPRECATION WARNING] For regional processing, DNS is of format product.edge.region.twilio.com;otherwise use product.twilio.com"
233- ) ;
234- }
235- if ( this . region !== undefined && this . edge === undefined ) {
236- const mappedEdge = regionToEdgeMap . get ( this . region ) ;
237- if ( mappedEdge ) {
238- console . warn ( "Setting edge value from the region mapping" ) ;
239- this . edge = mappedEdge ;
240- }
241- }
242215 opts = opts || { } ;
243216
244217 if ( ! opts . method ) {
You can’t perform that action at this time.
0 commit comments