clubhouse-lib
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -7,6 +7,12 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _queryString = require('query-string'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
require('fetch-everywhere'); | ||
var TokenRequestFactory = function () { | ||
@@ -25,3 +31,2 @@ function TokenRequestFactory(token) { | ||
var urlWithToken = url + '?token=' + this.token; | ||
var headers = { | ||
@@ -31,5 +36,16 @@ Accept: 'application/json', | ||
}; | ||
var params = _extends({}, body, { | ||
token: this.token | ||
}); | ||
return new Request(urlWithToken, { | ||
body: JSON.stringify(body), | ||
if (method === 'GET') { | ||
var resolvedURL = url + '?' + (0, _queryString.stringify)(params); | ||
return new Request(resolvedURL, { | ||
headers: headers, | ||
method: method | ||
}); | ||
} | ||
return new Request(url, { | ||
body: JSON.stringify(params), | ||
headers: headers, | ||
@@ -36,0 +52,0 @@ method: method |
{ | ||
"name": "clubhouse-lib", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A Promise based library to the Clubhouse REST API", | ||
@@ -56,4 +56,5 @@ "files": [ | ||
"dependencies": { | ||
"fetch-everywhere": "^1.0.5" | ||
"fetch-everywhere": "^1.0.5", | ||
"query-string": "^6.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
32879
400
2
+ Addedquery-string@^6.2.0
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addedfilter-obj@1.1.0(transitive)
+ Addedquery-string@6.14.1(transitive)
+ Addedsplit-on-first@1.1.0(transitive)
+ Addedstrict-uri-encode@2.0.0(transitive)