Skip to content

Commit

Permalink
Release 2.1.2 (#38)
Browse files Browse the repository at this point in the history
* escape all qs params (#37)

* build 2.1.2 and run docs
  • Loading branch information
Tidwell authored Jul 9, 2018
1 parent d939f8d commit d519201
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 27 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### 2.1.2
- Force escaping of all url params (#34)

### 2.1.1
- Fix bug preventing match_id and participant_id passed as underscore properties for URL generation #32
- Fix bug preventing match_id and participant_id passed as underscore properties for URL generation (#32)

### 2.1.0
- Fix null values being returned as empty objects (#24)
Expand Down
2 changes: 1 addition & 1 deletion docs/Client.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ <h6>Properties</h6>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Matches.html
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ <h6>Properties</h6>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Participants.html
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ <h6>Properties</h6>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Tournaments.html
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,7 @@ <h6>Properties</h6>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
5 changes: 2 additions & 3 deletions docs/api_client.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ <h1 class="page-title">api/client.js</h1>
const serialized = util.serializeToQSParams(obj);

path = versionPaths[this.options.get('version')] + (path ? path : '') + '.' + this.options.get('format') + '?' + serialized;

// create options for the https call
const options = {
hostname: 'api.challonge.com',
path: path,
path: encodeURI(path),
method: method,
headers: {
'Content-Length': 0 // server throws nginx error without a content-length
Expand Down Expand Up @@ -180,7 +179,7 @@ <h1 class="page-title">api/client.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/api_error-handler.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h1 class="page-title">api/error-handler.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/api_matches.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h1 class="page-title">api/matches.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/api_participants.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ <h1 class="page-title">api/participants.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/api_tournaments.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ <h1 class="page-title">api/tournaments.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/challonge.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h1 class="page-title">challonge.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3>Branching</h3><p><code>master</code> is the active development branch</p>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-ErrorHandler.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-Util.html
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/param-serializer.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h1 class="page-title">param-serializer.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/util.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h1 class="page-title">util.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 09 2018 17:18:03 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
3 changes: 1 addition & 2 deletions lib/api/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ Client.prototype.makeRequest = function(obj) {
const serialized = util.serializeToQSParams(obj);

path = versionPaths[this.options.get('version')] + (path ? path : '') + '.' + this.options.get('format') + '?' + serialized;

// create options for the https call
const options = {
hostname: 'api.challonge.com',
path: path,
path: encodeURI(path),
method: method,
headers: {
'Content-Length': 0 // server throws nginx error without a content-length
Expand Down
21 changes: 20 additions & 1 deletion lib/api/client.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,26 @@ describe('Client Class', () => {

expect(httpsMock.opts).toEqual({
hostname: 'api.challonge.com',
path: '/v1/tournaments/some/path.json?randomprop=thingie&some_property[another_property]=anotherthing&api_key=mykey&cache_bust=1',
path: '/v1/tournaments/some/path.json?randomprop=thingie&some_property%5Banother_property%5D=anotherthing&api_key=mykey&cache_bust=1',
method: 'GET',
headers: {
'Content-Length': 0
}
});
});

it('should make a request with escaped data for extended characters', () => {
spyOn(Math, 'random').and.returnValue(1);
client.options.apiKey = 'mykey';
client.makeRequest({
path: '/some/path',
method: 'GET',
randomprop: '扶摇ståleSÓLO独播'
});

expect(httpsMock.opts).toEqual({
hostname: 'api.challonge.com',
path: '/v1/tournaments/some/path.json?randomprop=%E6%89%B6%E6%91%87st%C3%A5leS%C3%93LO%E7%8B%AC%E6%92%AD&api_key=mykey&cache_bust=1',
method: 'GET',
headers: {
'Content-Length': 0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Wrapper for the challong api",
"author": "Aaron Tiwell <[email protected]>",
"main": "./lib/challonge.js",
"version": "2.1.1",
"version": "2.1.2",
"contributors": [
{
"name": "Ricardo Reis",
Expand Down
8 changes: 4 additions & 4 deletions test/full.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var client = challonge.createClient({
version: 1,
});

var tourneyName = 'new_api_test' + Math.floor(Math.random()*10000);
var tourneyName = 'new_api_test扶摇ståleSÓLO独播' + Math.floor(Math.random()*10000);

client.tournaments.create({
tournament: {
Expand All @@ -31,15 +31,15 @@ function update() {
url: tourneyName,
signupCap: 16,
tournamentType: 'double elimination',
description: 'some new description',
description: 'some new description扶摇ståleSÓLO独播',
acceptAttachments: true

},
callback: function(err,data){
if (err) { console.log(err); return; }
console.log(data);

pcreate('player1');
pcreate('player1扶摇ståleSÓLO独播');
}
});
}
Expand All @@ -53,7 +53,7 @@ function pcreate(name) {
callback: function(err,data){
if (err) { console.log(err); return; }
console.log(data);
if (name === 'player1') {
if (name === 'player1扶摇ståleSÓLO独播') {
pcreate('player2');
} else {
start();
Expand Down

0 comments on commit d519201

Please sign in to comment.