Comparing version 1.0.0-beta-7 to 1.0.0
@@ -37,3 +37,3 @@ "use strict"; | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options); | ||
} | ||
@@ -88,2 +88,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9BY2NvdW50LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7OztBQUVBOzs7Ozs7OztJQUVNLE87Ozs7Ozs7OztBQVFKLG1CQUFZLFdBQVosRUFBdUM7QUFBQSxRQUFkLE9BQWMseURBQUosRUFBSTs7QUFBQTs7QUFDckMsU0FBSyxLQUFMLEdBQWEsV0FBYjtBQUNBLFNBQUssT0FBTCxHQUFlLE9BQWY7OztBQUdBLFNBQUssTUFBTCxHQUFjLEtBQUssT0FBTCxDQUFhLGFBQWIsbUJBQWQ7O0FBRUEsU0FBSyxNQUFMLENBQVksVUFBWixDQUF1QixLQUFLLEtBQUwsQ0FBVyxNQUFsQyxFQUEwQyxLQUFLLEtBQUwsQ0FBVyxTQUFyRCxFQUFnRSxLQUFLLE9BQUwsQ0FBYSxLQUE3RTtBQUNEOzs7Ozs7Ozs7bUNBS2M7QUFDYixXQUFLLE1BQUwsQ0FBWSxZQUFaLENBQXlCLEtBQXpCLENBQStCLEtBQUssTUFBcEMsRUFBNEMsU0FBNUM7QUFDRDs7Ozs7Ozs7cUNBS2dCO0FBQ2YsV0FBSyxNQUFMLENBQVksY0FBWixDQUEyQixLQUEzQixDQUFpQyxLQUFLLE1BQXRDLEVBQThDLFNBQTlDO0FBQ0Q7Ozs7Ozs7O3dDQUttQjtBQUNsQixXQUFLLE1BQUwsQ0FBWSxtQkFBWixDQUFnQyxLQUFoQyxDQUFzQyxLQUFLLE1BQTNDLEVBQW1ELFNBQW5EO0FBQ0Q7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VxuXG5leHBvcnQgZGVmYXVsdCBBY2NvdW50O1xuIl19 |
@@ -39,3 +39,3 @@ "use strict"; | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options); | ||
} | ||
@@ -94,2 +94,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9BcHAuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7SUFFTSxHOzs7Ozs7Ozs7QUFRSixlQUFZLFdBQVosRUFBdUM7QUFBQSxRQUFkLE9BQWMseURBQUosRUFBSTs7QUFBQTs7QUFDckMsU0FBSyxLQUFMLEdBQWEsV0FBYjtBQUNBLFNBQUssT0FBTCxHQUFlLE9BQWY7OztBQUdBLFNBQUssTUFBTCxHQUFjLEtBQUssT0FBTCxDQUFhLGFBQWIsbUJBQWQ7O0FBRUEsU0FBSyxNQUFMLENBQVksVUFBWixDQUF1QixLQUFLLEtBQUwsQ0FBVyxNQUFsQyxFQUEwQyxLQUFLLEtBQUwsQ0FBVyxTQUFyRCxFQUFnRSxLQUFLLE9BQUwsQ0FBYSxLQUE3RTtBQUNEOzs7Ozs7Ozs7NkJBS1E7QUFDUCxXQUFLLE1BQUwsQ0FBWSxpQkFBWixDQUE4QixLQUE5QixDQUFvQyxLQUFLLE1BQXpDLEVBQWlELFNBQWpEO0FBQ0Q7Ozs7Ozs7O3dCQUtHLEssRUFBTztBQUNULFVBQUcsUUFBTyxLQUFQLHlDQUFPLEtBQVAsT0FBa0IsUUFBckIsRUFBK0I7QUFDN0IsYUFBSyxNQUFMLENBQVksY0FBWixDQUEyQixLQUEzQixDQUFpQyxLQUFLLE1BQXRDLEVBQThDLFNBQTlDO0FBQ0QsT0FGRCxNQUdLO0FBQ0gsYUFBSy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cGVvZihhcHBJZCkgIT09ICdvYmplY3QnKSB7XG4gICAgICB0aGlzLl9uZXhtby5nZXRBcHBsaWNhdGlvbi5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICB0aGlzLl9uZXhtby5nZXRBcHBsaWNhdGlvbnMuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gICAgfVxuICB9XG4gIFxuICAvKipcbiAgICogVE9ETzogZG9jdW1lbnRcbiAgICovXG4gIHVwZGF0ZSgpIHtcbiAgICB0aGlzLl9uZXhtby51cGRhdGVBcHBsaWNhdGlvbi5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBkZWxldGUoKSB7XG4gICAgdGhpcy5fbmV4bW8uZGVsZXRlQXBwbGljYXRpb24uYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgXG59XG5cbmV4cG9ydCBkZWZhdWx0IEFwcDtcbiJdfQ== |
@@ -9,2 +9,12 @@ "use strict"; | ||
var _fs = require('fs'); | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _JwtGenerator = require('./JwtGenerator'); | ||
var _JwtGenerator2 = _interopRequireDefault(_JwtGenerator); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -16,6 +26,12 @@ | ||
* The `Credentials` object provides an abstraction to this. | ||
* | ||
* @param {string} apiKey - A Nexmo API Key | ||
* @param {string} apiSecret - A Nexmo API Secret | ||
* @param {string|Buffer} [privateKey] - When a string value is passed it should | ||
* represent the path to the private key. If a Buffer is | ||
* passed then it should be the key read from the file system. | ||
*/ | ||
var Credentials = function () { | ||
function Credentials(apiKey, apiSecret) { | ||
function Credentials(apiKey, apiSecret, privateKey, applicationId) { | ||
_classCallCheck(this, Credentials); | ||
@@ -25,13 +41,59 @@ | ||
this.apiSecret = apiSecret; | ||
this.privateKey = null; | ||
this.applicationId = applicationId; | ||
if (privateKey instanceof Buffer) { | ||
this.privateKey = privateKey; | ||
} else if (privateKey !== undefined) { | ||
if (!_fs2.default.existsSync(privateKey)) { | ||
throw new Error('File "' + privateKey + '" not found.'); | ||
} | ||
this.privateKey = _fs2.default.readFileSync(privateKey); | ||
} | ||
/** @private */ | ||
this._jwtGenerator = new _JwtGenerator2.default(); | ||
} | ||
/** | ||
* Ensures a credentials instance is used. | ||
* | ||
* Key/Secret credentials are only supported at present. | ||
* Generate a Jwt using the Private Key in the Credentials. | ||
* By default the credentials.applicationId will be used when creating the token. | ||
* However, this can be overwritten. | ||
* | ||
* @param {string} [applicationId] an application ID to be used instead of the | ||
* default Credentials.applicationId value. | ||
* | ||
* @returns {string} The generated JWT | ||
*/ | ||
_createClass(Credentials, null, [{ | ||
key: "parse", | ||
_createClass(Credentials, [{ | ||
key: 'generateJwt', | ||
value: function generateJwt() { | ||
var applicationId = arguments.length <= 0 || arguments[0] === undefined ? this.applicationId : arguments[0]; | ||
var token = this._jwtGenerator.generate(this.privateKey, applicationId); | ||
return token; | ||
} | ||
/** | ||
* @private | ||
* Used for testing purposes only. | ||
*/ | ||
}, { | ||
key: '_setJwtGenerator', | ||
value: function _setJwtGenerator(generator) { | ||
this._jwtGenerator = generator; | ||
} | ||
/** | ||
* Ensures a credentials instance is used. | ||
* | ||
* Key/Secret credentials are only supported at present. | ||
*/ | ||
}], [{ | ||
key: 'parse', | ||
value: function parse(obj) { | ||
@@ -41,3 +103,3 @@ if (obj instanceof Credentials) { | ||
} else { | ||
return new Credentials(obj.apiKey, obj.apiSecret); | ||
return new Credentials(obj.apiKey, obj.apiSecret, obj.privateKey, obj.applicationId); | ||
} | ||
@@ -52,2 +114,2 @@ } | ||
module.exports = exports['default']; | ||
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vcjtcbiAgfVxuICBcbiAgLyoqXG4gICAqIEVuc3VyZXMgYSBjcmVkZW50aWFscyBpbnN0YW5jZSBpcyB1c2VkLlxuICAgKiBcbiAgICogS2V5L1NlY3JldCBjcmVkZW50aWFscyBhcmUgb25seSBzdXBwb3J0ZWQgYXQgcHJlc2VudC5cbiAgICovXG4gIHN0YXRpYyBwYXJzZShvYmopIHtcbiAgICBpZihvYmogaW5zdGFuY2VvZiBDcmVkZW50aWFscykge1xuICAgICAgcmV0dXJuIG9iajtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICByZXR1cm4gbmV3IENyZWRlbnRpYWxzKG9iai5hcGlLZXksIG9iai5hcGlTZWNyZXQsIG9iai5wcml2YXRlS2V5LCBvYmouYXBwbGljYXRpb25JZCk7XG4gICAgfVxuICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IENyZWRlbnRpYWxzO1xuIl19 |
@@ -36,3 +36,3 @@ "use strict"; | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options); | ||
} | ||
@@ -107,2 +107,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9NZXNzYWdlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7OztBQUVBOzs7Ozs7OztJQUVNLE87Ozs7Ozs7O0FBT0osbUJBQVksV0FBWixFQUF1QztBQUFBLFFBQWQsT0FBYyx5REFBSixFQUFJOztBQUFBOztBQUNyQyxTQUFLLEtBQUwsR0FBYSxXQUFiO0FBQ0EsU0FBSyxPQUFMLEdBQWUsT0FBZjs7O0FBR0EsU0FBSyxNQUFMLEdBQWMsS0FBSyxPQUFMLENBQWEsYUFBYixtQkFBZDs7QUFFQSxTQUFLLE1BQUwsQ0FBWSxVQUFaLENBQXVCLEtBQUssS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cnRjb2RlQWxlcnQoKSB7XG4gICAgdGhpcy5fbmV4bW8uc2hvcnRjb2RlQWxlcnQuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgXG4gIC8qKlxuICAgKiBUT0RPOiBkb2N1bWVudFxuICAgKi9cbiAgc2hvcnRjb2RlMkZBKCkge1xuICAgIHRoaXMuX25leG1vLnNob3J0Y29kZTJGQS5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBzaG9ydGNvZGVNYXJrZXRpbmcoKSB7XG4gICAgdGhpcy5fbmV4bW8uc2hvcnRjb2RlTWFya2V0aW5nLmFwcGx5KHRoaXMuX25leG1vLCBhcmd1bWVudHMpO1xuICB9XG4gIFxufVxuXG5leHBvcnQgZGVmYXVsdCBNZXNzYWdlO1xuIl19 |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _fs = require('fs'); | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _Credentials = require('./Credentials'); | ||
@@ -40,2 +44,18 @@ | ||
var _CallsResource = require('./CallsResource'); | ||
var _CallsResource2 = _interopRequireDefault(_CallsResource); | ||
var _HttpClient = require('./HttpClient'); | ||
var _HttpClient2 = _interopRequireDefault(_HttpClient); | ||
var _NullLogger = require('./NullLogger'); | ||
var _NullLogger2 = _interopRequireDefault(_NullLogger); | ||
var _ConsoleLogger = require('./ConsoleLogger'); | ||
var _ConsoleLogger2 = _interopRequireDefault(_ConsoleLogger); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -50,17 +70,51 @@ | ||
* @param {string} credentials.apiSecret - the Nexmo API secret | ||
* @param {object} options Additional options | ||
* @param {Object} options - Additional options | ||
* @param {boolean} options.debug - `true` to turn on debug logging | ||
* @param {Object} options.logger - Set a custom logger. | ||
* @param {string} options.appendToUserAgent - A value to append to the user agent. | ||
* The value will be prefixed with a `/` | ||
*/ | ||
function Nexmo(credentials, options) { | ||
function Nexmo(credentials) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? { debug: false } : arguments[1]; | ||
_classCallCheck(this, Nexmo); | ||
this._credentials = _Credentials2.default.parse(credentials); | ||
this._options = options; | ||
this.credentials = _Credentials2.default.parse(credentials); | ||
this.options = options; | ||
this.message = new _Message2.default(this._credentials, this._options); | ||
this.voice = new _Voice2.default(this._credentials, this._options); | ||
this.number = new _Number2.default(this._credentials, this._options); | ||
this.verify = new _Verify2.default(this._credentials, this._options); | ||
this.numberInsight = new _NumberInsight2.default(this._credentials, this._options); | ||
this.app = new _App2.default(this._credentials, this._options); | ||
this.account = new _Account2.default(this._credentials, this._options); | ||
// If no logger has been supplied but debug has been set | ||
// default to using the ConsoleLogger | ||
if (!this.options.logger && this.options.debug) { | ||
this.options.logger = new _ConsoleLogger2.default(); | ||
} else if (!this.options.logger) { | ||
// Swallow the logging | ||
this.options.logger = new _NullLogger2.default(); | ||
} | ||
var userAgent = 'nexmo-node/UNKNOWN/UNKNOWN'; | ||
try { | ||
var packageDetails = require(__dirname + '/../package.json'); | ||
userAgent = 'nexmo-node/' + packageDetails.version + '/' + process.version; | ||
} catch (e) { | ||
console.warn('Could not load package details'); | ||
} | ||
this.options.userAgent = userAgent; | ||
if (this.options.appendToUserAgent) { | ||
this.options.userAgent += '/' + this.options.appendToUserAgent; | ||
} | ||
this.options.httpClient = new _HttpClient2.default(this.options); | ||
this.message = new _Message2.default(this.credentials, this.options); | ||
this.voice = new _Voice2.default(this.credentials, this.options); | ||
this.number = new _Number2.default(this.credentials, this.options); | ||
this.verify = new _Verify2.default(this.credentials, this.options); | ||
this.numberInsight = new _NumberInsight2.default(this.credentials, this.options); | ||
this.applications = new _App2.default(this.credentials, this.options); | ||
this.account = new _Account2.default(this.credentials, this.options); | ||
this.calls = new _CallsResource2.default(this.credentials, this.options); | ||
/** | ||
* @deprecated Please use nexmo.applications | ||
*/ | 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0gbmV3IFZvaWNlKHRoaXMuY3JlZGVudGlhbHMsIHRoaXMub3B0aW9ucyk7XG4gICAgdGhpcy5udW1iZXIgPSBuZXcgTnVtYmVyKHRoaXMuY3JlZGVudGlhbHMsIHRoaXMub3B0aW9ucyk7XG4gICAgdGhpcy52ZXJpZnkgPSBuZXcgVmVyaWZ5KHRoaXMuY3JlZGVudGlhbHMsIHRoaXMub3B0aW9ucyk7XG4gICAgdGhpcy5udW1iZXJJbnNpZ2h0ID0gbmV3IE51bWJlckluc2lnaHQodGhpcy5jcmVkZW50aWFscywgdGhpcy5vcHRpb25zKTtcbiAgICB0aGlzLmFwcGxpY2F0aW9ucyA9IG5ldyBBcHAodGhpcy5jcmVkZW50aWFscywgdGhpcy5vcHRpb25zKTtcbiAgICB0aGlzLmFjY291bnQgPSBuZXcgQWNjb3VudCh0aGlzLmNyZWRlbnRpYWxzLCB0aGlzLm9wdGlvbnMpO1xuICAgIHRoaXMuY2FsbHMgPSBuZXcgQ2FsbHNSZXNvdXJjZSh0aGlzLmNyZWRlbnRpYWxzLCB0aGlzLm9wdGlvbnMpO1xuICAgIFxuICAgIC8qKlxuICAgICAqIEBkZXByZWNhdGVkIFBsZWFzZSB1c2UgbmV4bW8uYXBwbGljYXRpb25zXG4gICAgICovXG4gICAgdGhpcy5hcHAgPSB0aGlzLmFwcGxpY2F0aW9ucztcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBOZXhtbztcbiJdfQ== |
@@ -37,3 +37,3 @@ "use strict"; | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options); | ||
} | ||
@@ -118,2 +118,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9OdW1iZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7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25leG1vLmdldFByaWNpbmcuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgXG4gIC8qKlxuICAgKiBUT0RPOiBkb2N1bWVudFxuICAgKi9cbiAgZ2V0UGhvbmVQcmljaW5nKCkge1xuICAgIHRoaXMuX25leG1vLmdldFBob25lUHJpY2luZy5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBnZXQoKSB7XG4gICAgdGhpcy5fbmV4bW8uZ2V0TnVtYmVycy5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBzZWFyY2goKSB7XG4gICAgdGhpcy5fbmV4bW8uc2VhcmNoTnVtYmVycy5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBidXkoKSB7XG4gICAgdGhpcy5fbmV4bW8uYnV5TnVtYmVyLmFwcGx5KHRoaXMuX25leG1vLCBhcmd1bWVudHMpO1xuICB9XG4gIFxuICAvKipcbiAgICogVE9ETzogZG9jdW1lbnRcbiAgICovXG4gIGNhbmNlbCgpIHtcbiAgICB0aGlzLl9uZXhtby5jYW5jZWxOdW1iZXIuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgXG4gIC8qKlxuICAgKiBUT0RPOiBkb2N1bWVudFxuICAgKi9cbiAgdXBkYXRlKCkge1xuICAgIHRoaXMuX25leG1vLnVwZGF0ZU51bWJlci5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbn1cblxuZXhwb3J0IGRlZmF1bHQgTnVtYmVyO1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,e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xuICB9XG4gIFxufVxuXG5leHBvcnQgZGVmYXVsdCBOdW1iZXI7XG4iXX0= |
@@ -37,3 +37,3 @@ "use strict"; | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options); | ||
} | ||
@@ -111,2 +111,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9OdW1iZXJJbnNpZ2h0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7OztBQUVBOzs7Ozs7OztJQUVNLGE7Ozs7Ozs7OztBQVFKLHlCQUFZLFdBQVosRUFBdUM7QUFBQSxRQUFkLE9BQWMseURBQUosRUFBSTs7QUFBQTs7QUFDckMsU0FBSyxLQUFMLEdBQWEsV0FBYjtBQUNBLFNBQUssT0FBTCxHQUFlLE9BQWY7OztBQUdBLFNBQUssTUFBTCxHQUFjLEtBQUssT0FBTCxDQUFhLGFBQWIsbUJBQWQ7O0FBRUEsU0FBSyxNQUFMLENBQVksVUFBWixDQUF1QixLQUFLLEtBQUwsQ0FBVyxNQUFsQyxFQUEwQyxLQUFLLEtBQUwsQ0FBVyxTQUFyRCxFQUFnRSxLQUFLLE9BQUwsQ0FBYSxLQUE3RTtBQUNEOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O3dCQWdERyxPLEVBQVMsUSxFQUFVO0FBQ3JCLFVBQUksUUFBUSxRQUFRLEtBQXBCOztBQUVBLGFBQU8sUUFBUSxLQUFmOztBQUVBLFVBQUcsVUFBVSxVQUFiLEVBQXlCO0FBQ3ZCLGFBQUssTUFBTCxDQUFZLGFBQVosQ0FBMEIsS0FBMUIsQ0FBZ0MsS0FBSyxNQUFyQyxFQUE2QyxTQUE3Q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aW9uIG9mIHRoZSBlbmRwb2ludCB0aGUgXG4gICAqICAgICAgICAgICAgICAgICB1c2VyIGNvbm5lY3RlZCBmcm9tLlxuICAgKiBAcGFyYW0ge0FycmF5fSAgb3B0aW9ucy5mZWF0dXJlcyAtICdhZHZhbmNlZCcgb25seS5cbiAgICogICAgICAgICAgICAgICAgIEFuIEFycmF5IGRldGFpbGluZyB0aGUgaW5mb3JtYXRpb24geW91IHdhbnQgZm9yIHRoaXMgcGhvbmUgXG4gICAqICAgICAgICAgICAgICAgICBudW1iZXIuIFBvc3NpYmxlIEFycmF5IGVsZW1lbnRzIGFyZTpcbiAgICogICAgICAgICAgICAgICAgIC0gdHlwZTogbnVtYmVyIGlzIG9uZSBvZiB0aGUgZm9sbG93aW5nOiBtb2JpbGUsIGxhbmRsaW5lLFxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgbGFuZGxpbmVfcHJlbWl1bSBvciB1bmtub3duIHBob25lIG51bWJlci5cbiAgICogICAgICAgICAgICAgICAgIC0gdmFsaWQ6IG51bWJlciBleGlzdHMuXG4gICAqICAgICAgICAgICAgICAgICAtIHJlYWNoYWJsZTogaXMgbnVtYmVyIGF2YWlsYWJsZSBub3cuXG4gICAqICAgICAgICAgICAgICAgICAtIGNhcnJpZXI6IHRoZSBNQ0NNTkMgZm9yIHRoZSBjYXJyaWVyIG51bWJlciBpcyByZWdpc3RlcmVkXG4gICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoLiBUaGlzIGlzIGVpdGhlcjogPElTTyBjb3VudHJ5IGNvZGU+LUZJWEVEIFxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3IgPElTTyBjb3VudHJ5IGNvZGU+LVBSRU1JVU0uXG4gICAqICAgICAgICAgICAgICAgICAtIHBvcnRlZDogaWYgdGhlIHVzZXIgaGFzIGNoYW5nZWQgY2FycmllciBmb3IgbnVtYmVyLlxuICAgKiAgICAgICAgICAgICAgICAgLSByb2FtaW5nOiB0a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5LlxuICAgKiAgICAgICAgICAgICAgICAgQW4gQXJyYXkgZGV0YWlsaW5nIHRoZSBpbmZvcm1hdGlvbiB5b3Ugd2FudCBmb3IgdGhpcyBwaG9uZSBcbiAgICogICAgICAgICAgICAgICAgIG51bWJlci4gUG9zc2libGUgQXJyYXkgZWxlbWVudHMgYXJlOlxuICAgKiAgICAgICAgICAgICAgICAgLSB0eXBlOiBudW1iZXIgaXMgb25lIG9mIHRoZSBmb2xsb3dpbmc6IG1vYmlsZSwgbGFuZGxpbmUsXG4gICAqICAgICAgICAgICAgICAgICAgICAgICAgICBsYW5kbGluZV9wcmVtaXVtIG9yIHVua25vd24gcGhvbmUgbnVtYmVyLlxuICAgKiAgICAgICAgICAgICAgICAgLSB2YWxpZDogbnVtYmVyIGV4aXN0cy5cbiAgICogICAgICAgICAgICAgICAgIC0gcmVhY2hhYmxlOiBpcyBudW1iZXIgYXZhaWxhYmxlIG5vdy5cbiAgICogICAgICAgICAgICAgICAgIC0gY2FycmllcjogdGhlIE1DQ01OQyBmb3IgdGhlIGNhcnJpZXIgbnVtYmVyIGlzIHJlZ2lzdGVyZWRcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGguIFRoaXMgaXMgZWl0aGVyOiA8SVNPIGNvdW50cnkgY29kZT4tRklYRUQgXG4gICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvciA8SVNPIGNvdW50cnkgY29kZT4tUFJFTUlVTS5cbiAgICogICAgICAgICAgICAgICAgIC0gcG9ydGVkOiBpZiB0aGUgdXNlciBoYXMgY2hhbmdlZCBjYXJyaWVyIGZvciBudW1iZXIuXG4gICAqICAgICAgICAgICAgICAgICAtIHJvYW1pbmc6IHRoZSBzdWJzY3JpYmVyIGlzIG91dHNpZGUgdGhlaXIgaG9tZSBuZXR3b3JrXG4gICAqIFxuICAgKiBAcGFyYW0ge3N0cmluZ30gb3B0aW9ucy5jYWxsYmFjayAtICdhZHZhbmNlZCcgb25seS5cbiAgICogICAg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uICAgKiAgICAgICAgICAgICAgICAgaW50ZXJuYWwgcmVwb3J0cy5cbiAgICogQHBhcmFtIHtzdHJpbmd9IG9wdGlvbnNbJ2luY2x1ZGUtaW50ZXJtZWRpYXRlLWNhbGxiYWNrcyddIC0gJ2FkdmFuY2VkJyBvbmx5LlxuICAgKiAgICAgICAgICAgICAgICAgVGVsbHMgdGhlIE5leG1vIHBsYXRmb3JtIHRvIG1ha2UgY2FsbGJhY2tzIGFzIHNvb24gYXMgYW4gXG4gICAqICAgICAgICAgICAgICAgICBpbmRpdmlkdWFsIHBpZWNlIG9mIGluZm9ybWF0aW9uIGlzIHJldHJpZXZlZC5cbiAgICovXG4gIGdldChvcHRpb25zLCBjYWxsYmFjaykge1xuICAgIHZhciBsZXZlbCA9IG9wdGlvbnMubGV2ZWw7XG4gICAgLy8gcmVtb3ZlICdsZXZlbCcgYXMgaXQncyBhIGxpYnJhcnktb25seSBwYXJhbWV0ZXJcbiAgICBkZWxldGUgb3B0aW9ucy5sZXZlbDtcbiAgICBcbiAgICBpZihsZXZlbCA9PT0gJ2FkdmFuY2VkJykge1xuICAgICAgdGhpcy5fbmV4bW8ubnVtYmVySW5zaWdodC5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgICB9XG4gICAgZWxzZSBpZihsZXZlbCA9PT0gJ3N0YW5kYXJkJykge1xuICAgICAgdGhpcy5fbmV4bW8ubnVtYmVySW5zaWdodFN0YW5kYXJkLmFwcGx5KHRoaXMuX25leG1vLCBhcmd1bWVudHMpO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHRoaXMuX25leG1vLm51bWJlckluc2lnaHRCYXNpYy5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgICB9XG4gIH1cbiAgXG59XG5cbmV4cG9ydCBkZWZhdWx0IE51bWJlckluc2lnaHQ7XG4iXX0= |
@@ -37,3 +37,3 @@ "use strict"; | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options); | ||
} | ||
@@ -88,2 +88,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9WZXJpZnkuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7O0FBRUE7Ozs7Ozs7O0lBRU0sTTs7Ozs7Ozs7O0FBUUosa0JBQVksV0FBWixFQUF1QztBQUFBLFFBQWQsT0FBYyx5REFBSixFQUFJOztBQUFBOztBQUNyQyxTQUFLLEtBQUwsR0FBYSxXQUFiO0FBQ0EsU0FBSyxPQUFMLEdBQWUsT0FBZjs7O0FBR0EsU0FBSyxNQUFMLEdBQWMsS0FBSyxPQUFMLENBQWEsYUFBYixtQkFBZDs7QUFFQSxTQUFLLE1BQUwsQ0FBWSxVQUFaLENBQXVCLEtBQUssS0FBTCxDQUFXLE1BQWxDLEVBQTBDLEtBQUssS0FBTCxDQUFXLFNBQXJELEVBQWdFLEtBQUssT0FBTCxDQUFhLEtBQTdFO0FBQ0Q7Ozs7Ozs7Ozs4QkFLUztBQUNSLFdBQUssTUFBTCxDQUFZLFlBQVosQ0FBeUIsS0FBekIsQ0FBK0IsS0FBSyxNQUFwQyxFQUE0QyxTQUE1QztBQUNEOzs7Ozs7Ozs0QkFLTztBQUNOLFdBQUssTUFBTCxDQUFZLGtCQUFaLENBQStCLEtBQS9CLENBQXFDLEtBQUssTUFBMUMsRUFBa0QsU0FBbEQ7QUFDRDs7Ozs7Ozs7OEJBS1M7QUFDUixXQUFLLE1BQUwsQ0FBWSxvQkFBWixDQUFpQyxLQUFqQyxDQUF1QyxLQUFLLE1BQTVDLEVBQW9ELFNBQXBEO0FBQ0Q7Ozs7Ozs7OzZCQUtRO0FBQ1AsV0FBSyxNQUFMLENBQVksbUJBQVosQ0FBZ0MsS0FBaEMsQ0FBc0Ms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uZGVybHlpbmcgb2JqZWN0XG4gICAgdGhpcy5fbmV4bW8gPSB0aGlzLm9wdGlvbnMubmV4bW9PdmVycmlkZSB8fCBuZXhtbztcbiAgICBcbiAgICB0aGlzLl9uZXhtby5pbml0aWFsaXplKHRoaXMuY3JlZHMuYXBpS2V5LCB0aGlzLmNyZWRzLmFwaVNlY3JldCwgdGhpcy5vcHRpb25zKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICByZXF1ZXN0KCkge1xuICAgIHRoaXMuX25leG1vLnZlcmlmeU51bWJlci5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBjaGVjaygpIHtcbiAgICB0aGlzLl9uZXhtby5jaGVja1ZlcmlmeVJlcXVlc3QuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgXG4gIC8qKlxuICAgKiBUT0RPOiBkb2N1bWVudFxuICAgKi9cbiAgY29udHJvbCgpIHtcbiAgICB0aGlzLl9uZXhtby5jb250cm9sVmVyaWZ5UmVxdWVzdC5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBzZWFyY2goKSB7XG4gICAgdGhpcy5fbmV4bW8uc2VhcmNoVmVyaWZ5UmVxdWVzdC5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbn1cblxuZXhwb3J0IGRlZmF1bHQgVmVyaWZ5O1xuIl19 |
@@ -22,3 +22,3 @@ "use strict"; | ||
* @param {Object} options | ||
* Addition Voice options. | ||
* Addition options. | ||
*/ | ||
@@ -37,3 +37,3 @@ | ||
this._nexmo.initialize(this.creds.apiKey, this.creds.apiSecret, this.options.debug); | ||
this._nexmo.initialize(this.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9uZXhtbyA9IHRoaXMub3B0aW9ucy5uZXhtb092ZXJyaWRlIHx8IG5leG1vO1xuICAgIFxuICAgIHRoaXMuX25leG1vLmluaXRpYWxpemUodGhpcy5jcmVkcy5hcGlLZXksIHRoaXMuY3JlZHMuYXBpU2VjcmV0LCB0aGlzLm9wdGlvbnMpO1xuICB9XG4gIFxuICAvKipcbiAgICogVE9ETzogZG9jdW1lbnRcbiAgICovXG4gIHNlbmRUVFNNZXNzYWdlKCkge1xuICAgIHRoaXMuX25leG1vLnNlbmRUVFNNZXNzYWdlLmFwcGx5KHRoaXMuX25leG1vLCBhcmd1bWVudHMpO1xuICB9XG4gIFxuICAvKipcbiAgICogVE9ETzogZG9jdW1lbnRcbiAgICovXG4gIHNlbmRUVFNQcm9tcHRXaXRoQ2FwdHVyZSgpIHtcbiAgICB0aGlzLl9uZXhtby5zZW5kVFRTUHJvbXB0V2l0aENhcHR1cmUuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgXG4gIC8qKlxuICAgKiBUT0RPOiBkb2N1bWVudFxuICAgKi9cbiAgc2VuZFRUU1Byb21wdFdpdGhDb25maXJtKCkge1xuICAgIHRoaXMuX25leG1vLnNlbmRUVFNQcm9tcHRXaXRoQ29uZmlybS5hcHBseSh0aGlzLl9uZXhtbywgYXJndW1lbnRzKTtcbiAgfVxuICBcbiAgLyoqXG4gICAqIFRPRE86IGRvY3VtZW50XG4gICAqL1xuICBjYWxsKCkge1xuICAgIHRoaXMuX25leG1vLmNhbGwuYXBwbHkodGhpcy5fbmV4bW8sIGFyZ3VtZW50cyk7XG4gIH1cbiAgICBcbn1cblxuZXhwb3J0IGRlZmF1bHQgVm9pY2U7XG4iXX0= |
{ | ||
"name": "nexmo", | ||
"author": "nexmo", | ||
"version": "1.0.0-beta-7", | ||
"version": "1.0.0", | ||
"main": "lib/Nexmo", | ||
@@ -19,3 +19,3 @@ "keywords": [ | ||
}, | ||
"description": "Nexmo REST API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.", | ||
"description": "Nexmo REST API client for Node.js. API support for SMS, Voice Calls, Text-to-Speech, Numbers, Verify (2FA) and more.", | ||
"contributors": [ | ||
@@ -34,3 +34,4 @@ "nexmo", | ||
"prepublish": "npm run compile", | ||
"test": "npm run compile && mocha --compilers ./node_modules/.bin/_mocha --compilers js:babel-register ./test/*-test.js" | ||
"test": "npm run compile && mocha --compilers ./node_modules/.bin/_mocha --compilers js:babel-register ./test/*-test.js", | ||
"test-watch": "nodemon --watch src --watch test -x 'npm test'" | ||
}, | ||
@@ -42,7 +43,17 @@ "devDependencies": { | ||
"babel-register": "^6.7.2", | ||
"bluebird": "^3.4.6", | ||
"body-parser": "^1.15.2", | ||
"chai": "^3.5.0", | ||
"dotenv": "^2.0.0", | ||
"expect.js": "^0.3.1", | ||
"express": "^4.14.0", | ||
"mocha": "^2.4.5", | ||
"sinon": "^1.17.4" | ||
"ngrok": "^2.2.2", | ||
"sinon": "^1.17.4", | ||
"sinon-chai": "^2.8.0" | ||
}, | ||
"dependencies": { | ||
"jsonwebtoken": "^7.1.9", | ||
"uuid": "^2.0.2" | ||
} | ||
} |
406
README.md
@@ -9,4 +9,6 @@ # Nexmo Client Library for Node.js [![build status](https://secure.travis-ci.org/Nexmo/nexmo-node.png)](http://travis-ci.org/Nexmo/nexmo-node) | ||
## Installation Instructions | ||
[Installation](#installation) | [Constructor](#constructor) | [Messaging](#messaging) | [Voice](#voice) | [Verify](#verify) | [Number Insight](#number-insight) | [Applications](#applications) [Management](#management) | ||
## Installation | ||
```bash | ||
@@ -16,3 +18,3 @@ npm install nexmo | ||
## Usage | ||
## Constructor | ||
@@ -22,18 +24,43 @@ ```js | ||
var nexmo = new Nexmo({apiKey: API_KEY, apiSecret: API_SECRET}, {debug: DEBUG}); | ||
var nexmo = new Nexmo({ | ||
apiKey: API_KEY, | ||
apiSecret: API_SECRET, | ||
applicationId: APP_ID, | ||
privateKey: PRIVATE_KEY_PATH, | ||
}, options }); | ||
``` | ||
* `API_KEY` - API Key from Nexmo | ||
* `API_SECRET` - API SECRET from Nexmo | ||
* `DEBUG` - set this to true to debug library calls | ||
* `apiKey` - API Key from Nexmo | ||
* `apiSecret` - API SECRET from Nexmo | ||
* `applicationId` - The Nexmo Application ID to be used when creating JWTs. Required for voice related functionality. | ||
* `privateKey` - The path to the Private Key to be used when creating JWTs. Required for voice related functionality. | ||
* `options` - Additional options for the constructor | ||
## List of API's supported by the library | ||
Options are: | ||
```js | ||
{ | ||
// If true, log information to the console | ||
debug: true|false, | ||
// append info the the User-Agent sent to Nexmo | ||
// e.g. pass 'my-app' for /nexmo-node/1.0.0/4.2.7/my-app | ||
appendToUserAgent: string, | ||
// Set a custom logger | ||
logger: { | ||
log: function() {level, args...} | ||
info: function() {args...}, | ||
warn: function() {args...} | ||
} | ||
} | ||
``` | ||
## Messaging | ||
### Send a text message | ||
```js | ||
nexmo.message.sendSms(sender, recipient, message, opts, callback); | ||
nexmo.message.sendSms(sender, recipient, message, options, callback); | ||
``` | ||
* `opts` - parameter is optional | ||
* `opts` - parameter is optional. See [SMS API Reference](https://docs.nexmo.com/messaging/sms-api/api-reference#request) | ||
@@ -43,3 +70,3 @@ ### Send a Binary Message | ||
```js | ||
nexmo.message.sendBinaryMessage(fromnumber, tonumber,body, udh, callback); | ||
nexmo.message.sendBinaryMessage(fromnumber, tonumber, body, udh, callback); | ||
``` | ||
@@ -64,277 +91,392 @@ | ||
### Check Account Balance | ||
## Voice | ||
For detailed information please see the documentation at https://docs.nexmo.com/voice/call | ||
### Make a call | ||
Requires `applicationId` and `privateKey` to be set on the constructor. | ||
```js | ||
nexmo.account.checkBalance(callback); | ||
nexmo.calls.create({ | ||
to: [{ | ||
type: 'phone', | ||
number: TO_NUMBER | ||
}], | ||
from: { | ||
type: 'phone', | ||
number: FROM_NUMBER | ||
}, | ||
answer_url: [ANSWER_URL] | ||
}, callback); | ||
``` | ||
### Get Pricing for sending message to a country. | ||
For more information see https://docs.nexmo.com/voice/voice-api/api-reference#call_create | ||
### Get a Call | ||
```js | ||
nexmo.number.getPricing(countryCode, callback); | ||
nexmo.calls.get(callId, callback); | ||
``` | ||
* `countryCode` - 2 letter ISO Country Code | ||
For more information see https://docs.nexmo.com/voice/voice-api/api-reference#call_create | ||
### Get Pricing for sending message or making a call to a number. | ||
### Query Calls | ||
```js | ||
nexmo.number.getPhonePricing(product, countryCode, callback); | ||
``` | ||
nexmo.calls.get({status: 'completed'}, callback); | ||
``` | ||
* `product` - either `voice` or `sms` | ||
* `countryCode` - 2 letter ISO Country Code | ||
The first parameter can contain many properties to filter the returned call or to page results. For more information see the [Calls API Reference](https://docs.nexmo.com/voice/voice-api/api-reference#calls). | ||
### Get all numbers associated to the account. | ||
### Stream an Audio File to a Call | ||
```js | ||
nexmo.number.get(options, callback); | ||
nexmo.calls.stream.start( | ||
callId, | ||
{ | ||
stream_url: [ | ||
'https://nexmo-community.github.io/ncco-examples/assets/voice_api_audio_streaming.mp3' | ||
], | ||
loop: 1 | ||
}); | ||
``` | ||
* `options` parameter is an optional Dictionary Object containing any of the following parameters | ||
* `pattern` | ||
* `search_pattern` | ||
* `index` | ||
* `size` | ||
For more information see https://docs.nexmo.com/voice/voice-api/api-reference#stream_put | ||
For more details on what the above options mean refer to the Nexmo API [documentation](https://docs.nexmo.com/tools/developer-api/account-numbers) | ||
### Stop an audio stream in a call | ||
Example: | ||
```js | ||
nexmo.number.get({pattern:714,index:1,size:50,search_pattern:2},consolelog); | ||
nexmo.calls.stream.stop(callId); | ||
``` | ||
### Search for MSISDN's available to purchase | ||
For more information see https://docs.nexmo.com/voice/voice-api/api-reference#stream_delete | ||
### Send DTMF to a Call | ||
```js | ||
nexmo.number.search(countryCode,options,callback); | ||
nexmo.calls.dtmf.send(callId, params, callback); | ||
``` | ||
`options` parameter is optional. They can be one of the following : | ||
For more information see https://docs.nexmo.com/voice/voice-api/api-reference#dtmf_put | ||
1. number pattern to match the search (eg. 1408) | ||
2. Dictionary Object optionally containing the following parameters : | ||
* `pattern` | ||
* `search_pattern` | ||
* `features` | ||
* `index` | ||
* `size` | ||
## Verify | ||
For more details on what the above options mean refer to the Nexmo API [documentation](https://docs.nexmo.com/tools/developer-api/number-search) | ||
### Submit a Verification Request | ||
Example: | ||
```js | ||
nexmo.verify.request({number:<NUMBER_TO_BE_VERIFIED>,brand:<NAME_OF_THE_APP>},callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#vrequest | ||
### Validate the response of a Verification Request | ||
```js | ||
nexmo.number.search('US',{pattern:3049,index:1,size:50,features:'VOICE',search_pattern:2},consolelog); | ||
nexmo.verify.check({request_id:<UNIQUE_ID_FROM_VERIFICATION_REQUEST>,code:<CODE_TO_CHECK>},callback); | ||
``` | ||
### Purchase number | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#check | ||
### Search one or more Verification Request | ||
```js | ||
nexmo.number.buy(countryCode, msisdn, callback); | ||
nexmo.verify.search(<ONE_REQUEST_ID or ARRAY_OF_REQUEST_ID>,callback); | ||
``` | ||
### Cancel Number | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#search | ||
### Verification Control API | ||
```js | ||
nexmo.number.cancel(countryCode, msisdn, callback); | ||
nexmo.verify.control({request_id:<UNIQUE_ID_FROM_VERIFICATION_REQUEST>,cmd:<CODE_TO_CHECK>},callback); | ||
``` | ||
### Update Number | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#control | ||
## Number Insight | ||
### Basic | ||
```js | ||
nexmo.number.update(countryCode, msisdn, params, callback); | ||
nexmo.numberInsight.get({level: 'basic', number: NUMBER}, callback); | ||
``` | ||
params is a dictionary of parameters per [documentation](https://docs.nexmo.com/index.php/developer-api/number-update) | ||
For more information check the documentation at https://docs.nexmo.com/number-insight/basic | ||
### Update Password (API Secret) | ||
Example: | ||
```js | ||
nexmo.account.updatePassword(<NEW_PASSWORD>,callback); | ||
nexmo.numberInsight.get({level: 'basic', number: '1-234-567-8900'}, consolelog); | ||
``` | ||
### Update Callback URL associated to the account | ||
### Standard | ||
```js | ||
nexmo.updateSMSCallback(<NEW_CALLBACK_URL>,callback); | ||
nexmo.numberInsight.get({level: 'standard', number: NUMBER}, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/number-insight/standard | ||
### Change Delivery Receipt URL associated to the account | ||
Example: | ||
```js | ||
nexmo.account.updateDeliveryReceiptCallback(<NEW_DR_CALLBACK_URL>,callback); | ||
nexmo.numberInsight.get({level: 'standard', number: '1-234-567-8900'}, consolelog); | ||
``` | ||
### Send TTS Message | ||
### Advanced | ||
```js | ||
nexmo.voice.sendTTSMessage = function(<TO_NUMBER>,message,options,callback); | ||
nexmo.numberInsight.get({level: 'advanced', number: NUMBER}, callback); | ||
``` | ||
### Send TTS Prompt With Capture | ||
For more information check the documentation at https://docs.nexmo.com/number-insight/advanced | ||
## Applications | ||
For an overview of applications see https://docs.nexmo.com/tools/application-api | ||
### Create an App | ||
```js | ||
nexmo.sendTTSPromptWithCapture(<TO_NUMBER>,message,<MAX_DIGITS>, <BYE_TEXT>,options,callback); | ||
nexmo.applications.create(name, type, answerUrl, eventUrl, options, callback); | ||
``` | ||
### Send TTS Prompt With Confirm | ||
For more information see https://docs.nexmo.com/tools/application-api/api-reference#create | ||
### Get a single App | ||
```js | ||
nexmo.voice.sendTTSPromptWithConfirm(<TO_NUMBER>, message ,<MAX_DIGITS>,'<PIN_CODE>',<BYE_TEXT>,<FAILED_TEXT>,options,callback); | ||
nexmo.applications.get(appId, callback); | ||
``` | ||
### Make a voice call | ||
For more information see https://docs.nexmo.com/tools/application-api/api-reference#retrieve | ||
### Get Apps by filter | ||
```js | ||
nexmo.voice.call(<TO_NUMBER>,<ANSWER_URL>,options,callback); | ||
nexmo.application.get(options, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/voice/call | ||
For more information see https://docs.nexmo.com/tools/application-api/api-reference#list | ||
### Submit a Verification Request | ||
### Update an App | ||
```js | ||
nexmo.verify.request({number:<NUMBER_TO_BE_VERIFIED>,brand:<NAME_OF_THE_APP>},callback); | ||
nexmo.applications.update(appId, name, type, answerUrl, eventUrl, options, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#vrequest | ||
For more information see https://docs.nexmo.com/tools/application-api/api-reference#update | ||
### Validate the response of a Verification Request | ||
### Delete an App | ||
```js | ||
nexmo.verify.check({request_id:<UNIQUE_ID_FROM_VERIFICATION_REQUEST>,code:<CODE_TO_CHECK>},callback); | ||
nexmo.application.delete(appId, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#check | ||
For more information see https://docs.nexmo.com/tools/application-api/api-reference#delete | ||
### Search one or more Verification Request | ||
## Management | ||
### Check Account Balance | ||
```js | ||
nexmo.verify.search(<ONE_REQUEST_ID or ARRAY_OF_REQUEST_ID>,callback); | ||
nexmo.account.checkBalance(callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#search | ||
### Get Pricing for sending message to a country. | ||
### Verification Control API | ||
```js | ||
nexmo.number.getPricing(countryCode, callback); | ||
``` | ||
* `countryCode` - 2 letter ISO Country Code | ||
### Get Pricing for sending message or making a call to a number. | ||
```js | ||
nexmo.verify.control({request_id:<UNIQUE_ID_FROM_VERIFICATION_REQUEST>,cmd:<CODE_TO_CHECK>},callback); | ||
nexmo.number.getPhonePricing(product, countryCode, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/verify/api-reference/api-reference#control | ||
* `product` - either `voice` or `sms` | ||
* `countryCode` - 2 letter ISO Country Code | ||
### Number Insight - Basic | ||
### Get all numbers associated to the account. | ||
```js | ||
nexmo.numberInsight.get({level: 'basic', number: NUMBER}, callback); | ||
nexmo.number.get(options, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/number-insight/basic | ||
* `options` parameter is an optional Dictionary Object containing any of the following parameters | ||
* `pattern` | ||
* `search_pattern` | ||
* `index` | ||
* `size` | ||
For more details on what the above options mean refer to the Nexmo API [documentation](https://docs.nexmo.com/tools/developer-api/account-numbers) | ||
Example: | ||
```js | ||
nexmo.numberInsight.get({level: 'basic', number: '1-234-567-8900'}, consolelog); | ||
nexmo.number.get({pattern:714,index:1,size:50,search_pattern:2},consolelog); | ||
``` | ||
### Number Insight - Standard | ||
### Search for MSISDN's available to purchase | ||
```js | ||
nexmo.numberInsight.get({level: 'standard', number: NUMBER}, callback); | ||
nexmo.number.search(countryCode,options,callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/number-insight/standard | ||
`options` parameter is optional. They can be one of the following : | ||
1. number pattern to match the search (eg. 1408) | ||
2. Dictionary Object optionally containing the following parameters : | ||
* `pattern` | ||
* `search_pattern` | ||
* `features` | ||
* `index` | ||
* `size` | ||
For more details on what the above options mean refer to the Nexmo API [documentation](https://docs.nexmo.com/tools/developer-api/number-search) | ||
Example: | ||
```js | ||
nexmo.numberInsight.get({level: 'standard', number: '1-234-567-8900'}, consolelog); | ||
nexmo.number.search('US',{pattern:3049,index:1,size:50,features:'VOICE',search_pattern:2},consolelog); | ||
``` | ||
### Number Insight - Advanced | ||
### Purchase number | ||
```js | ||
nexmo.numberInsight.get({level: 'advanced', number: NUMBER}, callback); | ||
nexmo.number.buy(countryCode, msisdn, callback); | ||
``` | ||
For more information check the documentation at https://docs.nexmo.com/number-insight/advanced | ||
### Cancel Number | ||
## Callbacks | ||
```js | ||
nexmo.number.cancel(countryCode, msisdn, callback); | ||
``` | ||
Callback from all API calls returns 2 parameters - error and a json object. | ||
### Update Number | ||
An example callback function: | ||
```js | ||
function consolelog (err,messageResponse) { | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
console.dir(messageResponse); | ||
} | ||
} | ||
nexmo.number.update(countryCode, msisdn, params, callback); | ||
``` | ||
Refer here https://docs.nexmo.com/ to get the schema for the returned message response object. | ||
params is a dictionary of parameters per [documentation](https://docs.nexmo.com/index.php/developer-api/number-update) | ||
## Testing | ||
### Update Password (API Secret) | ||
Run the | ||
```bash | ||
npm test | ||
```js | ||
nexmo.account.updatePassword(<NEW_PASSWORD>,callback); | ||
``` | ||
For testing purposes you can also use setHost function to make the library send requests to another place like localhost instead of real Nexmo. Feel free to catch and process those requests the way you need. A usage example: | ||
### Update Callback URL associated to the account | ||
```js | ||
nexmo.setHost('localhost'); | ||
nexmo.updateSMSCallback(<NEW_CALLBACK_URL>,callback); | ||
``` | ||
Note that default port is 443 and nexmo does https calls in such a case. You can use setPort function to make it proper for your testing environment. When port is not 443 it will make requests via http protocol. Have a look at an example: | ||
### Change Delivery Receipt URL associated to the account | ||
```js | ||
nexmo.setPort('8080'); | ||
nexmo.account.updateDeliveryReceiptCallback(<NEW_DR_CALLBACK_URL>,callback); | ||
``` | ||
## Examples | ||
## Voice (Deprecated) | ||
There are some basic examples which will test the functionality. They uses environment variables for settings for the tests. The environment variables are: | ||
### Send TTS Message | ||
* API_KEY = The API key provided by Nexmo for your account | ||
* API_SECRET = The secret provided by NExmo for your account | ||
* FROM_NUMBER = The phone number to send messages and make calls from. | ||
* TO_NUMBER = The phone number to send messages and make calls to. | ||
* MAX_DIGITS = The maximum number of digits for the pin code. | ||
* ANSWER_URL = The URL which has the VoiceXML file to control the call functionality | ||
* PIN_CODE = The digits you must enter to confirm the message | ||
```js | ||
nexmo.voice.sendTTSMessage(<TO_NUMBER>,message,options,callback); | ||
``` | ||
The simplest way to run the examples is to create a `.env` file in the `examples` directory with the following: | ||
### Send TTS Prompt With Capture | ||
```js | ||
nexmo.sendTTSPromptWithCapture(<TO_NUMBER>,message,<MAX_DIGITS>, <BYE_TEXT>,options,callback); | ||
``` | ||
API_KEY={value} | ||
API_SECRET={value} | ||
FROM_NUMBER={value} | ||
TO_NUMBER={value} | ||
MAX_DIGITS={value} | ||
ANSWER_URL={value} | ||
PIN_CODE={value} | ||
### Send TTS Prompt With Confirm | ||
```js | ||
nexmo.voice.sendTTSPromptWithConfirm(<TO_NUMBER>, message ,<MAX_DIGITS>,'<PIN_CODE>',<BYE_TEXT>,<FAILED_TEXT>,options,callback); | ||
``` | ||
Then run: | ||
## Testing | ||
Run: | ||
```bash | ||
node examples/pre-v1.js | ||
npm test | ||
``` | ||
And | ||
Or to continually watch and run tests as you change the code: | ||
```bash | ||
node examples/v1-beta.js | ||
npm run-script test-watch | ||
``` | ||
## Examples | ||
See [examples/README.md](examples/README). | ||
Also see the [Nexmo Node Quickstarts repo](https://github.com/nexmo-community/nexmo-node-quickstart). | ||
## API Coverage | ||
* Voice | ||
* [x] Outbound Calls | ||
* [ ] Inbound Call Webhook | ||
* [x] Stream to Call | ||
* [x] Talk to Call | ||
* [x] DTMF to Call | ||
* Messaging | ||
* [x] Send | ||
* [ ] Delivery Receipt Webhook | ||
* [ ] Inbound Message Webhook | ||
* [ ] Search | ||
* [ ] Message | ||
* [ ] Messages | ||
* [ ] Rejections | ||
* [ ] US Short Codes | ||
* [ ] Two-Factor Authentication | ||
* [ ] Event Based Alerts | ||
* [ ] Sending Alerts | ||
* [ ] Campaign Subscription Management | ||
* Number Insight | ||
* [X] Basic | ||
* [X] Standard | ||
* [ ] Advanced | ||
* [x] Advanced Async | ||
* [ ] Advanced Async Webhook | ||
* Verify | ||
* [x] Verify | ||
* [x] Check | ||
* [x] Search | ||
* [x] Control | ||
* Applications | ||
* [x] Create an Application | ||
* [x] Get Applications | ||
* [x] Update an Application | ||
* [x] Delete an Application | ||
* Account | ||
* [X] Balance | ||
* [x] Pricing | ||
* [x] Settings | ||
* [ ] Top Up | ||
* [x] Numbers | ||
* [x] Search | ||
* [x] Buy | ||
* [x] Cancel | ||
* [x] Update | ||
* Voice (Deprecated) | ||
* [x] Outbound Calls | ||
* [ ] Inbound Call Webhook | ||
* [x] Text-To-Speech Call | ||
* [x] Text-To-Speech Prompt | ||
## License | ||
MIT - see [LICENSE](LICENSE.txt) |
@@ -0,5 +1,16 @@ | ||
import chai, { expect } from 'chai'; | ||
import sinon from 'sinon'; | ||
import sinonChai from 'sinon-chai'; | ||
chai.use(sinonChai); | ||
import Nexmo from '../lib/Nexmo'; | ||
import expect from 'expect.js' | ||
import CallsResource from '../lib/CallsResource'; | ||
describe('Nexmo Object instance', function () { | ||
it('should expose a credentials object', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
expect(nexmo.credentials).to.be.a('object'); | ||
}); | ||
@@ -36,2 +47,12 @@ it('should expose a message object', function () { | ||
it('should expose a applications object', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
expect(nexmo.applications).to.be.a('object'); | ||
}); | ||
it('should alias apps to applications object', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
expect(nexmo.applications).to.equal(nexmo.app); | ||
}); | ||
it('should expose a account object', function () { | ||
@@ -42,2 +63,54 @@ var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
it('should expose a calls object', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
expect(nexmo.calls).to.be.an.instanceOf(CallsResource); | ||
}); | ||
it('should allow options to be passed', function () { | ||
var initializedSpy = sinon.spy(); | ||
var options = { | ||
nexmoOverride: { | ||
initialize: initializedSpy | ||
}, | ||
appendToUserAgent: 'EXT', | ||
debug: true | ||
}; | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}, options); | ||
expect( initializedSpy.calledWith('test', 'test', options) ).to.be.true; | ||
}); | ||
it('should have debug turned off by default', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
expect( nexmo.options.debug ).to.be.false; | ||
}); | ||
it('should allow a custom logger to be set', function () { | ||
var logger = { | ||
info: function(){}, | ||
error: function() {}, | ||
warn: function() {} | ||
}; | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}, {logger: logger}); | ||
console.log(nexmo.options.logger); | ||
expect( nexmo.options.logger ).to.equal(logger); | ||
}); | ||
it('should allow a debug option to be set', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}, { debug: true }); | ||
expect( nexmo.options.debug ).to.be.true; | ||
}); | ||
it('should have a default user agent in the form LIBRARY-NAME/LIBRARY-VERSION/LANGUAGE-VERSION', function () { | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}); | ||
expect( nexmo.options.userAgent ).to.match(/.*\/.*\/.*$/); | ||
}); | ||
it('should append to the user agent when a appendToUserAgent option is passed', function () { | ||
var options = { | ||
appendToUserAgent: 'EXT' | ||
}; | ||
var nexmo = new Nexmo({apiKey:'test', apiSecret:'test'}, options); | ||
expect( nexmo.options.userAgent ).to.match(/\/EXT$/); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
276085
63
3251
0
478
2
14
16
+ Addedjsonwebtoken@^7.1.9
+ Addeduuid@^2.0.2
+ Addedbuffer-equal-constant-time@1.0.1(transitive)
+ Addedecdsa-sig-formatter@1.0.11(transitive)
+ Addedhoek@2.16.3(transitive)
+ Addedisemail@1.2.0(transitive)
+ Addedjoi@6.10.1(transitive)
+ Addedjsonwebtoken@7.4.3(transitive)
+ Addedjwa@1.4.1(transitive)
+ Addedjws@3.2.2(transitive)
+ Addedlodash.once@4.1.1(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedtopo@1.1.0(transitive)
+ Addeduuid@2.0.3(transitive)
+ Addedxtend@4.0.2(transitive)