heroku-client
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -1,3 +0,2 @@ | ||
var Request = require('./request'), | ||
_ = require('lodash'); | ||
var Request = require('./request'); | ||
@@ -26,2 +25,4 @@ module.exports = Heroku; | ||
Heroku.prototype.request = function request (options, callback) { | ||
var key; | ||
if (typeof options === 'function') { | ||
@@ -31,3 +32,5 @@ callback = options; | ||
} else { | ||
options = _.defaults(options, this.options); | ||
for (key in this.options) { | ||
if (Object.keys(options).indexOf(key) == -1) options[key] = this.options[key]; | ||
} | ||
} | ||
@@ -34,0 +37,0 @@ |
@@ -6,3 +6,2 @@ var https = require('https'), | ||
q = require('q'), | ||
_ = require('lodash'), | ||
cache; | ||
@@ -24,4 +23,2 @@ | ||
this.nextRange = 'id ]..; max=1000'; | ||
_.bindAll(this); | ||
} | ||
@@ -49,3 +46,3 @@ | ||
Request.prototype.request = function request () { | ||
this.getCache(this.performRequest); | ||
this.getCache(this.performRequest.bind(this)); | ||
return this.deferred.promise; | ||
@@ -60,2 +57,3 @@ }; | ||
var headers, | ||
key, | ||
requestOptions, | ||
@@ -66,8 +64,13 @@ req; | ||
headers = _.extend({ | ||
headers = { | ||
'Accept': 'application/vnd.heroku+json; version=3', | ||
'Content-type': 'application/json', | ||
'Range': this.nextRange | ||
}, this.options.headers || {}); | ||
}; | ||
this.options.headers || (this.options.headers = {}); | ||
for (key in this.options.headers) { | ||
headers[key] = this.options.headers[key]; | ||
} | ||
if (this.cachedResponse) { | ||
@@ -87,3 +90,3 @@ headers['If-None-Match'] = this.cachedResponse.etag; | ||
req = https.request(requestOptions, this.handleResponse); | ||
req = https.request(requestOptions, this.handleResponse.bind(this)); | ||
@@ -93,3 +96,3 @@ this.writeBody(req); | ||
req.on('error', this.handleError); | ||
req.on('error', this.handleError.bind(this)); | ||
@@ -96,0 +99,0 @@ req.end(); |
var Heroku = require('./heroku'), | ||
inflection = require('inflection'), | ||
resources = require('./schema').definitions, | ||
_ = require('lodash'); | ||
resources = require('./schema').definitions; | ||
exports.build = function () { | ||
_.each(resources, function (resource, resourceName) { | ||
buildResource(resource); | ||
}); | ||
for (var key in resources) { | ||
buildResource(resources[key]); | ||
} | ||
}; | ||
@@ -15,3 +14,3 @@ | ||
function buildResource (resource) { | ||
_.each(resource.links, buildAction); | ||
resource.links.forEach(buildAction); | ||
} | ||
@@ -45,3 +44,3 @@ | ||
} else if (typeof arguments[0] === 'object') { | ||
options = _.extend(options, { body: body }); | ||
options.body = body; | ||
} | ||
@@ -48,0 +47,0 @@ |
{ | ||
"name": "heroku-client", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "A wrapper for the Heroku v3 API", | ||
@@ -11,3 +11,3 @@ "main": "./lib/heroku.js", | ||
"type": "git", | ||
"url": "https://github.com/jclem/node-heroku-client" | ||
"url": "https://github.com/heroku/node-heroku-client" | ||
}, | ||
@@ -20,9 +20,6 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/jclem/node-heroku-client/issues" | ||
"url": "https://github.com/heroku/node-heroku-client/issues" | ||
}, | ||
"devDependencies": { | ||
"jasmine-node": "~1.11.0", | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-watch": "~0.5.3", | ||
"grunt-shell": "~0.4.0" | ||
"jasmine-node": "~1.11.0" | ||
}, | ||
@@ -32,6 +29,4 @@ "dependencies": { | ||
"memjs": "~0.6.0", | ||
"inflection": "~1.2.6", | ||
"lodash": "~1.3.1", | ||
"grunt": "~0.4.1" | ||
"inflection": "~1.2.6" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
3
1
159468
44
4258
- Removedgrunt@~0.4.1
- Removedlodash@~1.3.1
- Removedabbrev@1.1.1(transitive)
- Removedargparse@0.1.16(transitive)
- Removedasync@0.1.22(transitive)
- Removedcoffee-script@1.3.3(transitive)
- Removedcolors@0.6.2(transitive)
- Removeddateformat@1.0.2-1.2.3(transitive)
- Removedesprima@1.0.4(transitive)
- Removedeventemitter2@0.4.14(transitive)
- Removedexit@0.1.2(transitive)
- Removedfindup-sync@0.1.3(transitive)
- Removedgetobject@0.1.0(transitive)
- Removedglob@3.1.213.2.11(transitive)
- Removedgraceful-fs@1.2.3(transitive)
- Removedgrunt@0.4.5(transitive)
- Removedgrunt-legacy-log@0.1.3(transitive)
- Removedgrunt-legacy-log-utils@0.1.1(transitive)
- Removedgrunt-legacy-util@0.2.0(transitive)
- Removedhooker@0.2.3(transitive)
- Removediconv-lite@0.2.11(transitive)
- Removedinherits@1.0.22.0.4(transitive)
- Removedjs-yaml@2.0.5(transitive)
- Removedlodash@0.9.21.3.12.4.2(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.2.140.3.0(transitive)
- Removednopt@1.0.10(transitive)
- Removedrimraf@2.2.8(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedunderscore@1.7.0(transitive)
- Removedunderscore.string@2.2.12.3.32.4.0(transitive)
- Removedwhich@1.0.9(transitive)