glesys-api
Advanced tools
Comparing version 2.2.0 to 2.2.1
# Changelog | ||
## 2.2.1 (2017-06-17) | ||
* Safer building of API URLs. | ||
* Replaced `istanbul` with `nyc` | ||
* Updated `got` to `7.x`. | ||
* Updated dev dependencies. | ||
* Tests are run on Node 8. | ||
## 2.2.0 (2016-11-27) | ||
@@ -3,0 +10,0 @@ * Supported Node versions are now specified in the `engines` field. |
'use strict'; | ||
const url = require('url'); | ||
const got = require('got'); | ||
@@ -16,3 +17,3 @@ | ||
get (url, data) { | ||
get (uri, data) { | ||
const options = { | ||
@@ -23,8 +24,6 @@ method: 'GET', | ||
url = this.baseUrl + url; | ||
return this.request(url, options); | ||
return this.request(uri, options); | ||
} | ||
post (url, data) { | ||
post (uri, data) { | ||
const options = { | ||
@@ -35,8 +34,6 @@ body: data, | ||
url = this.baseUrl + url; | ||
return this.request(url, options); | ||
return this.request(uri, options); | ||
} | ||
request (url, options) { | ||
request (uri, options) { | ||
let token = `${ this.apiUser }:${ this.apiKey }`; | ||
@@ -46,4 +43,4 @@ | ||
* We check for Buffer.alloc since Buffer.from will always be true | ||
* because it's inherithing from Uint8Array and checking for Buffer.alloc | ||
* is fine as it was added at the same time. | ||
* because it's inherithing from Uint8Array. Checking for Buffer.alloc | ||
* is fine as it was added at the same time as Buffer.from. | ||
*/ | ||
@@ -54,2 +51,3 @@ | ||
const fullUrl = url.resolve(this.baseUrl, uri); | ||
const defaults = { | ||
@@ -64,3 +62,3 @@ headers: { | ||
return got(url, options); | ||
return got(fullUrl, options); | ||
} | ||
@@ -67,0 +65,0 @@ } |
{ | ||
"name": "glesys-api", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Node.js wrapper for the GleSYS API.", | ||
@@ -24,19 +24,19 @@ "main": "lib/glesys.js", | ||
"dependencies": { | ||
"got": "^6.3.0" | ||
"got": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.4", | ||
"eslint": "^3.0.0", | ||
"eslint-config-jwilsson": "jwilsson/eslint-config", | ||
"istanbul": "^0.4.3", | ||
"eslint": "^4.0.0", | ||
"eslint-config-jwilsson": "^2.0.1", | ||
"mocha": "^3.0.0", | ||
"sinon": "^1.16.1" | ||
"nyc": "^11.0.1", | ||
"sinon": "^2.0.0" | ||
}, | ||
"scripts": { | ||
"cover": "istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", | ||
"cover": "nyc report --reporter=text-lcov | coveralls", | ||
"pretest": "eslint lib test", | ||
"test": "mocha" | ||
"test": "nyc mocha" | ||
}, | ||
"eslintConfig": { | ||
"extends": "eslint-config-jwilsson/node.json" | ||
"extends": "eslint-config-jwilsson/node" | ||
}, | ||
@@ -43,0 +43,0 @@ "license": "MIT", |
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
46140
+ Addeddecompress-response@3.3.0(transitive)
+ Addedgot@7.1.0(transitive)
+ Addedhas-symbol-support-x@1.4.2(transitive)
+ Addedhas-to-string-tag-x@1.4.1(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedisurl@1.0.0(transitive)
+ Addedmimic-response@1.0.1(transitive)
+ Addedp-cancelable@0.3.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-timeout@1.2.1(transitive)
+ Addedurl-to-options@1.0.1(transitive)
- Removedcapture-stack-trace@1.0.2(transitive)
- Removedcreate-error-class@3.0.2(transitive)
- Removedgot@6.7.1(transitive)
- Removedis-redirect@1.0.0(transitive)
- Removedunzip-response@2.0.1(transitive)
Updatedgot@^7.0.0