crex
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -9,3 +9,4 @@ var api = require('./api'); | ||
url: 'localhost', | ||
port: '4502' | ||
port: '4502', | ||
proxy: process.env.https_proxy || process.env.http_proxy | ||
}; | ||
@@ -29,2 +30,3 @@ | ||
this.port = options.port; | ||
this.proxy = options.proxy; | ||
@@ -44,3 +46,3 @@ this.full = this.user + ':' + this.password + '@' + this.url + ':' + this.port; | ||
var url = this.url; | ||
return this.port !== '' ? url + ':' + this.port : url; | ||
return (this.port !== '' ? url + ':' + this.port : url) + (this.proxy ? ' (proxy: ' + this.proxy + ')' : ''); | ||
} | ||
@@ -70,3 +72,3 @@ | ||
return req(url, args); | ||
return req(url, args, this.proxy); | ||
}; | ||
@@ -73,0 +75,0 @@ |
var request = require('superagent'); | ||
require('superagent-proxy')(request); | ||
var checkProxy = function(req, proxy) { | ||
return proxy ? req.proxy(proxy) : req; | ||
}; | ||
var nodeBinaryParser = function (res, done) { | ||
@@ -14,6 +19,5 @@ res.setEncoding('binary'); | ||
var doGet = function (url, args) { | ||
var doGet = function (url, args, proxy) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.get(url) | ||
checkProxy(request.get(url), proxy) | ||
.query(args) | ||
@@ -31,6 +35,5 @@ .buffer(true) | ||
var doPost = function(url, args) { | ||
var doPost = function(url, args, proxy) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.post(url) | ||
checkProxy(request.post(url), proxy) | ||
.type('form') | ||
@@ -48,6 +51,5 @@ .send(args) | ||
var doDelete = function(url, args) { | ||
var doDelete = function(url, args, proxy) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.delete(url) | ||
checkProxy(request.delete(url), proxy) | ||
.query(args) | ||
@@ -64,6 +66,5 @@ .end(function (err, res) { | ||
var doUpload = function(url, args) { | ||
var doUpload = function(url, args, proxy) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.post(url) | ||
checkProxy(request.post(url), proxy) | ||
.attach('file', args['file']) | ||
@@ -80,6 +81,5 @@ .end(function (err, res) { | ||
var doDownload = function(url, args) { | ||
var doDownload = function(url, args, proxy) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.get(url) | ||
checkProxy(request.get(url), proxy) | ||
.query(args) | ||
@@ -86,0 +86,0 @@ .buffer(true) |
{ | ||
"name": "crex", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "Creative Exchange SDK for Javascript", | ||
@@ -12,4 +12,4 @@ "author": "Mateusz Luczak <mateusz.luczak@outlook.com>", | ||
}, | ||
"engines" : { | ||
"node" : ">=6.10.0" | ||
"engines": { | ||
"node": ">=6.10.0" | ||
}, | ||
@@ -30,5 +30,4 @@ "homepage": "http://www.cognifide.com/our-technology/zengarden", | ||
"scripts": { | ||
"build": "npm run build:module && npm run build:browser", | ||
"build": "npm run build:module", | ||
"build:module": "webpack", | ||
"build:browser": "webpack -p --config webpack.config.umd.js", | ||
"jsdoc": "jsdoc -c ./conf.json -d generated-docs -t ./node_modules/ink-docstrap/template -R docs/README.md -r ./lib", | ||
@@ -52,2 +51,3 @@ "publish-docs": "rm -rf generated-docs && npm run jsdoc && gh-pages -d generated-docs", | ||
"mocha": "^3.3.0", | ||
"socks-proxy-agent": "^3.0.1", | ||
"webpack": "^2.4.1" | ||
@@ -64,4 +64,5 @@ }, | ||
"superagent": "^3.5.2", | ||
"superagent-proxy": "^1.0.2", | ||
"yazl": "^2.4.2" | ||
} | ||
} |
@@ -9,3 +9,3 @@ ![Cognifide logo](http://cognifide.github.io/images/cognifide-logo.png) | ||
<p align="center"> | ||
<img width="200px" alt="Zen Garden logo" src="http://zg4.cognifide.com/content/dam/4.0%20Release%20Notes/logo.svg"> | ||
<img width="300px" alt="Zen Garden logo" src="http://assets.cognifide.com/zg/logos/ce-sdk.png"> | ||
</p> | ||
@@ -12,0 +12,0 @@ <br> |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
2076212
48183
10
9
12
4
1
+ Addedsuperagent-proxy@^1.0.2
+ Addedagent-base@4.3.0(transitive)
+ Addedast-types@0.16.1(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedco@4.6.0(transitive)
+ Addeddata-uri-to-buffer@1.2.0(transitive)
+ Addeddebug@2.6.93.1.0(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddegenerator@1.0.4(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedes6-promise@4.2.8(transitive)
+ Addedes6-promisify@5.0.0(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@3.1.34.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedftp@0.3.10(transitive)
+ Addedget-uri@2.0.4(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhttp-proxy-agent@2.1.0(transitive)
+ Addedhttps-proxy-agent@2.2.4(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedip@1.1.9(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedms@2.0.0(transitive)
+ Addednetmask@1.0.6(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedpac-proxy-agent@2.0.2(transitive)
+ Addedpac-resolver@3.0.0(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedproxy-agent@2.3.1(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedsmart-buffer@1.1.15(transitive)
+ Addedsocks@1.1.10(transitive)
+ Addedsocks-proxy-agent@3.0.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedsuperagent-proxy@1.0.3(transitive)
+ Addedthunkify@2.1.2(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtslib@2.6.3(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxregexp@2.0.0(transitive)
+ Addedyallist@2.1.2(transitive)