diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c64fd8..588f41a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.11][] + +* FIXED: `application:delete` was returning a null response and throwing a validation error. +* FIXED: `application:numbers` example was missing the required `app_id` parameter. + + ## [0.3.10][] * FIXED: `number:update` had been duplicated resulting in multiple executions per `number:update` command. One version has now been renamed to `numbers:update`. diff --git a/README.md b/README.md index 6c3e436..bbc66bb 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,10 @@ Alias: `nexmo au`. #### Delete an application +Parameters: + +- `app_id` - the UUID of your application. + ``` > nexmo app:delete asdasdas-asdd-2344-2344-asdasdasd345 This is operation can not be reversed. @@ -441,6 +445,10 @@ Alias: `nexmo ad`. #### Show numbers for an application +Parameters: + +- `app_id` - the UUID of your application. + - Optional flags: - `--size` the amount of results to return @@ -452,7 +460,7 @@ Alias: `nexmo ad`. 44655555555 44555555555 -> nexmo app:numbers --verbose +> nexmo app:numbers asdasdas-asdd-2344-2344-asdasdasd345 --verbose Item 1-3 of 3 msisdn | country | type | features | voiceCallbackType | voiceCallbackValue | moHttpUrl | voiceStatusCallbackUrl diff --git a/package.json b/package.json index a84b89d..8071716 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nexmo-cli", - "version": "0.3.10", + "version": "0.3.11", "description": "Nexmo Command Line Interface", "main": "lib/request.js", "scripts": { @@ -49,6 +49,6 @@ "colors": "^1.1.2", "commander": "^2.9.0", "ini": "^1.3.4", - "nexmo": "^2.0.2" + "nexmo": "^2.1.1" } } diff --git a/src/validator.js b/src/validator.js index af33e65..607da59 100644 --- a/src/validator.js +++ b/src/validator.js @@ -10,9 +10,9 @@ class Validator { this.emitter.error(error.message); } else if (error && error.body && error.body['error-code']) { this.emitter.error(error.body['error-code-label']); - } else if (response['error-code'] && response['error-code'] !== '200') { + } else if (response && response['error-code'] && response['error-code'] !== '200') { this.emitter.error(response['error-code-label']); - } else if (response['status'] && response['status'] !== '0') { + } else if (response && response['status'] && response['status'] !== '0') { this.emitter.error(response['status_message']); } } diff --git a/tests/validator.js b/tests/validator.js index 02dd7a7..a4b551c 100644 --- a/tests/validator.js +++ b/tests/validator.js @@ -21,6 +21,13 @@ describe('Validator', () => { }); }); + describe('when no response is present', () => { + it('should fall through quietely', () => { + let validator = new Validator(new Emitter()); + expect(validator.response(null, null)).to.be.undefined; + }); + }); + describe('when errors are present', () => { describe('due to error objects', () => { it('should emit an error', sinon.test(function() {