oriskami
Advanced tools
Comparing version 1.14.0 to 1.15.0
@@ -1,5 +0,5 @@ | ||
var path = require("path") | ||
, fs = require("fs") | ||
, _ = require("lodash") | ||
var _ = require("lodash") | ||
, Resource = require("../Resource") | ||
, bindingName = "Oriskami/v1 NodeBindings/" | ||
, httpTimeout = 120000 | ||
@@ -12,25 +12,18 @@ /* | ||
function Oriskami(token, version, resources){ | ||
var http = require("http") | ||
, pathPackage = "../../package.json" | ||
, pathFingerprints = '../../data/blacklisted_fingerprints' | ||
, theTimeout = http.createServer().timeout | ||
, theVersion = version || "*" | ||
, theName = "Oriskami/v1 NodeBindings/" + theVersion | ||
, theRevokedCerts = fs.readFileSync(path.join(__dirname, pathFingerprints) | ||
, 'utf8').replace(/^\s+|\s+$/g, '').split('\n') | ||
version = version || "*" | ||
this._api = { | ||
"protocol" : "https" | ||
, "timeout" : theTimeout | ||
, "timeout" : httpTimeout | ||
, "resources" : resources | ||
, "revokedCerts" : theRevokedCerts | ||
, "revokedCerts" : "" | ||
, "headers" : { | ||
"Accept" : "application/json" | ||
, "Content-Type" : "application/json" | ||
, "Accept-Version": theVersion.replace("\n","") | ||
, "User-Agent" : theName.replace("\n","") | ||
, "Accept-Version": version.replace("\n","") | ||
, "User-Agent" : (bindingName + version).replace("\n","") | ||
},"request" : { | ||
"host" : "api.oriskami.com" | ||
, "port" : "443" | ||
, "version" : theVersion | ||
, "version" : version | ||
, "ciphers" : "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5" }} | ||
@@ -53,5 +46,3 @@ | ||
Oriskami.prototype.set = function(key, value){ | ||
if(key === "timeout" && value === null){ | ||
value = (require("http")).createServer().timeout | ||
} | ||
if(key === "timeout") value = value || httpTimeout | ||
this._api[key] = value | ||
@@ -68,5 +59,2 @@ } | ||
/* | ||
* Export the wrapper factory of Oriskami | ||
*/ | ||
module.exports = Oriskami |
var _ = require("lodash") | ||
, encode = encodeURIComponent | ||
, fs = require("fs") | ||
@@ -149,5 +148,2 @@ /* | ||
/* | ||
* Export the Resource factory | ||
*/ | ||
module.exports = Resource |
@@ -9,6 +9,5 @@ /* | ||
, oriskami = this.oriskami | ||
, isSecure = oriskami.get("protocol") === "https" | ||
, opts = oriskami.get("request") | ||
, timeout = oriskami.get("timeout") | ||
, protocol = !!isSecure ? require("https") : require("http") | ||
, protocol = require("https") | ||
, self = this | ||
@@ -15,0 +14,0 @@ , req |
{ | ||
"name": "oriskami", | ||
"version": "1.14.0", | ||
"version": "1.15.0", | ||
"description": "API wrapper to Oriskami", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
2
2
129831
2957