Comparing version 2.0.1 to 2.0.2
@@ -6,3 +6,2 @@ /* eslint camelcase: 0 */ | ||
const rateLimiting = require('./rateLimiting') | ||
const request = require('request-promise') | ||
@@ -103,10 +102,10 @@ // request.debug = true | ||
//= ==== postUpload ===== | ||
HttpClient.prototype.postUpload = function (args, done) { | ||
if (!args) { | ||
args = {} | ||
} | ||
HttpClient.prototype.postUpload = function (args = {}, done) { | ||
var options = { | ||
url: 'uploads', | ||
method: 'POST' | ||
method: 'POST', | ||
formData: { | ||
...args.formData, | ||
file: fs.createReadStream(args.file) | ||
} | ||
} | ||
@@ -118,13 +117,3 @@ | ||
var req = request.post(options, function (err, httpResponse, payload) { | ||
done(err, payload) | ||
}) | ||
var form = req.form() | ||
// append the rest of the formData values | ||
for (var key in args.formData) { | ||
form.append(key, args.formData[key]) | ||
} | ||
form.append('file', fs.createReadStream(args.file)) | ||
return Promise.resolve(this.request.post(options)).asCallback(done) | ||
} | ||
@@ -205,3 +194,4 @@ | ||
return Promise.resolve(response.body) | ||
}).asCallback(callback) | ||
}) | ||
.asCallback(callback) | ||
} | ||
@@ -208,0 +198,0 @@ |
var uploads = function (client) { | ||
this.client = this | ||
this.client = client | ||
} | ||
@@ -14,3 +14,3 @@ | ||
uploads.post = function (args, done) { | ||
uploads.prototype.post = function (args, done) { | ||
var self = this | ||
@@ -46,3 +46,3 @@ | ||
uploads._check = function (args, cb) { | ||
uploads.prototype._check = function (args, cb) { | ||
var endpoint = 'uploads' | ||
@@ -66,3 +66,3 @@ var self = this | ||
uploads._uploadIsDone = function (args) { | ||
uploads.prototype._uploadIsDone = function (args) { | ||
var isDone = false | ||
@@ -69,0 +69,0 @@ |
{ | ||
"name": "strava-v3", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Simple wrapper for strava v3 api", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -417,2 +417,3 @@ | ||
Currently Maintained by Mark Stosberg <mark@rideamigos.com> | ||
Currently Maintained by Mark Stosberg <mark@rideamigos.com> | ||
@@ -76,3 +76,3 @@ const should = require('should') | ||
.post(/^\/oauth\/token/) | ||
.reply(200, [ | ||
.reply(200, | ||
{ | ||
@@ -85,3 +85,3 @@ 'access_token': '38c8348fc7f988c39d6f19cf8ffb17ab05322152', | ||
} | ||
]) | ||
) | ||
}) | ||
@@ -91,3 +91,3 @@ it('should return expected response when refreshing token', () => { | ||
.then(result => { | ||
result.should.eql([ | ||
result.should.eql( | ||
{ | ||
@@ -100,3 +100,3 @@ 'access_token': '38c8348fc7f988c39d6f19cf8ffb17ab05322152', | ||
} | ||
]) | ||
) | ||
}) | ||
@@ -103,0 +103,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
227559
44
419
0
2339