Comparing version 0.0.3 to 0.0.4
var request = require('request'), | ||
Promise = require('bluebird'), | ||
util = require('./util'), | ||
@@ -26,18 +27,22 @@ Metric = require('./metric'); | ||
Flurry.prototype[i] = function(callback){ | ||
request.get('http://api.flurry.com/appInfo/' + i, { | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
qs: { | ||
apiAccessCode: this.options.apiAccess, | ||
apiKey: this.options.apiKey | ||
} | ||
}, function(err, res, body){ | ||
if (err) return callback(err); | ||
if (typeof callback !== 'function') callback = function(){}; | ||
var data = JSON.parse(body); | ||
if (res.statusCode !== 200) return callback(util.formatError(data)); | ||
return new Promise(function(resolve, reject){ | ||
request.get('http://api.flurry.com/appInfo/' + i, { | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
qs: { | ||
apiAccessCode: this.options.apiAccess, | ||
apiKey: this.options.apiKey | ||
} | ||
}, function(err, res, body){ | ||
if (err) return reject(err); | ||
callback(null, data); | ||
}); | ||
var data = JSON.parse(body); | ||
if (res.statusCode !== 200) return reject(util.formatError(data)); | ||
resolve(data); | ||
}); | ||
}).nodeify(callback); | ||
}; | ||
@@ -44,0 +49,0 @@ }); |
var request = require('request'), | ||
Promise = require('bluebird'), | ||
util = require('./util'); | ||
@@ -42,15 +43,19 @@ | ||
Metric.prototype.exec = function(callback){ | ||
request.get(this.base, { | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
qs: this.params | ||
}, function(err, res, body){ | ||
if (err) return callback(err); | ||
if (typeof callback !== 'function') callback = function(){}; | ||
var data = JSON.parse(body); | ||
if (res.statusCode !== 200) return callback(util.formatError(data)); | ||
return new Promise(function(resolve, reject){ | ||
request.get(this.base, { | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
qs: this.params | ||
}, function(err, res, body){ | ||
if (err) return reject(err); | ||
callback(null, data); | ||
}); | ||
var data = JSON.parse(body); | ||
if (res.statusCode !== 200) return reject(util.formatError(data)); | ||
resolve(data); | ||
}); | ||
}).nodeify(callback); | ||
}; |
{ | ||
"name": "flurry-api", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Flurry API for Node.js", | ||
@@ -29,4 +29,5 @@ "main": "lib/flurry", | ||
"dependencies": { | ||
"bluebird": "^2.2.2", | ||
"request": "^2.37.0" | ||
} | ||
} |
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
8314
114
2
+ Addedbluebird@^2.2.2
+ Addedbluebird@2.11.0(transitive)