Skip to content

Commit

Permalink
Merge pull request #290 from plivo/jsonwebtoken-upgrade
Browse files Browse the repository at this point in the history
SMS-5419: jsonwebtoken upgrade
  • Loading branch information
renoldthomas-plivo authored Mar 8, 2023
2 parents 2259f77 + 634b2d9 commit 15e7426
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 0 additions & 5 deletions lib/resources/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ export class MessageInterface extends PlivoResourceInterface {
value: dst,
validators: ['isRequired']
},
{
field: 'text',
value: text,
validators: ['isRequired']
},
]);

if (errors) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rest/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/rest/request-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions test/powerpacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 15e7426

Please sign in to comment.