harrogateclient
Version:
A simple node.js client for Kipr Harrogate on their Wallaby's.
3,214 lines (818 loc) • 33.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: HarrogateClient</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: HarrogateClient</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>HarrogateClient<span class="signature">(ip)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="HarrogateClient"><span class="type-signature"></span>new HarrogateClient<span class="signature">(ip)</span><span class="type-signature"></span></h4>
<div class="description">
Creates a HarrogateClient object
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ip</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The ip adress/url of the Harrogate Server</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line209">line 209</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="url"><span class="type-signature"></span>url<span class="type-signature"> :string</span></h4>
<div class="description">
url of the Harrogate Server
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line218">line 218</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addFile"><span class="type-signature"></span>addFile<span class="signature">(username, project, dir, name)</span><span class="type-signature"> → {Promise.<<a href="File.html">File</a>, error>}</span></h4>
<div class="description">
Adds a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>project</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
<tr>
<td class="name"><code>dir</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the directory</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the file</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line487">line 487</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<<a href="File.html">File</a>, error></span>
</dd>
</dl>
<h4 class="name" id="addFilePath"><span class="type-signature"></span>addFilePath<span class="signature">(filepath)</span><span class="type-signature"> → {Promise.<<a href="File.html">File</a>, error>}</span></h4>
<div class="description">
Adds a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filepath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path of the file</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line511">line 511</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<<a href="File.html">File</a>, error></span>
</dd>
</dl>
<h4 class="name" id="addProject"><span class="type-signature"></span>addProject<span class="signature">(username, projectname)</span><span class="type-signature"> → {Promise.<<a href="Project.html">Project</a>, error>}</span></h4>
<div class="description">
Adds a project.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>projectname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the new project</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line343">line 343</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<<a href="Project.html">Project</a>, error></span>
</dd>
</dl>
<h4 class="name" id="addUser"><span class="type-signature"></span>addUser<span class="signature">(username)</span><span class="type-signature"> → {Promise.<<a href="User.html">User</a>, error>}</span></h4>
<div class="description">
Adds a new Uuer.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line250">line 250</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<<a href="User.html">User</a>, error></span>
</dd>
</dl>
<h4 class="name" id="allProjects"><span class="type-signature"></span>allProjects<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="Project.html">Project</a>>, error>}</span></h4>
<div class="description">
Gets the projects of all users.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line289">line 289</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<<a href="Project.html">Project</a>>, error></span>
</dd>
</dl>
<h4 class="name" id="compile"><span class="type-signature"></span>compile<span class="signature">(username, projectname)</span><span class="type-signature"> → {Promise.<{stdout: string, stderr: string}, error>}</span></h4>
<div class="description">
Compiles a project.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>projectname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line389">line 389</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<{stdout: string, stderr: string}, error></span>
</dd>
</dl>
<h4 class="name" id="deleteFile"><span class="type-signature"></span>deleteFile<span class="signature">(username, project, dir, name)</span><span class="type-signature"> → {Promise.<void, error>}</span></h4>
<div class="description">
Deletes a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>project</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
<tr>
<td class="name"><code>dir</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the directory</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the file</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line525">line 525</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void, error></span>
</dd>
</dl>
<h4 class="name" id="deleteFilePath"><span class="type-signature"></span>deleteFilePath<span class="signature">(filepath)</span><span class="type-signature"> → {Promise.<void, error>}</span></h4>
<div class="description">
Deletes a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filepath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path of the file</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line534">line 534</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void, error></span>
</dd>
</dl>
<h4 class="name" id="deleteProject"><span class="type-signature"></span>deleteProject<span class="signature">(username, projectname)</span><span class="type-signature"> → {Promise.<void, error>}</span></h4>
<div class="description">
Deletes a project.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>projectname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line372">line 372</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void, error></span>
</dd>
</dl>
<h4 class="name" id="deleteUser"><span class="type-signature"></span>deleteUser<span class="signature">(username)</span><span class="type-signature"> → {Promise.<void, error>}</span></h4>
<div class="description">
Deletes an user.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line272">line 272</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void, error></span>
</dd>
</dl>
<h4 class="name" id="getProjectInformation"><span class="type-signature"></span>getProjectInformation<span class="signature">(username, project)</span><span class="type-signature"> → {Promise.<<a href="ProjectInfo.html">ProjectInfo</a>, error>}</span></h4>
<div class="description">
Gets information of a project.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>project</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line412">line 412</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<<a href="ProjectInfo.html">ProjectInfo</a>, error></span>
</dd>
</dl>
<h4 class="name" id="getProjects"><span class="type-signature"></span>getProjects<span class="signature">(username)</span><span class="type-signature"> → {Promise.<Array.<<a href="Project.html">Project</a>>, error>}</span></h4>
<div class="description">
Gets the projects of a specific user.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line316">line 316</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<<a href="Project.html">Project</a>>, error></span>
</dd>
</dl>
<h4 class="name" id="getUsers"><span class="type-signature"></span>getUsers<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="User.html">User</a>>, error>}</span></h4>
<div class="description">
Gets an array of all users.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line226">line 226</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<<a href="User.html">User</a>>, error></span>
</dd>
</dl>
<h4 class="name" id="loadFile"><span class="type-signature"></span>loadFile<span class="signature">(username, project, dir, name)</span><span class="type-signature"> → {Promise.<string, error>}</span></h4>
<div class="description">
Loads the content of a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>project</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
<tr>
<td class="name"><code>dir</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the directory</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the file</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line457">line 457</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<string, error></span>
</dd>
</dl>
<h4 class="name" id="loadFilePath"><span class="type-signature"></span>loadFilePath<span class="signature">(filepath)</span><span class="type-signature"> → {Promise.<string, error>}</span></h4>
<div class="description">
Loads the content of a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filepath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path of the file</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line466">line 466</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<string, error></span>
</dd>
</dl>
<h4 class="name" id="saveFile"><span class="type-signature"></span>saveFile<span class="signature">(username, project, dir, name, content)</span><span class="type-signature"> → {Promise.<void, error>}</span></h4>
<div class="description">
Saves a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the user</td>
</tr>
<tr>
<td class="name"><code>project</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the project</td>
</tr>
<tr>
<td class="name"><code>dir</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the directory</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the file</td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">contant to save</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line551">line 551</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void, error></span>
</dd>
</dl>
<h4 class="name" id="saveFilePath"><span class="type-signature"></span>saveFilePath<span class="signature">(filepath, content)</span><span class="type-signature"> → {Promise.<void, error>}</span></h4>
<div class="description">
Saves a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filepath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path of the file</td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">contant to save</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line561">line 561</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void, error></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="File.html">File</a></li><li><a href="HarrogateClient.html">HarrogateClient</a></li><li><a href="Project.html">Project</a></li><li><a href="ProjectInfo.html">ProjectInfo</a></li><li><a href="User.html">User</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Feb 23 2018 14:24:20 GMT+0100 (Mitteleuropäische Zeit)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>