Comparing version 2.17.0 to 2.17.1
# Change Log | ||
## [v2.17.1](https://github.com/auth0/node-auth0/tree/v2.17.1) (2019-05-22) | ||
[Full Changelog](https://github.com/auth0/node-auth0/compare/v2.17.0...v2.17.1) | ||
**Fixed** | ||
- Fix telemetry header [\#362](https://github.com/auth0/node-auth0/pull/362) ([lbalmaceda](https://github.com/lbalmaceda)) | ||
## [v2.17.0](https://github.com/auth0/node-auth0/tree/v2.17.0) (2019-04-15) | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "auth0", | ||
"version": "2.17.0", | ||
"version": "2.17.1", | ||
"description": "SDK for Auth0 API v2", | ||
"main": "src/index.js", | ||
"files": ["src"], | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
"test": "mocha -R spec ./test/**/*.tests.js ./test/*.tests.js", | ||
"test:ci": | ||
"istanbul cover _mocha --report lcovonly -R $(find ./test -name *.tests.js) -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-", | ||
"test:ci": "istanbul cover _mocha --report lcovonly -R $(find ./test -name *.tests.js) -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-", | ||
"test:coverage": "codecov", | ||
"test:watch": | ||
"cross-env NODE_ENV=test mocha --timeout 5000 ./test/**/*.tests.js ./test/*.tests.js --watch", | ||
"test:watch": "cross-env NODE_ENV=test mocha --timeout 5000 ./test/**/*.tests.js ./test/*.tests.js --watch", | ||
"jsdoc:generate": "jsdoc --configure .jsdoc.json --verbose", | ||
@@ -25,3 +25,6 @@ "release:clean": "node scripts/cleanup.js", | ||
}, | ||
"keywords": ["auth0", "api"], | ||
"keywords": [ | ||
"auth0", | ||
"api" | ||
], | ||
"author": "Auth0", | ||
@@ -28,0 +31,0 @@ "license": "MIT", |
@@ -33,3 +33,4 @@ var extend = require('util')._extend; | ||
var clientOptions = { | ||
errorFormatter: { message: 'message', name: 'error' } | ||
errorFormatter: { message: 'message', name: 'error' }, | ||
headers: options.headers | ||
}; | ||
@@ -36,0 +37,0 @@ |
/** @module auth **/ | ||
var util = require('util'); | ||
var pkg = require('../../package.json'); | ||
var utils = require('../utils'); | ||
@@ -70,4 +68,7 @@ var jsonToBase64 = utils.jsonToBase64; | ||
if (options.telemetry !== false) { | ||
var telemetry = jsonToBase64(options.clientInfo || this.getClientInfo()); | ||
managerOptions.headers['Auth0-Client'] = telemetry; | ||
var clientInfo = options.clientInfo || utils.generateClientInfo(); | ||
if ('string' === typeof clientInfo.name && clientInfo.name) { | ||
var telemetry = jsonToBase64(clientInfo); | ||
managerOptions.headers['Auth0-Client'] = telemetry; | ||
} | ||
} | ||
@@ -112,34 +113,2 @@ | ||
/** | ||
* Return an object with information about the current client, | ||
* | ||
* @method getClientInfo | ||
* @memberOf module:auth.AuthenticationClient.prototype | ||
* | ||
* @return {Object} Object containing client information. | ||
*/ | ||
AuthenticationClient.prototype.getClientInfo = function() { | ||
var clientInfo = { | ||
name: 'node-auth0', | ||
version: pkg.version, | ||
dependencies: [], | ||
environment: [ | ||
{ | ||
name: 'node.js', | ||
version: process.version.replace('v', '') | ||
} | ||
] | ||
}; | ||
// Add the dependencies to the client info object. | ||
Object.keys(pkg.dependencies).forEach(function(name) { | ||
clientInfo.dependencies.push({ | ||
name: name, | ||
version: pkg.dependencies[name] | ||
}); | ||
}); | ||
return clientInfo; | ||
}; | ||
/** | ||
* Start passwordless flow sending an email. | ||
@@ -146,0 +115,0 @@ * |
@@ -36,3 +36,4 @@ var extend = require('util')._extend; | ||
var clientOptions = { | ||
errorFormatter: { message: 'message', name: 'error' } | ||
errorFormatter: { message: 'message', name: 'error' }, | ||
headers: options.headers | ||
}; | ||
@@ -39,0 +40,0 @@ |
@@ -32,3 +32,4 @@ var extend = require('util')._extend; | ||
var clientOptions = { | ||
errorFormatter: { message: 'message', name: 'error' } | ||
errorFormatter: { message: 'message', name: 'error' }, | ||
headers: options.headers | ||
}; | ||
@@ -35,0 +36,0 @@ |
@@ -70,3 +70,4 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
clientSecret: this.options.clientSecret, | ||
telemetry: this.options.telemetry | ||
telemetry: this.options.telemetry, | ||
clientInfo: this.options.clientInfo | ||
}; | ||
@@ -73,0 +74,0 @@ this.authenticationClient = new AuthenticationClient(authenticationClientOptions); |
@@ -52,3 +52,3 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
); | ||
this.stats = new RetryRestClient(auth0RestClient, options.retry); | ||
this.resource = new RetryRestClient(auth0RestClient, options.retry); | ||
}; | ||
@@ -88,6 +88,6 @@ | ||
if (cb && cb instanceof Function) { | ||
return this.stats.get(params, cb); | ||
return this.resource.get(params, cb); | ||
} | ||
return this.stats.get(params); | ||
return this.resource.get(params); | ||
}; | ||
@@ -118,9 +118,9 @@ | ||
if (cb && cb instanceof Function) { | ||
return this.stats.get(options, cb); | ||
return this.resource.get(options, cb); | ||
} | ||
// Return a promise. | ||
return this.stats.get(options); | ||
return this.resource.get(options); | ||
}; | ||
module.exports = StatsManager; |
@@ -52,3 +52,3 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
); | ||
this.tenant = new RetryRestClient(auth0RestClient, options.retry); | ||
this.resource = new RetryRestClient(auth0RestClient, options.retry); | ||
}; | ||
@@ -76,7 +76,7 @@ | ||
if (cb && cb instanceof Function) { | ||
return this.tenant.patch({}, data, cb); | ||
return this.resource.patch({}, data, cb); | ||
} | ||
// Return a promise. | ||
return this.tenant.patch({}, data); | ||
return this.resource.patch({}, data); | ||
}; | ||
@@ -105,9 +105,9 @@ | ||
if (cb && cb instanceof Function) { | ||
return this.tenant.get({}, cb); | ||
return this.resource.get({}, cb); | ||
} | ||
// Return a promise. | ||
return this.tenant.get({}); | ||
return this.resource.get({}); | ||
}; | ||
module.exports = TenantManager; |
@@ -46,3 +46,3 @@ var ArgumentError = require('rest-facade').ArgumentError; | ||
); | ||
this.ticket = new RetryRestClient(auth0RestClient, options.retry); | ||
this.resource = new RetryRestClient(auth0RestClient, options.retry); | ||
}; | ||
@@ -77,7 +77,7 @@ | ||
if (cb && cb instanceof Function) { | ||
return this.ticket.create(params, data, cb); | ||
return this.resource.create(params, data, cb); | ||
} | ||
// Return a promise. | ||
return this.ticket.create(params, data); | ||
return this.resource.create(params, data); | ||
}; | ||
@@ -110,9 +110,9 @@ | ||
if (cb && cb instanceof Function) { | ||
return this.ticket.create(params, data, cb); | ||
return this.resource.create(params, data, cb); | ||
} | ||
// Return a promise. | ||
return this.ticket.create(params, data); | ||
return this.resource.create(params, data); | ||
}; | ||
module.exports = TicketsManager; |
var Promise = require('bluebird'); | ||
var request = require('request'); | ||
var pkg = require('../package.json'); | ||
@@ -26,2 +27,20 @@ /** | ||
/** | ||
* Return an object with information about the current client. | ||
* | ||
* @method generateClientInfo | ||
* @memberOf module:utils | ||
* | ||
* @return {Object} Object containing client information. | ||
*/ | ||
utils.generateClientInfo = function() { | ||
return { | ||
name: 'node-auth0', | ||
version: pkg.version, | ||
env: { | ||
node: process.version.replace('v', '') | ||
} | ||
}; | ||
}; | ||
/** | ||
* Simple wrapper that, given a class, a property name and a method name, | ||
@@ -28,0 +47,0 @@ * creates a new method in the class that is a wrapper for the given |
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
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
291142
38
8808