diff --git a/CHANGELOG.md b/CHANGELOG.md index d7cc6b8c..bf298a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [v4.22.0](https://github.com/plivo/plivo-node/tree/v4.22.0) (2021-08-17) +- Fix [add numbers to a powerpack](https://www.plivo.com/docs/sms/api/numberpool/#add-a-number) API by reverting retrievable object responses support for [Retrieve a Power pack API](https://www.plivo.com/docs/sms/api/powerpack#retrieve-a-powerpack). + ## [v4.21.0](https://github.com/plivo/plivo-node/tree/v4.21.0) (2021-08-05) - Fixed a Typescript warning about base interpretation. - Add retrievable object responses support for [Retrieve a Power pack API](https://www.plivo.com/docs/sms/api/powerpack#retrieve-a-powerpack). diff --git a/lib/resources/powerpacks.js b/lib/resources/powerpacks.js index c04149bb..2df1d4c9 100644 --- a/lib/resources/powerpacks.js +++ b/lib/resources/powerpacks.js @@ -40,22 +40,6 @@ export class CreatePowerpackResponse { } } -export class RetrievePowerpack { - constructor(params) { - params = params || {}; - this.apiId = params.apiId; - this.applicationId = params.applicationId; - this.applicationType = params.applicationType; - this.createdOn = params.createdOn; - this.localConnect = params.localConnect; - this.name = params.name; - this.numberPool = params.numberPool; - this.numberPriority = params.numberPriority; - this.stickySender = params.stickySender; - this.uuid = params.uuid; - } -} - export class UpdatePowerpackResponse { constructor(params) { params = params || {}; @@ -473,7 +457,6 @@ export class Powerpack extends PlivoResource { * @param {string} [params.sticky_sender] * @param {string} [params.local_connect] * @param {object} [params.number_priority] - * @promise {object} return {@link Powerpack} object * @fail {Error} return Error */ @@ -713,31 +696,8 @@ export class PowerpackInterface extends PlivoResourceInterface { * @fail {Error} return Error */ get(uuid) { - let errors = validate([{ - field: 'uuid', - value: uuid, - validators: ['isRequired'] - }]); - - if (errors) { - return errors; - } - - let client = this[clientKey]; - return new Promise((resolve, reject) => { - if (action !== '' && !uuid) { - reject(new Error(this[idKey] + ' must be set')); - } - client('GET', action + (uuid ? uuid + '/' : '')) - .then(response => { - resolve(new RetrievePowerpack(response.body, client)); - }) - .catch(error => { - reject(error); - }); - }); + return super.get(uuid); } - /** * create Powerpack * @method @@ -816,4 +776,4 @@ export class PowerpackInterface extends PlivoResourceInterface { list(params) { return super.list(params); } -} \ No newline at end of file +} diff --git a/package.json b/package.json index a471bda6..e76ea7e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.21.0", + "version": "4.22.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": [