<tdclass="description last">configuration options for this instance</td>
<tdclass="description last">configuration options for this instance
<h6>Properties</h6>
<tableclass="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>apiKey</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last">Your challonge API Key</td>
</tr>
<tr>
<tdclass="name"><code>subdomain</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last">Sets the subdomain and automatically passes tournament[subdomain] and prefixes the subdomain to tournament urls. If you don't want to pass a subdomain to the constructor, and want to use an organization (or multiple organizations), you must use client.setSubdomain('subdomain') before making api calls.</td>
</tr>
<tr>
<tdclass="name"><code>format</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last">The format of the response data. Defaults to 'json'. If set to 'json', will return javascript objects. Anything else (including 'xml') will return the raw text string.</td>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
* @param {object} options configuration options for this instance
* @param {string} options.apiKey Your challonge API Key
* @param {string} [options.subdomain] - Sets the subdomain and automatically passes tournament[subdomain] and prefixes the subdomain to tournament urls. If you don't want to pass a subdomain to the constructor, and want to use an organization (or multiple organizations), you must use client.setSubdomain('subdomain') before making api calls.
* @param {string} [options.format] The format of the response data. Defaults to 'json'. If set to 'json', will return javascript objects. Anything else (including 'xml') will return the raw text string.
* @param {boolean} [options.massageProperties] If the response object should be massaged into camelCase properties when using json format. Defaults to true.
* @description
* Constructor function for the Client base responsible for communicating with Challonge API
* createClient takes one argument for configuration and returns an instance of the api client.
* You should never need to call new Client(). Instead, call challonge.createClient() and it will create
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
* @param {object} options configuration options for this instance
* @param {string} options.apiKey Your challonge API Key
* @param {string} [options.subdomain] - Sets the subdomain and automatically passes tournament[subdomain] and prefixes the subdomain to tournament urls. If you don't want to pass a subdomain to the constructor, and want to use an organization (or multiple organizations), you must use client.setSubdomain('subdomain') before making api calls.
* @param {string} [options.format] The format of the response data. Defaults to 'json'. If set to 'json', will return javascript objects. Anything else (including 'xml') will return the raw text string.
* @param {boolean} [options.massageProperties] If the response object should be massaged into camelCase properties when using json format. Defaults to true.
* @returns {object} new api client instance
* @description
* Generates a new API client.
* @example
const challonge = require('challonge');
const client = challonge.createClient({
apiKey: '***yourAPIKey***'
});
*/
exports.createClient = function createClient(options) {
const client = {};
...
...
@@ -80,7 +89,7 @@ exports.createClient = function createClient(options) {
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
<tdclass="description last">configuration options for this instance</td>
<tdclass="description last">configuration options for this instance
<h6>Properties</h6>
<tableclass="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>apiKey</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last">Your challonge API Key</td>
</tr>
<tr>
<tdclass="name"><code>subdomain</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last">Sets the subdomain and automatically passes tournament[subdomain] and prefixes the subdomain to tournament urls. If you don't want to pass a subdomain to the constructor, and want to use an organization (or multiple organizations), you must use client.setSubdomain('subdomain') before making api calls.</td>
</tr>
<tr>
<tdclass="name"><code>format</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last">The format of the response data. Defaults to 'json'. If set to 'json', will return javascript objects. Anything else (including 'xml') will return the raw text string.</td>
<tdclass="description last">If the response object should be massaged into camelCase properties when using json format. Defaults to true.</td>
</tr>
</tbody>
</table>
</td>
</tr>
...
...
@@ -283,7 +450,7 @@
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
});</code></pre><h2>API Client</h2><p><em>createClient</em> takes one argument for configuration and returns an instance of the api client. The configuration object can contain the following options:</p>
<ul>
<li><p><code>apiKey</code> string (required) - Your challonge API Key</p>
</li>
<li><p><code>subdomain</code> string (optional) - Setting the subdomain automatically passes tournament[subdomain] and prefixes the subdomain to tournament urls. If you don't want to pass a subdomain to the constructor, and want to use an organization (or multiple organizations), you must use client.setSubdomain('subdomain') before making api calls.</p>
</li>
<li><p><code>format</code> string (optional) - The format of the response data. Defaults to 'json'. If set to 'json', will return javascript objects. 'xml' will return the raw text string.</p>
</li>
<li><p><code>massageProperties</code> boolean (optional) - If the response object should be massaged into camelCase properties when using json format. Defaults to true.</p>
</li>
</ul>
<p>The wrapper is organized into resource.method to match the API</p>
});</code></pre><h2>API Client</h2><p>The wrapper is organized into resource.method to match the API</p>
<p>For API calls that require nested params (eg: http://api.challonge.com/v1/documents/tournaments/create) properties should be specified as a nested object:</p>
<preclass="prettyprint source lang-js"><code>{
tournament: {
...
...
@@ -114,7 +103,7 @@ client.tournaments.create({
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Converts a string from underscore_case to camelCase
Converts all the keys of an object by a conversionFn and returns a new object with the updated properties
</div>
...
...
@@ -857,7 +857,7 @@
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
@@ -74,7 +74,7 @@ function underscoreToCamel(str) {
* @param {object} [newObject] the new object that is assembled (used in recursive calls)
* @return {object} a new object with the properties massaged by conversionFn
* @description
* Converts a string from underscore_case to camelCase
* Converts all the keys of an object by a conversionFn and returns a new object with the updated properties
*/
function convert(obj, conversionFn, newObject) {
if (!obj) {
...
...
@@ -121,7 +121,7 @@ module.exports = {
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:24:42 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 01:36:24 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.