Comparing version
@@ -25,2 +25,3 @@ // Generated by CoffeeScript 1.10.0 | ||
this.put = bind(this.put, this); | ||
this.postForm = bind(this.postForm, this); | ||
this.post = bind(this.post, this); | ||
@@ -128,2 +129,5 @@ this["delete"] = bind(this["delete"], this); | ||
} | ||
if (kwargs.formData != null) { | ||
request_options.formData = kwargs.formData; | ||
} | ||
if (this.opts.auth) { | ||
@@ -162,3 +166,4 @@ request_options.auth = { | ||
args: {}, | ||
data: {} | ||
data: {}, | ||
formData: {} | ||
}; | ||
@@ -274,2 +279,20 @@ translation = { | ||
_Class.prototype.postForm = function(formData, fn) { | ||
var handle, opts, resp; | ||
if (fn == null) { | ||
throw Error('Missing callback'); | ||
} | ||
opts = this._prepare_opts(formData, 'formData'); | ||
handle = (function(_this) { | ||
return function(err, response, body) { | ||
var ref1; | ||
if ((200 <= (ref1 = response.statusCode) && ref1 <= 299)) { | ||
return _this.wrap_response(fn, err, response, _this._try_to_serialize(response, body)); | ||
} | ||
return _this.wrap_response(fn, err, response, true); | ||
}; | ||
})(this); | ||
return resp = this._request('POST', opts, handle); | ||
}; | ||
_Class.prototype.put = function(data, fn) { | ||
@@ -276,0 +299,0 @@ var handle, opts, resp; |
{ | ||
"name": "slumber", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "Port of Python's slumber library -- A library that makes consuming a RESTful API easier and more convenient", | ||
@@ -21,14 +21,14 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"debug": "^2.1.3", | ||
"querystring": "0.2.0", | ||
"request": "^2.55.0" | ||
"debug": "^2.2.0", | ||
"querystring": "^0.2.0", | ||
"request": "^2.72.0" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "", | ||
"mocha": "", | ||
"express": "", | ||
"freeport": "", | ||
"url": "0.7", | ||
"yamljs": "0.1", | ||
"connect": "2" | ||
"body-parser": "^1.15.2", | ||
"coffee-script": "^1.10.0", | ||
"express": "^4.14.0", | ||
"freeport": "^1.0.5", | ||
"mocha": "^2.5.3", | ||
"url": "^0.11.0", | ||
"yamljs": "^0.2.8" | ||
}, | ||
@@ -35,0 +35,0 @@ "optionalDependencies": { |
@@ -6,7 +6,2 @@ Slumber (Node.js version) | ||
[](https://david-dm.org/moul/node-slumber) | ||
[](https://sourcegraph.com/github.com/moul/node-slumber) | ||
[](https://sourcegraph.com/github.com/moul/node-slumber) | ||
[](https://sourcegraph.com/github.com/moul/node-slumber) | ||
[](https://sourcegraph.com/github.com/moul/node-slumber) | ||
[](https://bitdeli.com/free "Bitdeli Badge") | ||
@@ -13,0 +8,0 @@  |
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
var CUSTOMERS, app, assert, base_url, connect, express, freeport, querystring, slumber, url; | ||
var CUSTOMERS, app, assert, base_url, bodyParser, express, freeport, querystring, slumber, url; | ||
@@ -13,6 +13,6 @@ querystring = require('querystring'); | ||
connect = require('connect'); | ||
freeport = require('freeport'); | ||
bodyParser = require('body-parser'); | ||
slumber = require('..'); | ||
@@ -42,5 +42,5 @@ | ||
app.use(connect.urlencoded()); | ||
app.use(bodyParser.urlencoded()); | ||
app.use(connect.json()); | ||
app.use(bodyParser.json()); | ||
@@ -47,0 +47,0 @@ app.get('/', function(req, res) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
73385
2.91%24
9.09%1184
4.41%106
-4.5%1
Infinity%+ Added
- Removed
Updated
Updated
Updated