Skip to content

Commit

Permalink
Merge pull request #186 from plivo/fix-adaptive-ppk
Browse files Browse the repository at this point in the history
Fix add/update powerpack for number_priority
  • Loading branch information
huzaif-plivo authored May 6, 2021
2 parents 65a8989 + eab2cdd commit 54445ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log

## [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

## [4.17.0](https://github.com/plivo/plivo-node/releases/tag/v4.17.0)(2021-05-04)
- Update library: Axios
- Add Exception Support
- Updated README

Expand Down
7 changes: 5 additions & 2 deletions lib/resources/powerpacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class UpdatePowerpackResponse {
this.name = params.name;
this.numberPool = params.numberPool;
this.stickySender = params.stickySender;
this.numberPriority = params.numberPriority;
this.uuid = params.uuid;
}
}
Expand Down Expand Up @@ -455,7 +456,7 @@ export class Powerpack extends PlivoResource {
* @param {string} [params.application_id]
* @param {string} [params.sticky_sender]
* @param {string} [params.local_connect]
* @param {list} [params.number_priority]
* @param {object} [params.number_priority]
* @promise {object} return {@link Powerpack} object
* @fail {Error} return Error
Expand All @@ -465,7 +466,7 @@ export class Powerpack extends PlivoResource {
//return super.customexecuteAction(path.toString().trim(), 'POST', params);
let client = this[clientKey];
return new Promise((resolve, reject) => {
client('GET', path.toString().trim(), params)
client('POST', path.toString().trim(), params)
.then(response => {
resolve(new UpdatePowerpackResponse(response.body, idField));
})
Expand Down Expand Up @@ -707,6 +708,7 @@ export class PowerpackInterface extends PlivoResourceInterface {
* @param {string} [params.local_connect]
* @param {string} [params.application_type]
* @param {string} [params.application_id]
* @param {object} [params.number_priority]
* @promise {object} return {@link PlivoGenericResponse} object
* @fail {Error} return Error
*/
Expand Down Expand Up @@ -746,6 +748,7 @@ export class PowerpackInterface extends PlivoResourceInterface {
* @param {string} [params.local_connect]
* @param {string} [params.application_type]
* @param {string} [params.application_id]
* @param {object} [params.number_priority]
* @promise {object} return {@link Powerpack} object
* @fail {Error} return Error
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/rest/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export function camelCaseRequestWrapper(requestFunc) {
.replace('_less_or_equal', '__lte')
.replace('_equal', '')
.replace('_equals', '')
.replace('priority_1', 'priority1')
.replace('priority_2', 'priority2')
.replace('priority_3', 'priority3')
.replace('country_iso_2', 'country_iso2');
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plivo",
"version": "4.17.0",
"version": "4.17.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": [
Expand Down

0 comments on commit 54445ce

Please sign in to comment.