From 0f119a8286cbccf03735b2ba47d20dc44de3af26 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Tue, 28 Feb 2023 18:57:33 +0530 Subject: [PATCH 01/15] added new params --- lib/resources/recordings.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/resources/recordings.js b/lib/resources/recordings.js index 91bf16c7..9c6917b0 100644 --- a/lib/resources/recordings.js +++ b/lib/resources/recordings.js @@ -29,6 +29,9 @@ export class RetrieveRecordingResponse { this.resourceUri = params.resourceUri; this.fromNumber = params.fromNumber; this.toNumber = params.toNumber; + this.cost = params.cost; + this.roundedDuration = params.roundedDuration; + this.daysOfStorage = params.daysOfStorage; } } @@ -52,6 +55,9 @@ export class ListRecordingResponse { this.mpcName = params.mpcName; this.conferenceUuid = params.conferenceUuid; this.mpcUuid = params.mpcUuid; + this.cost = params.cost; + this.roundedDuration = params.roundedDuration; + this.daysOfStorage = params.daysOfStorage; } } @@ -156,6 +162,7 @@ export class RecordingInterface extends PlivoResourceInterface { * @param {string} [params.addTime] - Filter based on the timings they were added * @param {string} [params.limit] - Display no of results per page * @param {string} [params.offset] - No of value items by which results should be offset + * @param {string} [params.roundedDuration] - Rounded duration of recording in seconds. valid values - multiples of 60 */ list(params = {}) { params.isVoiceRequest = 'true'; From 2497f51b5bacdc7d83e6143ddf233a7cbc71d8de Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Wed, 22 Feb 2023 22:01:06 +0530 Subject: [PATCH 02/15] SMS-4946/SMS-4848: adding new param 'is_domestic' in Get Message and List Message API --- lib/resources/messages.js | 2 ++ lib/rest/request-test.js | 12 ++++++++---- types/resources/messages.d.ts | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index e8d5da35..bdded738 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -49,6 +49,7 @@ export class MessageGetResponse { this.tendlcRegistrationStatus = params.tendlcRegistrationStatus; this.destinationCountryIso2 = params.destinationCountryIso2; this.requesterIP = params.requesterIp; + this.isDomestic = params.isDomestic; } } @@ -72,6 +73,7 @@ export class MessageListResponse { this.tendlcRegistrationStatus = params.tendlcRegistrationStatus; this.destinationCountryIso2 = params.destinationCountryIso2; this.requesterIP = params.requesterIp; + this.isDomestic = params.isDomestic; } } diff --git a/lib/rest/request-test.js b/lib/rest/request-test.js index bd61c565..5959a307 100644 --- a/lib/rest/request-test.js +++ b/lib/rest/request-test.js @@ -1696,7 +1696,8 @@ export function Request(config) { total_amount: '0.00000', total_rate: '0.00350', units: 1, - requester_ip: "192.168.1.1" + requester_ip: "192.168.1.1", + is_domestic: false } }); } @@ -1938,7 +1939,8 @@ export function Request(config) { total_amount: '0.00000', total_rate: '0.00350', units: 1, - requester_ip: '192.168.1.2' + requester_ip: '192.168.1.2', + is_domestic: false } }); } @@ -1967,7 +1969,8 @@ export function Request(config) { total_amount: '0.00000', total_rate: '0.00350', units: 1, - requester_ip: "192.168.1.1" + requester_ip: "192.168.1.1", + is_domestic: false }, { error_code: '200', @@ -1982,7 +1985,8 @@ export function Request(config) { total_amount: '0.00000', total_rate: '0.00350', units: 1, - requester_ip: "192.168.1.2" + requester_ip: "192.168.1.2", + is_domestic: false } ] } diff --git a/types/resources/messages.d.ts b/types/resources/messages.d.ts index 8910dc28..3eb29f1e 100644 --- a/types/resources/messages.d.ts +++ b/types/resources/messages.d.ts @@ -22,6 +22,7 @@ export class MessageGetResponse { units: string; powerpackId: string; requesterIp: string; + isDomestic: boolean; } export class MessageListResponse { constructor(params: object); @@ -39,6 +40,7 @@ export class MessageListResponse { units: string; powerpackId: string; requesterIp: string; + isDomestic: boolean; } export class MMSMediaResponse { constructor(params: object); From c9f66cdb811e801db23a3d539988712621c3ec78 Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Wed, 22 Feb 2023 22:12:59 +0530 Subject: [PATCH 03/15] updating version --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e87b6c0..90df7f7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ **Feature - Enhance MDR filtering capabilities ** - Added new fields on MDR object response +## [4.40.0](https://github.com/plivo/plivo-ruby/tree/v4.40.0) (2022-02-22) +**Adding new attribute - 'isDomestic' in Get Message and List Message APIs** +- Add `isDomestic` 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) + ## [4.39.0](https://github.com/plivo/plivo-node/tree/v4.39.0) (2022-01-25) **Feature - Added New Param(requesterIP) in Get Message and List Mssage APIs** - Add `requesterIP` 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) From a9a4bfeee70a91de8d68bd30b110c94500f253d8 Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Wed, 22 Feb 2023 22:12:59 +0530 Subject: [PATCH 04/15] Rebasing with master --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90df7f7f..ade2b46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ **Feature - Enhance MDR filtering capabilities ** - Added new fields on MDR object response -## [4.40.0](https://github.com/plivo/plivo-ruby/tree/v4.40.0) (2022-02-22) +## [4.40.0](https://github.com/plivo/plivo-node/tree/v4.40.0) (2022-02-22) **Adding new attribute - 'isDomestic' in Get Message and List Message APIs** - Add `isDomestic` 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) From 363561430cbbce3f613b6df8f997860d8281dbcc Mon Sep 17 00:00:00 2001 From: Saurabh Newatiya Date: Fri, 3 Mar 2023 15:57:55 +0530 Subject: [PATCH 05/15] version upgrade --- CHANGELOG.md | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ade2b46b..43e26595 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ # Change Log +## [4.41.0](https://github.com/plivo/plivo-node/tree/v4.41.0) (2023-03-03) +**Adding new attribute - 'isDomestic' in Get Message and List Message APIs** +- Add `isDomestic` 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) + ## [4.40.0](https://github.com/plivo/plivo-node/tree/v4.40.0) (2023-02-23) **Feature - Enhance MDR filtering capabilities ** - Added new fields on MDR object response -## [4.40.0](https://github.com/plivo/plivo-node/tree/v4.40.0) (2022-02-22) -**Adding new attribute - 'isDomestic' in Get Message and List Message APIs** -- Add `isDomestic` 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) - ## [4.39.0](https://github.com/plivo/plivo-node/tree/v4.39.0) (2022-01-25) **Feature - Added New Param(requesterIP) in Get Message and List Mssage APIs** - Add `requesterIP` 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) diff --git a/package.json b/package.json index b5271071..bda5c9b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.40.0", + "version": "4.41.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": [ From 022ad815ae655c25744aa461233a06e44af9fb3c Mon Sep 17 00:00:00 2001 From: narayana Date: Mon, 6 Mar 2023 20:11:31 +0530 Subject: [PATCH 06/15] jsonwebtoken upgrade --- .github/workflows/unitTests.yml | 2 +- lib/resources/messages.js | 5 ----- lib/rest/axios.js | 2 +- lib/rest/request-test.js | 4 ++-- package.json | 2 +- test/powerpacks.js | 6 +++--- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index 359998ae..25e583e9 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x] + node-version: [11.x, 12.x, 13.x, 14.x, 15.x, 16.x] steps: - uses: actions/checkout@v2 diff --git a/lib/resources/messages.js b/lib/resources/messages.js index bdded738..64e3ed71 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -212,11 +212,6 @@ export class MessageInterface extends PlivoResourceInterface { value: dst, validators: ['isRequired'] }, - { - field: 'text', - value: text, - validators: ['isRequired'] - }, ]); if (errors) { diff --git a/lib/rest/axios.js b/lib/rest/axios.js index 99502844..14a35f32 100644 --- a/lib/rest/axios.js +++ b/lib/rest/axios.js @@ -21,7 +21,7 @@ export function Axios(config) { let counter = 0; axios.interceptors.response.use(null, (error) => { const config = error.config; - if (counter < max_time && error.response.status >= 500) { + if (counter < max_time && error.response && error.response.status >= 500) { counter++; config.url = options.urls[counter] + options.authId + '/' + options.action; return new Promise((resolve) => { diff --git a/lib/rest/request-test.js b/lib/rest/request-test.js index 5959a307..461481b9 100644 --- a/lib/rest/request-test.js +++ b/lib/rest/request-test.js @@ -1785,14 +1785,14 @@ export function Request(config) { } }); } - else if (action=='NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Shortcode/4444444/' && method == 'GET'){ + else if (action=='NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Shortcode/444444/' && method == 'GET'){ resolve({ response: {}, body: { added_on: '2019-09-03T08:50:09.578928Z', country_iso2: 'CA', number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099', - shortcode: '444444' + shortCode: '444444' } }); } diff --git a/package.json b/package.json index bda5c9b3..082f2ce1 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "https-proxy-agent": "^5.0.0", "build-url": "^1.0.10", "form-data": "^4.0.0", - "jsonwebtoken": "^8.5.1", + "jsonwebtoken": "^9.0.0", "lodash": "^4.17.4", "querystring": "^0.2.0", "uri-parser": "^1.0.0", diff --git a/test/powerpacks.js b/test/powerpacks.js index 949b71ee..dae4ae80 100644 --- a/test/powerpacks.js +++ b/test/powerpacks.js @@ -62,15 +62,15 @@ describe('PowerpackInterface', function () { it('find shortcode via interface', function () { client.powerpacks.get("5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46").then( function (powerpack) { - return powerpack.find_shortcode('4444444') + return powerpack.find_shortcode('444444') }).then(function (ppk) { - assert.equal(ppk.shortcode, "4444444") + assert.equal(ppk.shortCode, "444444") }); }); it('list shortcode via interface', function () { client.powerpacks.get("5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46").then( function (powerpack) { - return powerpack.list_shortcodes('4444444') + return powerpack.list_shortcodes('444444') }) .then(function (result) { assert.notEqual(result.length, 0) From 634b2d9dff22564fb5567a6fbb4194c17c27ac47 Mon Sep 17 00:00:00 2001 From: narayana Date: Tue, 7 Mar 2023 11:56:50 +0530 Subject: [PATCH 07/15] version upgrade --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e26595..4f0c9670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Change Log +## [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). +- Fix code breaking due to undefined error.response while accessing response `status` property. + ## [4.41.0](https://github.com/plivo/plivo-node/tree/v4.41.0) (2023-03-03) **Adding new attribute - 'isDomestic' in Get Message and List Message APIs** - Add `isDomestic` 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) diff --git a/package.json b/package.json index 082f2ce1..6cdbb830 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.41.0", + "version": "4.42.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": [ From f8db3439cf3b893c611e1d2eeeb2cdf4aca20164 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Tue, 28 Feb 2023 18:57:33 +0530 Subject: [PATCH 08/15] added new params --- lib/resources/recordings.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/resources/recordings.js b/lib/resources/recordings.js index 91bf16c7..9c6917b0 100644 --- a/lib/resources/recordings.js +++ b/lib/resources/recordings.js @@ -29,6 +29,9 @@ export class RetrieveRecordingResponse { this.resourceUri = params.resourceUri; this.fromNumber = params.fromNumber; this.toNumber = params.toNumber; + this.cost = params.cost; + this.roundedDuration = params.roundedDuration; + this.daysOfStorage = params.daysOfStorage; } } @@ -52,6 +55,9 @@ export class ListRecordingResponse { this.mpcName = params.mpcName; this.conferenceUuid = params.conferenceUuid; this.mpcUuid = params.mpcUuid; + this.cost = params.cost; + this.roundedDuration = params.roundedDuration; + this.daysOfStorage = params.daysOfStorage; } } @@ -156,6 +162,7 @@ export class RecordingInterface extends PlivoResourceInterface { * @param {string} [params.addTime] - Filter based on the timings they were added * @param {string} [params.limit] - Display no of results per page * @param {string} [params.offset] - No of value items by which results should be offset + * @param {string} [params.roundedDuration] - Rounded duration of recording in seconds. valid values - multiples of 60 */ list(params = {}) { params.isVoiceRequest = 'true'; From 0e5ebf65ca127a88169de395c037f36f1062e7e2 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 8 Mar 2023 16:48:27 +0530 Subject: [PATCH 09/15] changed version --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f0c9670..9882f6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Change Log +## [4.42.1](https://github.com/plivo/plivo-java/tree/v4.42.1) (2023-03-08) +**Feature - Parameters added to Recordings API** +- Added `cost`, `roundedDuration`, and `daysOfStorage` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) +- Added `roundedDuration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) + ## [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). diff --git a/package.json b/package.json index 6cdbb830..728882d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.42.0", + "version": "4.42.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 9ced4747411822264d0a9e0748869a522acd71e0 Mon Sep 17 00:00:00 2001 From: kalyan-plivo Date: Mon, 13 Mar 2023 20:39:45 +0530 Subject: [PATCH 10/15] handling the new status code for HM --- CHANGELOG.md | 4 ++++ lib/resources/hostedMessagingNumber.js | 1 - lib/rest/axios.js | 6 ++++++ lib/utils/exceptions.js | 1 + package.json | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f0c9670..72549109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [4.43.0](https://github.com/plivo/plivo-node/tree/v4.43.0) (2023-03-13) +**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). diff --git a/lib/resources/hostedMessagingNumber.js b/lib/resources/hostedMessagingNumber.js index 086e5865..b163a52b 100644 --- a/lib/resources/hostedMessagingNumber.js +++ b/lib/resources/hostedMessagingNumber.js @@ -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); diff --git a/lib/rest/axios.js b/lib/rest/axios.js index 14a35f32..d4c559c4 100644 --- a/lib/rest/axios.js +++ b/lib/rest/axios.js @@ -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; @@ -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)) { @@ -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; @@ -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)) { @@ -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; @@ -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)) { diff --git a/lib/utils/exceptions.js b/lib/utils/exceptions.js index 9d72ae07..caa0bcda 100644 --- a/lib/utils/exceptions.js +++ b/lib/utils/exceptions.js @@ -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 { } \ No newline at end of file diff --git a/package.json b/package.json index 6cdbb830..fb2e275d 100644 --- a/package.json +++ b/package.json @@ -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": [ From a3077c2f52e894f052171ac44d797b1ae6b0fb6f Mon Sep 17 00:00:00 2001 From: kalyan-plivo Date: Tue, 14 Mar 2023 10:41:38 +0530 Subject: [PATCH 11/15] changed the date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72549109..b7a387d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Change Log -## [4.43.0](https://github.com/plivo/plivo-node/tree/v4.43.0) (2023-03-13) +## [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. From 93a75b18ba76c79bad0f9b232a7ed7f382b7693b Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Thu, 9 Mar 2023 13:43:47 +0530 Subject: [PATCH 12/15] local docker enhancement --- Dockerfile | 2 +- Makefile | 11 +++++++++-- README.md | 9 +++++++-- setup_sdk.sh | 18 +++++++++++------- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index d938868b..ecb321ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 WORKDIR /usr/src/app -RUN apt-get update && apt-get install -y wget git vim +RUN apt-get update && apt-get install -y wget git vim make # Install node using nvm RUN mkdir -p /usr/src/.nvm diff --git a/Makefile b/Makefile index 9fe8b1a2..e3a0eb54 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,14 @@ -.PHONY: build test +.PHONY: build test run build: docker-compose up --build --remove-orphans test: - docker exec -it $$CONTAINER /bin/bash -c "npm install request --no-save && npm test" \ No newline at end of file + @[ "${CONTAINER}" ] && \ + (docker exec -it $$CONTAINER /bin/bash -c "npm install request --no-save && npm test") || \ + (npm install request --no-save && npm test) + +run: + @[ "${CONTAINER}" ] && \ + (docker exec -it $$CONTAINER /bin/bash -c 'cd /usr/src/app/node-sdk-test/ && node test.js') || \ + (cd /usr/src/app/node-sdk-test/ && node test.js) \ No newline at end of file diff --git a/README.md b/README.md index 18ee628e..103a94ac 100644 --- a/README.md +++ b/README.md @@ -147,5 +147,10 @@ export PLIVO_API_PROD_HOST= 5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container. However, when any change is made, the dependencies for the test program need to be re-installed. To do that: * Either restart the docker container * Or Run the `setup_sdk.sh` script -6. To run unit tests, run `make test CONTAINER=` in host, where `` is the docker container id created in 2. -(The docker container should be running) \ No newline at end of file +6. To run test code, run `make run CONTAINER=` in host. +7. To run unit tests, run `make test CONTAINER=` in host. +> `` is the docker container id created in 2. +(The docker container should be running) + +> Test code and unit tests can also be run within the container using +`make run` and `make test` respectively. (`CONTAINER` argument should be omitted when running from the container) \ No newline at end of file diff --git a/setup_sdk.sh b/setup_sdk.sh index a1dd08d7..67868d69 100755 --- a/setup_sdk.sh +++ b/setup_sdk.sh @@ -39,13 +39,17 @@ npm init -y npm install $package rm $package -echo -e "\n\nSDK setup complete!" -echo "To test your changes:" -echo -e "\t1. Add your test code in /$testDir/test.js on host (or /usr/src/app/$testDir/test.js in the container)" -echo -e "\t2. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC" -echo -e "\t3. Navigate to the test directory: $GREEN cd /usr/src/app/$testDir$NC" -echo -e "\t4. Run your test file: $GREEN node test.js$NC" -echo -e "\t5. For running unit tests, run on host: $GREEN make test CONTAINER=$HOSTNAME$NC" +echo -e "\n\nSDK setup complete! You can test changes either on host or inside the docker container:" +echo -e "\ta. To test your changes ON HOST:" +echo -e "\t\t1. Add your test code in /$testDir/test.js" +echo -e "\t\t2. Run your test file using: $GREEN make run CONTAINER=$HOSTNAME$NC" +echo -e "\t\t3. Run unit tests using: $GREEN make test CONTAINER=$HOSTNAME$NC" +echo +echo -e "\tb. To test your changes INSIDE CONTAINER:" +echo -e "\t\t1. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC" +echo -e "\t\t2. Add your test code in /usr/src/app/$testDir/test.js" +echo -e "\t\t3. Run your test file using: $GREEN make run$NC" +echo -e "\t\t4. Run unit tests using: $GREEN make test$NC" # To keep the container running post setup /bin/bash \ No newline at end of file From 1551d515d7e3561ba7a7d7d29ec96aaf04f74f64 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Tue, 28 Feb 2023 18:57:33 +0530 Subject: [PATCH 13/15] added new params --- lib/resources/recordings.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/resources/recordings.js b/lib/resources/recordings.js index 91bf16c7..9c6917b0 100644 --- a/lib/resources/recordings.js +++ b/lib/resources/recordings.js @@ -29,6 +29,9 @@ export class RetrieveRecordingResponse { this.resourceUri = params.resourceUri; this.fromNumber = params.fromNumber; this.toNumber = params.toNumber; + this.cost = params.cost; + this.roundedDuration = params.roundedDuration; + this.daysOfStorage = params.daysOfStorage; } } @@ -52,6 +55,9 @@ export class ListRecordingResponse { this.mpcName = params.mpcName; this.conferenceUuid = params.conferenceUuid; this.mpcUuid = params.mpcUuid; + this.cost = params.cost; + this.roundedDuration = params.roundedDuration; + this.daysOfStorage = params.daysOfStorage; } } @@ -156,6 +162,7 @@ export class RecordingInterface extends PlivoResourceInterface { * @param {string} [params.addTime] - Filter based on the timings they were added * @param {string} [params.limit] - Display no of results per page * @param {string} [params.offset] - No of value items by which results should be offset + * @param {string} [params.roundedDuration] - Rounded duration of recording in seconds. valid values - multiples of 60 */ list(params = {}) { params.isVoiceRequest = 'true'; From dd0dab9509d8df3a0b76c23923cb1b06dd1715d8 Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 8 Mar 2023 16:48:27 +0530 Subject: [PATCH 14/15] changed version merged from master --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a387d4..d81c9108 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [4.43.1](https://github.com/plivo/plivo-node/tree/v4.43.1) (2023-04-04) +- Added `monthly_recording_storage_amount`, `recording_storage_rate`, `rounded_recording_duration`, and `recording_storage_duration` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) +- Added `recording_storage_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) + ## [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. diff --git a/package.json b/package.json index fb2e275d..53f51f55 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.43.0", + "version": "4.43.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 8026fb3a082c902619c2e27d33a2c0b0e31c751d Mon Sep 17 00:00:00 2001 From: "anindya.mahajan" Date: Wed, 5 Apr 2023 16:37:50 +0530 Subject: [PATCH 15/15] added params and filter --- lib/resources/recordings.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/resources/recordings.js b/lib/resources/recordings.js index 9c6917b0..0e26b73c 100644 --- a/lib/resources/recordings.js +++ b/lib/resources/recordings.js @@ -29,9 +29,10 @@ export class RetrieveRecordingResponse { this.resourceUri = params.resourceUri; this.fromNumber = params.fromNumber; this.toNumber = params.toNumber; - this.cost = params.cost; - this.roundedDuration = params.roundedDuration; - this.daysOfStorage = params.daysOfStorage; + this.monthlyRecordingStorageAmount = params.monthlyRecordingStorageAmount; + this.roundedRecordingDuration = params.roundedRecordingDuration; + this.recordingStorageDuration = params.recordingStorageDuration; + this.recordingStorageRate = params.recordingStorageRate; } } @@ -55,9 +56,10 @@ export class ListRecordingResponse { this.mpcName = params.mpcName; this.conferenceUuid = params.conferenceUuid; this.mpcUuid = params.mpcUuid; - this.cost = params.cost; - this.roundedDuration = params.roundedDuration; - this.daysOfStorage = params.daysOfStorage; + this.monthlyRecordingStorageAmount = params.monthlyRecordingStorageAmount; + this.roundedRecordingDuration = params.roundedRecordingDuration; + this.recordingStorageDuration = params.recordingStorageDuration; + this.recordingStorageRate = params.recordingStorageRate; } } @@ -162,7 +164,7 @@ export class RecordingInterface extends PlivoResourceInterface { * @param {string} [params.addTime] - Filter based on the timings they were added * @param {string} [params.limit] - Display no of results per page * @param {string} [params.offset] - No of value items by which results should be offset - * @param {string} [params.roundedDuration] - Rounded duration of recording in seconds. valid values - multiples of 60 + * @param {string} [params.recordingStorageDuration] - Filter based on how old the recordings are */ list(params = {}) { params.isVoiceRequest = 'true';