mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-05 14:22:27 -06:00
Merge branch 'master' into Fix_MessageResource
This commit is contained in:
commit
801247338f
10 changed files with 276 additions and 79 deletions
22
CHANGELOG.md
22
CHANGELOG.md
|
|
@ -1,7 +1,25 @@
|
|||
# Change Log
|
||||
|
||||
## [4.18.0](https://github.com/plivo/plivo-node/releases/tag/v4.18.0)(2021-05-28)
|
||||
- New Send Message interface along with existing interface support.
|
||||
## [v4.20.0](https://github.com/plivo/plivo-node/tree/v4.20.0) (2021-07-13)
|
||||
- Power pack ID has been included to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message).
|
||||
- Support for filtering messages by Power pack ID has been added to the [list all messages API](https://www.plivo.com/docs/sms/api/message#list-all-messages).
|
||||
|
||||
## [v4.19.2](https://github.com/plivo/plivo-node/tree/v4.19.2) (2021-07-08)
|
||||
- MPC SDK fixes to pass params in a user-friendly manner.
|
||||
|
||||
## [v4.19.1](https://github.com/plivo/plivo-node/tree/v4.19.1) (2021-07-05)
|
||||
- **WARNING**: Removed the total_count parameter in meta data for list MDR response
|
||||
|
||||
## [4.19.0](https://github.com/plivo/plivo-node/releases/tag/v4.19.0)(2021-07-02)
|
||||
- Added CallerName param in AddParticpant
|
||||
- Added support for Parallel behaviour of RingTimeout and Delaydial.
|
||||
- Added support for Recording at Member Level
|
||||
|
||||
## [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
|
||||
|
||||
## [4.17.1](https://github.com/plivo/plivo-node/releases/tag/v4.17.1)(2021-05-06)
|
||||
- Added Fix for Adaptive Powerpack Create & Update functions
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ export class GetLiveCallResponse {
|
|||
this.requestUuid = params.requestUuid;
|
||||
this.sessionStart = params.sessionStart;
|
||||
this.to = params.to;
|
||||
this.stirVerification = params.stirVerification;
|
||||
}
|
||||
}
|
||||
export class RetrieveCallResponse {
|
||||
|
|
@ -100,6 +101,7 @@ export class RetrieveCallResponse {
|
|||
this.toNumber = params.toNumber;
|
||||
this.totalAmount = params.totalAmount;
|
||||
this.totalRate = params.totalRate;
|
||||
this.stirVerification = params.stirVerification;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +127,7 @@ export class ListAllCallsResponse {
|
|||
this.toNumber = params.toNumber;
|
||||
this.totalAmount = params.totalAmount;
|
||||
this.totalRate = params.totalRate;
|
||||
this.stirVerification = params.stirVerification;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ export class MessageGetResponse {
|
|||
this.totalAmount = params.totalAmount;
|
||||
this.totalRate = params.totalRate;
|
||||
this.units = params.units;
|
||||
this.powerpackID = params.powerpackId
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ export class MessageListResponse {
|
|||
this.totalAmount = params.totalAmount;
|
||||
this.totalRate = params.totalRate;
|
||||
this.units = params.units;
|
||||
this.powerpackID = params.powerpackId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import {
|
|||
validDateFormat,
|
||||
validRange,
|
||||
validMultipleDestinationNos,
|
||||
isOneAmongStringUrl, multiValidParam
|
||||
validMultipleDestinationIntegers,
|
||||
isOneAmongStringUrl, multiValidParam, InvalidRequestError
|
||||
} from '../rest/utils.js'
|
||||
|
||||
const clientKey = Symbol();
|
||||
|
|
@ -61,6 +62,11 @@ export class MultiPartyCall extends PlivoResource{
|
|||
validParam('callUuid', params.callUuid, [String], false)
|
||||
}
|
||||
|
||||
if(params.callerName){
|
||||
validParam('callerName', params.callerName, [String], false)
|
||||
validRange('callerName', params.callerName.length, false, 1, 50)
|
||||
}
|
||||
|
||||
if(params.callStatusCallbackUrl){
|
||||
validUrl('callStatusCallbackUrl', params.callStatusCallbackUrl, false)
|
||||
}
|
||||
|
|
@ -99,11 +105,29 @@ export class MultiPartyCall extends PlivoResource{
|
|||
}
|
||||
|
||||
if(params.ringTimeout || params.ringTimeout === 0){
|
||||
validRange('ringTimeout', params.ringTimeout, false, 15, 120)
|
||||
validParam('ringTimeout', params.ringTimeout, [String, Number], false)
|
||||
if(Number.isInteger(params.ringTimeout)){
|
||||
validRange('RingTimeout', params.ringTimeout, false, 15, 120)
|
||||
}
|
||||
else{
|
||||
validMultipleDestinationIntegers('ringTimeout', params.ringTimeout)
|
||||
}
|
||||
}
|
||||
else {
|
||||
params.ringTimeout = 45
|
||||
}
|
||||
if(params.delayDial){
|
||||
validParam('delayDial', params.delayDial, [String, Number], false)
|
||||
if(Number.isInteger(params.delayDial)){
|
||||
validRange('DelayDial', params.delayDial, false, 1, 120)
|
||||
}
|
||||
else{
|
||||
validMultipleDestinationIntegers('delayDial', params.delayDial)
|
||||
}
|
||||
}
|
||||
else {
|
||||
params.delayDial = 0
|
||||
}
|
||||
|
||||
if(params.maxDuration || params.maxDuration === 0){
|
||||
validRange('maxDuration', params.maxDuration, false, 300, 28800)
|
||||
|
|
@ -234,7 +258,7 @@ export class MultiPartyCall extends PlivoResource{
|
|||
params.hold = 'false'
|
||||
}
|
||||
|
||||
if(params.startMpcOnEnter){
|
||||
if(params.startMpcOnEnter!=null){
|
||||
validParam('startMpcOnEnter', params.startMpcOnEnter, [Boolean, String], false)
|
||||
}
|
||||
else {
|
||||
|
|
@ -283,11 +307,18 @@ export class MultiPartyCall extends PlivoResource{
|
|||
params.exitSoundMethod = 'GET'
|
||||
}
|
||||
params.isVoiceRequest = 'true';
|
||||
params.callerName = params.callerName || params.from;
|
||||
return super.executeAction(this.id + '/Participant/', 'POST', params)
|
||||
}
|
||||
|
||||
start(){
|
||||
return super.executeAction(this.id + '/', 'POST', {'status' : 'active', 'isVoiceRequest' : 'true'})
|
||||
start(params){
|
||||
if(params.status) {
|
||||
validParam('status', params.status.toLowerCase(), [String], true, 'active')
|
||||
}
|
||||
else{
|
||||
throw new InvalidRequestError("status is a mandatory parameter");
|
||||
}
|
||||
return super.executeAction(this.id + '/', 'POST', {'status' : params.status.toLowerCase(), 'isVoiceRequest' : 'true'})
|
||||
}
|
||||
|
||||
stop(){
|
||||
|
|
@ -376,6 +407,39 @@ export class MultiPartyCallParticipant extends PlivoSecondaryResource{
|
|||
getParticipant(){
|
||||
return super.executeAction(this.id, this.secondaryId, 'GET',{'isVoiceRequest' : 'true'})
|
||||
}
|
||||
startParticipantRecording(params = {}){
|
||||
if(params.fileFormat){
|
||||
validParam('fileFormat', params.fileFormat, [String], false, ['mp3', 'wav'])
|
||||
}
|
||||
else {
|
||||
params.fileFormat = 'mp3'
|
||||
}
|
||||
|
||||
if(params.statusCallbackUrl){
|
||||
validUrl('statusCallbackUrl', params.statusCallbackUrl, false)
|
||||
}
|
||||
|
||||
if(params.statusCallbackMethod){
|
||||
validParam('statusCallbackMethod', params.statusCallbackMethod.toUpperCase(), [String], false, ['GET', 'POST'])
|
||||
}
|
||||
else {
|
||||
params.statusCallbackMethod = 'POST'
|
||||
}
|
||||
params.isVoiceRequest = 'true';
|
||||
return super.executeAction(this.id , this.secondaryId + '/Record', 'POST', params)
|
||||
}
|
||||
|
||||
stopParticipantRecording(){
|
||||
return super.executeAction(this.id , this.secondaryId +'/Record', 'DELETE',{'isVoiceRequest' : 'true'})
|
||||
}
|
||||
|
||||
pauseParticipantRecording(){
|
||||
return super.executeAction(this.id , this.secondaryId + '/Record/Pause', 'POST',{'isVoiceRequest' : 'true'})
|
||||
}
|
||||
|
||||
resumeParticipantRecording(){
|
||||
return super.executeAction(this.id , this.secondaryId + '/Record/Resume', 'POST',{'isVoiceRequest' : 'true'})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -451,14 +515,16 @@ export class MultiPartyCallInterface extends PlivoResourceInterface{
|
|||
return super.list(params);
|
||||
}
|
||||
|
||||
get(uuid = null, friendlyName = null){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
get(params={}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).get();
|
||||
}
|
||||
|
||||
|
|
@ -476,116 +542,192 @@ export class MultiPartyCallInterface extends PlivoResourceInterface{
|
|||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).addParticipant(params)
|
||||
}
|
||||
|
||||
start(uuid = null, friendlyName = null){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
start(params = {}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).start()
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).start(params)
|
||||
}
|
||||
|
||||
stop(uuid = null, friendlyName = null){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
stop(params = {}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).stop()
|
||||
}
|
||||
|
||||
startRecording(uuid = null, friendlyName = null, params){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
startRecording(params={}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).startRecording(params)
|
||||
}
|
||||
|
||||
stopRecording(uuid = null, friendlyName = null){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
stopRecording(params={}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).stopRecording()
|
||||
}
|
||||
|
||||
pauseRecording(uuid = null, friendlyName = null){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
pauseRecording(params={}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).pauseRecording()
|
||||
}
|
||||
|
||||
resumeRecording(uuid = null, friendlyName = null){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
resumeRecording(params={}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).resumeRecording()
|
||||
}
|
||||
|
||||
listParticipants(uuid = null, friendlyName = null, params){
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
startParticipantRecording(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).startParticipantRecording(params)
|
||||
}
|
||||
|
||||
stopParticipantRecording(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).stopParticipantRecording()
|
||||
}
|
||||
|
||||
pauseParticipantRecording(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).pauseParticipantRecording()
|
||||
}
|
||||
|
||||
resumeParticipantRecording(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).resumeParticipantRecording()
|
||||
}
|
||||
|
||||
listParticipants(params={}){
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).listParticipants(params)
|
||||
}
|
||||
|
||||
updateParticipant(participantId, uuid= null, friendlyName = null, params){
|
||||
updateParticipant(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).updateParticipant(params)
|
||||
}
|
||||
|
||||
kickParticipant(participantId, uuid = null, friendlyName = null){
|
||||
kickParticipant(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).kickParticipant()
|
||||
}
|
||||
|
||||
getParticipant(participantId, uuid = null, friendlyName = null){
|
||||
getParticipant(participantId, params={}){
|
||||
validParam('participantId', participantId, [String, Number], true)
|
||||
if(uuid){
|
||||
validParam('uuid', uuid, [String], false)
|
||||
if(params.uuid){
|
||||
validParam('uuid', params.uuid, [String], false)
|
||||
}
|
||||
if(friendlyName){
|
||||
validParam('friendlyName', friendlyName, [String], false)
|
||||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
let mpcId = this.makeMpcId(uuid, friendlyName)
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
return new MultiPartyCallParticipant(this[clientKey], {id: mpcId[0] + mpcId[1], secondaryId: participantId}).getParticipant()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1158,8 +1158,7 @@ export function Request(config) {
|
|||
limit: 20,
|
||||
next: '/v1/Account/{auth_id}/Message/?limit=20&error_code=200&offset=20',
|
||||
offset: 0,
|
||||
previous: null,
|
||||
total_count: 22
|
||||
previous: null
|
||||
},
|
||||
objects: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -112,6 +112,26 @@ export function validMultipleDestinationNos(paramName, paramValue, options = {})
|
|||
}
|
||||
}
|
||||
|
||||
export function validMultipleDestinationIntegers(paramName, paramValue){
|
||||
let val = paramValue.split("<");
|
||||
for (let i=0; i<val.length; i++){
|
||||
if (!isNaN(val[i]) && Number.isInteger(parseFloat(val[i]))){
|
||||
if(paramName=="delayDial"){
|
||||
if(val[i]!='0'){
|
||||
validRange('DelayDial Destination Value', parseInt(val[i]), false, 1, 120);
|
||||
}
|
||||
}
|
||||
else if (paramName=="ringTimeout"){
|
||||
validRange('RingTimeout Destination Value', parseInt(val[i]), false, 15, 120);
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw new InvalidRequestError( paramName + " Destination value must be integer");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export function validParam(paramName, paramValue, expectedTypes = null, mandatory = false, expectedValues = null){
|
||||
if(mandatory && !paramValue){
|
||||
throw new InvalidRequestError(paramName + " is a required parameter");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "plivo",
|
||||
"version": "4.18.0",
|
||||
"version": "4.20.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": [
|
||||
|
|
|
|||
2
types/resources/messages.d.ts
vendored
2
types/resources/messages.d.ts
vendored
|
|
@ -19,6 +19,7 @@ export class MessageGetResponse {
|
|||
totalAmount: string;
|
||||
totalRate: string;
|
||||
units: string;
|
||||
powerpackId: string;
|
||||
}
|
||||
export class MessageListResponse {
|
||||
constructor(params: object);
|
||||
|
|
@ -34,6 +35,7 @@ export class MessageListResponse {
|
|||
totalAmount: string;
|
||||
totalRate: string;
|
||||
units: string;
|
||||
powerpackId: string;
|
||||
}
|
||||
export class MMSMediaResponse {
|
||||
constructor(params: object);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue