mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-04 22:07:01 -06:00
Merge pull request #206 from plivo/powerpack-fix
Fix: add number to powerpack
This commit is contained in:
commit
a8df96ebe8
3 changed files with 6 additions and 43 deletions
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue