Skip to content

Commit

Permalink
Merge branch 'master' into sp-brand
Browse files Browse the repository at this point in the history
  • Loading branch information
narayana-plivo authored Sep 21, 2023
2 parents f9a2f2b + 9688457 commit a64aba7
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 12 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
# Change Log


## [v4.57.0](https://github.com/plivo/plivo-node/tree/v4.57.0) (2023-09-21)
**Support starter brand**
- OTP validation
- starter brand creation

## [v4.56.2](https://github.com/plivo/plivo-node/tree/v4.56.2) (2023-09-01)
**Bug fix - Unable to build TypeScript on Version 4.56.0**
- Fix TypeScript build error

## [v4.56.1](https://github.com/plivo/plivo-node/tree/v4.56.1) (2023-09-01)
**Bug Fix - unrent powerpack number**
- Fix for Error: invalid powerpack number delete request (400) - Unrent Powerpack Number

## [v4.56.0](https://github.com/plivo/plivo-node/tree/v4.56.0) (2023-08-25)
**Feature - Added New Param 'carrier_fees', 'carrier_fees_rate', 'destination_network' in Get Message and List Message APIs**
- Added new params on message get and list response


## [v4.55.0](https://github.com/plivo/plivo-node/tree/v4.55.0) (2023-08-10)
**Verify Service API's**
- Create Session API - To initiate a session
Expand Down
7 changes: 6 additions & 1 deletion lib/resources/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export class MessageGetResponse {
this.dltEntityID = params.dltEntityId;
this.dltTemplateID = params.dltTemplateId;
this.dltTemplateCategory = params.dltTemplateCategory;

this.destinationNetwork = params.destinationNetwork;
this.carrierFees = params.carrierFees;
this.carrierFeesRate = params.carrierFeesRate;
}
}

Expand Down Expand Up @@ -91,6 +93,9 @@ export class MessageListResponse {
this.dltEntityID = params.dltEntityId;
this.dltTemplateID = params.dltTemplateId;
this.dltTemplateCategory = params.dltTemplateCategory;
this.destinationNetwork = params.destinationNetwork;
this.carrierFees = params.carrierFees;
this.carrierFeesRate = params.carrierFeesRate;
}
}

Expand Down
8 changes: 3 additions & 5 deletions lib/resources/powerpacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class Powerpack extends PlivoResource {

remove_number(number, unrent = false) {
var params = {};
params['unrent'] = unrent.toString();
params['unrent'] = unrent;
let path = 'NumberPool/' + this.number_pool_id + '/Number/' + number + '/';
let client = this[clientKey];
return new Promise((resolve, reject) => {
Expand All @@ -328,7 +328,7 @@ export class Powerpack extends PlivoResource {
}
remove_tollfree(tollfree, unrent = false) {
var params = {};
params['unrent'] = unrent.toString();
params['unrent'] = unrent;
let path = 'NumberPool/' + this.number_pool_id + '/Tollfree/' + tollfree + '/';
let client = this[clientKey];
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -483,9 +483,7 @@ export class Powerpack extends PlivoResource {
*/
delete(unrent_numbers = false) {
let params = {};
if (typeof unrent_numbers === 'boolean') {
params.unrent_numbers = unrent_numbers.toString();
}
params.unrent_numbers = unrent_numbers;
let path = 'Powerpack/' + this.uuid + '/';
return super.customexecuteAction(path.toString().trim(), 'DELETE', params);
}
Expand Down
15 changes: 12 additions & 3 deletions lib/rest/request-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,10 @@ export function Request(config) {
dlt_template_category: "transactional",
conversation_id: "1234",
conversation_origin: "service",
conversation_expiration_timestamp: "2023-08-03 23:02:00+05:30"
conversation_expiration_timestamp: "2023-08-03 23:02:00+05:30",
destination_network: "Verizon",
carrier_fees_rate: "0.420",
carrier_fees: "0.001"
}
});
}
Expand Down Expand Up @@ -2216,7 +2219,10 @@ export function Request(config) {
dlt_template_category: "service_implicit",
conversation_id: "9876",
conversation_origin: "marketing",
conversation_expiration_timestamp: "2023-08-03 23:02:00+05:30"
conversation_expiration_timestamp: "2023-08-03 23:02:00+05:30",
destination_network: "Verizon",
carrier_fees_rate: "0.420",
carrier_fees: "0.001"

},
{
Expand All @@ -2239,7 +2245,10 @@ export function Request(config) {
dlt_template_category: null,
conversation_id: null,
conversation_origin: null,
conversation_expiration_timestamp: null
conversation_expiration_timestamp: null,
destination_network: "Verizon",
carrier_fees_rate: "0.420",
carrier_fees: "0.001"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ describe('message', function () {
assert.equal(message.conversationExpirationTimestamp, "2023-08-03 23:02:00+05:30");
})
});
it('should have destination network parameter in get message', function () {
return client.messages.get(1)
.then(function (message) {
assert.equal(message.destinationNetwork, "Verizon");
})
});
it('list messages', function () {
return client.messages.list()
.then(function (messages) {
Expand Down
8 changes: 6 additions & 2 deletions types/resources/maskingSession.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class MaskingSessionInterface extends PlivoResourceInterface {
* @returns {Promise<PlivoGenericResponse>} - Resolves to a PlivoGenericResponse object
* @throws {Error} - Throws an error if the list masking sessions request fails
*/
listMaskingSession(params ? : {}): Promise < ListMaskingSessionResponse > ;
listMaskingSession(params ? : {}): Promise < ListMaskingSessionResponse > ;

/**
* Get a masking session
Expand All @@ -159,4 +159,8 @@ export class MaskingSessionInterface extends PlivoResourceInterface {
* @fail {Error} returns Error
*/
deleteMaskingSession(sessionUuid: string): Promise < DeleteMaskingSessionResponse > ;
}
}
import {
PlivoResource,
PlivoResourceInterface
} from "../base";

0 comments on commit a64aba7

Please sign in to comment.