Comparing version 4.69.3 to 4.69.4
# Change Log | ||
## [v4.69.4](https://github.com/plivo/plivo-node/tree/v4.69.4) (2025-02-18) | ||
**Feature - Throw GeoPermissionException on synchronous geopermissions error** | ||
## [v4.69.3](https://github.com/plivo/plivo-node/tree/v4.69.3) (2024-12-12) | ||
@@ -3,0 +6,0 @@ **Feature - Typescript support for verify session** |
@@ -42,2 +42,12 @@ 'use strict'; | ||
var isGeoPermissionError = function isGeoPermissionError(response) { | ||
var code = response.status; | ||
var url = response.config.url; | ||
var method = response.config.method; | ||
var GeoPermissionEndpoints = ['/Message/', '/Call/', '/Session/']; | ||
return code == 403 && method.toLowerCase() == "post" && GeoPermissionEndpoints.some(function (endpoint) { | ||
return url.endsWith(endpoint); | ||
}); | ||
}; | ||
var retryWrapper = function retryWrapper(axios, options) { | ||
@@ -107,2 +117,6 @@ var max_time = options.retryTime; | ||
if (isGeoPermissionError(response)) { | ||
exceptionClass = Exceptions.GeoPermissionError; | ||
} | ||
if (!_.inRange(response.status, 200, 300)) { | ||
@@ -133,2 +147,7 @@ var body = response.data; | ||
}[error.response.status] || Error; | ||
if (isGeoPermissionError(error.response)) { | ||
exceptionClass = Exceptions.GeoPermissionError; | ||
} | ||
if (!_.inRange(error.response.status, 200, 300)) { | ||
@@ -229,2 +248,6 @@ var body = error.response.data; | ||
if (isGeoPermissionError(response)) { | ||
exceptionClass = Exceptions.GeoPermissionError; | ||
} | ||
if (!_.inRange(response.status, 200, 300)) { | ||
@@ -257,2 +280,7 @@ var body = response.data; | ||
}[error.response.status] || Error; | ||
if (isGeoPermissionError(error.response)) { | ||
exceptionClass = Exceptions.GeoPermissionError; | ||
} | ||
if (!_.inRange(error.response.status, 200, 300)) { | ||
@@ -285,2 +313,6 @@ var body = error.response.data; | ||
if (isGeoPermissionError(response)) { | ||
exceptionClass = Exceptions.GeoPermissionError; | ||
} | ||
if (!_.inRange(response.status, 200, 300)) { | ||
@@ -319,2 +351,7 @@ var body = response.data; | ||
}[error.response.status] || Error; | ||
if (isGeoPermissionError(error.response)) { | ||
exceptionClass = Exceptions.GeoPermissionError; | ||
} | ||
if (!_.inRange(error.response.status, 200, 300)) { | ||
@@ -321,0 +358,0 @@ var body = error.response.data; |
@@ -97,2 +97,14 @@ 'use strict'; | ||
return NotAcceptableError; | ||
}(PlivoRestError); | ||
var GeoPermissionError = exports.GeoPermissionError = function (_PlivoRestError8) { | ||
_inherits(GeoPermissionError, _PlivoRestError8); | ||
function GeoPermissionError() { | ||
_classCallCheck(this, GeoPermissionError); | ||
return _possibleConstructorReturn(this, (GeoPermissionError.__proto__ || Object.getPrototypeOf(GeoPermissionError)).apply(this, arguments)); | ||
} | ||
return GeoPermissionError; | ||
}(PlivoRestError); |
{ | ||
"name": "plivo", | ||
"version": "4.69.3", | ||
"version": "4.69.4", | ||
"description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/plivo/plivo-node", |
917377
19309