version upgrade

This commit is contained in:
Narayana Shanubhogh 2021-06-25 10:46:33 +05:30
parent 9dad89509c
commit cf5f4dfef9
4 changed files with 16 additions and 3 deletions

View file

@ -1,4 +1,6 @@
# Change Log
## [4.18.1](https://github.com/plivo/plivo-node/releases/tag/v4.18.1)(2021-06-25)
- Fixed the mms media upload functionality
## [4.18.0](https://github.com/plivo/plivo-node/releases/tag/v4.18.0)(2021-06-15)
- Added stir verification param as part of Get CDR and live call APIs

View file

@ -97,7 +97,7 @@ export class MediaInterface extends PlivoResourceInterface {
params.file = files
let client = this[clientKey];
params.multipart = true;
return new Promise((resolve, reject) => {
client('POST', action, params)
.then(response => {

View file

@ -46,7 +46,14 @@ export function Axios(config) {
if (key != 'file') {
multipartParams.append(key, params[key]);
} else {
multipartParams.append(key, require('fs').createReadStream(params[key]));
// In case files are in array
if (Array.isArray(params.file)) {
for (let index = 0; index < params.file.length; index++) {
multipartParams.append(key, require('fs').createReadStream(params.file[index]));
}
}else{
multipartParams.append(key, require('fs').createReadStream(params[key]));
}
}
}
@ -87,6 +94,10 @@ export function Axios(config) {
});
})
.catch(function (error) {
//client side exception like file not found case
if (error.response == undefined){
reject(error.stack );
}
const exceptionClass = {
400: Exceptions.InvalidRequestError,
401: Exceptions.AuthenticationError,

View file

@ -1,6 +1,6 @@
{
"name": "plivo",
"version": "4.18.0",
"version": "4.18.1",
"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": [