Skip to content

Commit

Permalink
Merge pull request #294 from plivo/PHONUM-2705
Browse files Browse the repository at this point in the history
handling the new status code for HM
  • Loading branch information
kalyan-plivo authored Mar 14, 2023
2 parents 15e7426 + a3077c2 commit de012aa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change Log
## [4.43.0](https://github.com/plivo/plivo-node/tree/v4.43.0) (2023-03-14)
**Adding new status code - Hosted Messaging order**
- Added new status code for create hosted messaging order.

## [4.42.0](https://github.com/plivo/plivo-node/tree/v4.42.0) (2023-03-07)
**Bug fix - 'text' parameter should be optional for MMS**
- Make `text` as an optional parameter for [sending MMS](https://www.plivo.com/docs/sms/api/message#send-a-message).
Expand Down
1 change: 0 additions & 1 deletion lib/resources/hostedMessagingNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export class HostedMessagingNumber extends PlivoResource {
create(params = {}) {
let client = this[clientKey];
return new Promise((resolve, reject) => {
params.multipart = true;
client('POST', action, params)
.then(response => {
let object = new CreateHostedMessagingNumberResponse(response.body, idField);
Expand Down
6 changes: 6 additions & 0 deletions lib/rest/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function Axios(config) {
401: Exceptions.AuthenticationError,
404: Exceptions.ResourceNotFoundError,
405: Exceptions.InvalidRequestError,
406: Exceptions.NotAcceptableError,
500: Exceptions.ServerError,
} [response.status] || Error;

Expand Down Expand Up @@ -103,6 +104,7 @@ export function Axios(config) {
401: Exceptions.AuthenticationError,
404: Exceptions.ResourceNotFoundError,
405: Exceptions.InvalidRequestError,
406: Exceptions.NotAcceptableError,
500: Exceptions.ServerError,
} [error.response.status] || Error;
if (!_.inRange(error.response.status, 200, 300)) {
Expand Down Expand Up @@ -193,6 +195,7 @@ export function Axios(config) {
401: Exceptions.AuthenticationError,
404: Exceptions.ResourceNotFoundError,
405: Exceptions.InvalidRequestError,
406: Exceptions.NotAcceptableError,
500: Exceptions.ServerError,
} [response.status] || Error;

Expand All @@ -219,6 +222,7 @@ export function Axios(config) {
401: Exceptions.AuthenticationError,
404: Exceptions.ResourceNotFoundError,
405: Exceptions.InvalidRequestError,
406: Exceptions.NotAcceptableError,
500: Exceptions.ServerError,
} [error.response.status] || Error;
if (!_.inRange(error.response.status, 200, 300)) {
Expand All @@ -242,6 +246,7 @@ export function Axios(config) {
401: Exceptions.AuthenticationError,
404: Exceptions.ResourceNotFoundError,
405: Exceptions.InvalidRequestError,
406: Exceptions.NotAcceptableError,
500: Exceptions.ServerError,
} [response.status] || Error;

Expand Down Expand Up @@ -275,6 +280,7 @@ export function Axios(config) {
401: Exceptions.AuthenticationError,
404: Exceptions.ResourceNotFoundError,
405: Exceptions.InvalidRequestError,
406: Exceptions.NotAcceptableError,
500: Exceptions.ServerError,
} [error.response.status] || Error;
if (!_.inRange(error.response.status, 200, 300)) {
Expand Down
1 change: 1 addition & 0 deletions lib/utils/exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export class InvalidRequestError extends PlivoRestError { }
export class PlivoXMLError extends PlivoRestError { }
export class PlivoXMLValidationError extends PlivoRestError { }
export class AuthenticationError extends PlivoRestError { }
export class NotAcceptableError extends PlivoRestError { }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plivo",
"version": "4.42.0",
"version": "4.43.0",
"description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML",
"homepage": "https://github.com/plivo/plivo-node",
"files": [
Expand Down

0 comments on commit de012aa

Please sign in to comment.