heroku-client
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -15,2 +15,10 @@ # organization | ||
### `info` | ||
`heroku.organizations({organization_name}).info({callback});` | ||
Method | Path | ||
--- | --- | ||
GET | /organizations/{organization_name} | ||
### `update` | ||
@@ -17,0 +25,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var lazy = require('lazy.js'); | ||
var logfmt = require('logfmt'); | ||
var q = require('q'); | ||
@@ -22,7 +23,13 @@ var cache; | ||
function Request(options, callback) { | ||
this.options = options || {}; | ||
this.host = options.host || 'api.heroku.com'; | ||
this.callback = callback; | ||
this.deferred = q.defer(); | ||
this.options = options || {}; | ||
this.host = options.host || 'api.heroku.com'; | ||
this.log = options.log; | ||
this.callback = callback; | ||
this.deferred = q.defer(); | ||
this.nextRange = 'id ]..; max=1000'; | ||
this.logger = logfmt.namespace({ | ||
source: 'heroku-client', | ||
method: options.method || 'GET', | ||
path : options.path | ||
}).time(); | ||
} | ||
@@ -143,2 +150,4 @@ | ||
this.logResponse(res); | ||
if (res.statusCode === 304 && this.cachedResponse) { | ||
@@ -167,2 +176,16 @@ if (this.cachedResponse.nextRange) { | ||
/* | ||
* Log the API response. | ||
*/ | ||
Request.prototype.logResponse = function logResponse(res) { | ||
if (this.log) { | ||
this.logger.log({ | ||
status : res.statusCode, | ||
content_length: res.headers['content-length'], | ||
request_id : res.headers['request-id'] | ||
}); | ||
} | ||
}; | ||
/* | ||
* If the request options include a body, | ||
@@ -169,0 +192,0 @@ * write the body to the request and set |
{ | ||
"name": "heroku-client", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "A wrapper for the Heroku v3 API", | ||
@@ -38,6 +38,6 @@ "main": "./lib/heroku.js", | ||
"path-proxy": "~1.0", | ||
"simple-encryptor": "^1.0.2" | ||
"simple-encryptor": "^1.0.2", | ||
"logfmt": "^1.1.2" | ||
}, | ||
"jshintConfig": { | ||
"camelcase": true, | ||
"curly": true, | ||
@@ -44,0 +44,0 @@ "eqeqeq": true, |
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
255003
55
7145
8
+ Addedlogfmt@^1.1.2
+ Addedlogfmt@1.4.0(transitive)
+ Addedsplit@0.2.10(transitive)
+ Addedthrough@2.3.8(transitive)