From 9d70d5d35ad58f23bea78679f6ef64e19f9ef014 Mon Sep 17 00:00:00 2001 From: Burhan Ahmed Date: Sun, 10 Oct 2021 14:56:03 +0530 Subject: [PATCH 1/5] Fixed LiveCallInterface --- CHANGELOG.md | 4 ++++ lib/resources/call.js | 14 +++++++------- package.json | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1ff29e..9676581 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [v4.22.5](https://github.com/plivo/plivo-node/tree/v4.22.5) (2021-10-11) +**Bug Fix** + - LiveCallInterface + ## [v4.22.4](https://github.com/plivo/plivo-node/tree/v4.22.4) (2021-09-27) **Bug Fix** - Handle invalid destination number API response for send [SMS API](https://www.plivo.com/docs/sms/api/message/send-a-message/). diff --git a/lib/resources/call.js b/lib/resources/call.js index d4f4c01..27e6983 100644 --- a/lib/resources/call.js +++ b/lib/resources/call.js @@ -920,8 +920,8 @@ class LiveCallInterface extends PlivoResourceInterface { if (action !== '' && !id) { reject(new Error(this[idKey] + ' must be set')); } - client('GET', action + (id ? id + '/?status=live' : '') , { - isVoiceRequest: 'true' + client('GET', action + id, { + isVoiceRequest: 'true', status: 'live' }) .then(response => { resolve(new GetLiveCallResponse(response.body, client)); @@ -941,7 +941,7 @@ class LiveCallInterface extends PlivoResourceInterface { params.status = 'live' params.isVoiceRequest = 'true'; return new Promise((resolve, reject) => { - client('GET', action+'?status=live', params) + client('GET', action, params) .then(response => { let calls = []; response.body.calls.forEach(callUuid => { @@ -997,8 +997,8 @@ class QueuedCallInterface extends PlivoResourceInterface { reject(new Error(this[idKey] + ' must be set')); } - client('GET', action + (id ? id + '/?status=queued' : ''), { - isVoiceRequest: 'true' + client('GET', action + id, { + isVoiceRequest: 'true', status: 'live' }) .then(response => { resolve(new GetQueuedCallResponse(response.body, client)); @@ -1015,8 +1015,8 @@ class QueuedCallInterface extends PlivoResourceInterface { let client = this[clientKey]; return new Promise((resolve, reject) => { - client('GET', action+'?status=queued', { - isVoiceRequest: 'true' + client('GET', action, { + isVoiceRequest: 'true', status: 'live' }) .then(response => { let calls = []; diff --git a/package.json b/package.json index e0851d5..d94dd93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.22.4", + "version": "4.22.5", "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": [ From 8b6a8281cfe0e56e29813bd3cf7e2a5c2ad42ab7 Mon Sep 17 00:00:00 2001 From: Koushik Ayila Date: Mon, 11 Oct 2021 13:23:53 +0530 Subject: [PATCH 2/5] Update call.js --- lib/resources/call.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/resources/call.js b/lib/resources/call.js index 27e6983..b4c1944 100644 --- a/lib/resources/call.js +++ b/lib/resources/call.js @@ -998,7 +998,7 @@ class QueuedCallInterface extends PlivoResourceInterface { } client('GET', action + id, { - isVoiceRequest: 'true', status: 'live' + isVoiceRequest: 'true', status: 'queued' }) .then(response => { resolve(new GetQueuedCallResponse(response.body, client)); @@ -1016,7 +1016,7 @@ class QueuedCallInterface extends PlivoResourceInterface { return new Promise((resolve, reject) => { client('GET', action, { - isVoiceRequest: 'true', status: 'live' + isVoiceRequest: 'true', status: 'queued' }) .then(response => { let calls = []; From 00728155419c8cb50244dfd05bf1f614b4eeb1ee Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Tue, 12 Oct 2021 16:48:59 +0530 Subject: [PATCH 3/5] buy number api --- lib/resources/numbers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/resources/numbers.js b/lib/resources/numbers.js index b275123..c245009 100644 --- a/lib/resources/numbers.js +++ b/lib/resources/numbers.js @@ -80,10 +80,10 @@ export class PhoneNumber extends PlivoResource { * @promise {@link PlivoGenericResponse} return PlivoGenericResponse Object if success * @fail {Error} return Error */ - buy(appId) { + buy(number,appId) { return new PhoneNumberInterface(this[clientKey], { id: this.id - }).buy(appId); + }).buy(number,appId); } } From 7867654c78993d5d0793af8587f806d7d3c7264b Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Tue, 12 Oct 2021 21:53:29 +0530 Subject: [PATCH 4/5] updated changelog & bump verison --- CHANGELOG.md | 11 +++++++++-- package.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9676581..927f26a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ # Change Log -## [v4.22.5](https://github.com/plivo/plivo-node/tree/v4.22.5) (2021-10-11) +## [v4.23.1](https://github.com/plivo/plivo-node/tree/v4.23.1) (2021-10-13) **Bug Fix** - - LiveCallInterface + - LiveCallInterface. + - [Buy Number API](https://www.plivo.com/docs/numbers/api/phone-number#buy-a-phone-number) to support app_id + +## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-10-11) +**Features - Messaging** +- This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. + + Example for [send SMS](https://github.com/plivo/plivo-node#send-a-message) ## [v4.22.4](https://github.com/plivo/plivo-node/tree/v4.22.4) (2021-09-27) **Bug Fix** diff --git a/package.json b/package.json index d94dd93..0fdfbf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.22.5", + "version": "4.23.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": [ From 4b1212138abc093b08681fc1f951e97f8fac4f7a Mon Sep 17 00:00:00 2001 From: Koushik-Ayila Date: Wed, 13 Oct 2021 11:45:53 +0530 Subject: [PATCH 5/5] Resolved UTs --- lib/rest/request-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rest/request-test.js b/lib/rest/request-test.js index abd32ec..3f0abe0 100644 --- a/lib/rest/request-test.js +++ b/lib/rest/request-test.js @@ -36,7 +36,7 @@ export function Request(config) { return new Promise((resolve, reject) => { // LiveCall - needs to be at top - if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2/?status=live') { + if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2' && params['status'] === 'live') { resolve({ response: {}, body: { @@ -52,7 +52,7 @@ export function Request(config) { }); } - else if (method === 'GET' && action === 'Call/?status=live') { + else if (method === 'GET' && action === 'Call/' && params['status'] === 'live') { resolve({ response: {}, body: {