Comparing version 0.3.3 to 0.3.4
16
ovh.js
@@ -22,3 +22,3 @@ // | ||
function OVHWS(wsList, apiKeys) { | ||
function OVHWS(wsList, apiKeys, options) { | ||
this.apiKeys = { appKey: apiKeys.appKey, appSecret: apiKeys.appSecret, | ||
@@ -28,2 +28,3 @@ consumerKey: apiKeys.consumerKey || null }; | ||
this.wsMetas = {}; | ||
this.options = options; | ||
@@ -358,2 +359,11 @@ // Check and add implicit params in wsList | ||
if (typeof(this.options.timeout) === 'number') { | ||
req.on('socket', function (socket) { | ||
socket.setTimeout(_this.options.timeout); | ||
socket.on('timeout', function() { | ||
req.abort(); | ||
}); | ||
}); | ||
} | ||
if (typeof(params) === 'object' && Object.keys(params).length > 0) { | ||
@@ -479,6 +489,6 @@ req.write(JSON.stringify(params)); | ||
module.exports = function (wsList, apiKeys) { | ||
return new OVHWS(wsList, apiKeys || {}); | ||
module.exports = function (wsList, apiKeys, options) { | ||
return new OVHWS(wsList, apiKeys || {}, options || {}); | ||
}; | ||
}).call(this); |
{ | ||
"name": "ovh", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "An helper library to use OVH web services and REST APIs", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/gierschv/node-ovh", |
@@ -152,9 +152,17 @@ node-ovh | ||
### 0.3.4 | ||
* Add timeout option for REST API. | ||
### 0.3.3 | ||
* Fixes requests signature. | ||
### 0.3.2 | ||
* Tested with node v0.10 | ||
* Tested with node v0.10. | ||
### 0.3.1 | ||
* Fix for node v0.9.8 | ||
* Fix for node v0.9.8. | ||
@@ -161,0 +169,0 @@ ### 0.3.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
42454
824
202