synergia-jira-connector
Version:
Easy to use NodeJS wrapper for the Jira REST API.
1,543 lines (692 loc) • 35.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: JiraClient</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: JiraClient</h1>
<section>
<header>
<h2>
JiraClient
</h2>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="JiraClient"><span class="type-signature"></span>new JiraClient<span
class="signature">(config)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Represents a client for the Jira REST API</p>
</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>config</code></td>
<td class="type">
</td>
<td class="description last"><p>The information needed to access the Jira API</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>host</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The hostname of the Jira API.</p></td>
</tr>
<tr>
<td class="name"><code>protocol</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
https
</td>
<td class="description last"><p>The protocol used to accses the Jira API.</p></td>
</tr>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
443
</td>
<td class="description last"><p>The port number used to connect to Jira.</p></td>
</tr>
<tr>
<td class="name"><code>version</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
2
</td>
<td class="description last"><p>The version of the Jira API to which you will be
connecting. Currently, only
version 2 is supported.</p></td>
</tr>
<tr>
<td class="name"><code>auth</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The authentication information used tp connect to
Jira. Must contain EITHER username and password
OR oauth information. Oauth information will be used over username/password
authentication.</p></td>
</tr>
<tr>
<td class="name"><code>basic_auth.username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The username of the user that will be authenticated.
MUST be included
if using username and password authentication.</p></td>
</tr>
<tr>
<td class="name"><code>basic_auth.password</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The password of the user that will be authenticated.
MUST be included
if using username and password authentication.</p></td>
</tr>
<tr>
<td class="name"><code>oauth.consumer_key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The consumer key used in the Jira Application Link
for oauth
authentication. MUST be included if using OAuth.</p></td>
</tr>
<tr>
<td class="name"><code>oauth.private_key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The private key used for OAuth security. MUST be
included if using OAuth.</p></td>
</tr>
<tr>
<td class="name"><code>oauth.token</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The VERIFIED token used to connect to the Jira API.
MUST be included if using
OAuth.</p></td>
</tr>
<tr>
<td class="name"><code>oauth.token_secret</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The secret for the above token. MUST be included if
using Oauth.</p></td>
</tr>
<tr>
<td class="name"><code>cookie_jar</code></td>
<td class="type">
<span class="param-type">CookieJar</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The CookieJar to use for every requests.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>issue</code></td>
<td class="type">
<span class="param-type"><a href="IssueClient.html">IssueClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>applicationProperties</code></td>
<td class="type">
<span class="param-type"><a href="ApplicationPropertiesClient.html">ApplicationPropertiesClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>attachment</code></td>
<td class="type">
<span class="param-type"><a href="AttachmentClient.html">AttachmentClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>auditing</code></td>
<td class="type">
<span class="param-type"><a href="AuditingClient.html">AuditingClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>avatar</code></td>
<td class="type">
<span class="param-type"><a href="AvatarClient.html">AvatarClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>comment</code></td>
<td class="type">
<span class="param-type"><a href="CommentClient.html">CommentClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>issueLink</code></td>
<td class="type">
<span class="param-type"><a href="IssueLinkClient.html">IssueLinkClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>issueLinkType</code></td>
<td class="type">
<span class="param-type"><a href="IssueLinkTypeClient.html">IssueLinkTypeClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>groups</code></td>
<td class="type">
<span class="param-type"><a href="GroupsClient.html">GroupsClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>groupUserPicker</code></td>
<td class="type">
<span class="param-type"><a
href="GroupUserPickerClient.html">GroupUserPickerClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>customFieldOption</code></td>
<td class="type">
<span class="param-type"><a href="CustomFieldOptionClient.html">CustomFieldOptionClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>jql</code></td>
<td class="type">
<span class="param-type"><a href="JqlClient.html">JqlClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>licenseValidator</code></td>
<td class="type">
<span class="param-type"><a
href="LicenseValidatorClient.html">LicenseValidatorClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>myPermissions</code></td>
<td class="type">
<span class="param-type"><a href="MyPermissionsClient.html">MyPermissionsClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>projectValidate</code></td>
<td class="type">
<span class="param-type"><a
href="ProjectValidateClient.html">ProjectValidateClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>securityLevel</code></td>
<td class="type">
<span class="param-type"><a href="SecurityLevelClient.html">SecurityLevelClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>serverInfo</code></td>
<td class="type">
<span class="param-type"><a href="ServerInfoClient.html">ServerInfoClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>dashboard</code></td>
<td class="type">
<span class="param-type"><a href="DashboardClient.html">DashboardClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type"><a href="FieldClient.html">FieldClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>issueType</code></td>
<td class="type">
<span class="param-type"><a href="IssueTypeClient.html">IssueTypeClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>priority</code></td>
<td class="type">
<span class="param-type"><a href="PriorityClient.html">PriorityClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>reindex</code></td>
<td class="type">
<span class="param-type"><a href="ReindexClient.html">ReindexClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>resolution</code></td>
<td class="type">
<span class="param-type"><a href="ResolutionClient.html">ResolutionClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>search</code></td>
<td class="type">
<span class="param-type"><a href="SearchClient.html">SearchClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>status</code></td>
<td class="type">
<span class="param-type"><a href="StatusClient.html">StatusClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>statusCategory</code></td>
<td class="type">
<span class="param-type"><a href="StatusCategoryClient.html">StatusCategoryClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>licenseRole</code></td>
<td class="type">
<span class="param-type"><a href="LicenseRoleClient.html">LicenseRoleClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>myPreferences</code></td>
<td class="type">
<span class="param-type"><a href="MyPreferencesClient.html">MyPreferencesClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>myself</code></td>
<td class="type">
<span class="param-type"><a href="MyselfClient.html">MyselfClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>password</code></td>
<td class="type">
<span class="param-type"><a href="PasswordClient.html">PasswordClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>settings</code></td>
<td class="type">
<span class="param-type"><a href="SettingsClient.html">SettingsClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>component</code></td>
<td class="type">
<span class="param-type"><a href="ComponentClient.html">ComponentClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>group</code></td>
<td class="type">
<span class="param-type"><a href="GroupClient.html">GroupClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>workflow</code></td>
<td class="type">
<span class="param-type"><a href="WorkflowClient.html">WorkflowClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>filter</code></td>
<td class="type">
<span class="param-type"><a href="FilterClient.html">FilterClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>screens</code></td>
<td class="type">
<span class="param-type"><a href="ScreensClient.html">ScreensClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>version</code></td>
<td class="type">
<span class="param-type"><a href="VersionClient.html">VersionClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>project</code></td>
<td class="type">
<span class="param-type"><a href="ProjectClient.html">ProjectClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>user</code></td>
<td class="type">
<span class="param-type"><a href="UserClient.html">UserClient</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>workflowScheme</code></td>
<td class="type">
<span class="param-type"><a href="WorkflowSchemeClient.html">WorkflowSchemeClient</a></span>
</td>
<td class="description last"></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#line53">line 53</a>
</li>
</ul>
</dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="buildURL"><span class="type-signature"></span>buildURL<span
class="signature">(path)</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
<p>Simple utility to build a REST endpoint URL for the Jira API.</p>
</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>path</code></td>
<td class="type">
</td>
<td class="description last"><p>The path of the URL without concern for the root of the REST
API.</p></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#line208">line 208</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The constructed URL.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="makeRequest"><span class="type-signature"></span>makeRequest<span class="signature">(options, callback, successString<span
class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Make a request to the Jira API and call back with it's response.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"><p>The request options.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"><p>Called with the APIs response.</p></td>
</tr>
<tr>
<td class="name"><code>successString</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If supplied, this is reported instead of the response body.</p></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#line229">line 229</a>
</li>
</ul>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
<ul>
<li><a href="ApplicationPropertiesClient.html">ApplicationPropertiesClient</a></li>
<li><a href="AttachmentClient.html">AttachmentClient</a></li>
<li><a href="AuditingClient.html">AuditingClient</a></li>
<li><a href="AvatarClient.html">AvatarClient</a></li>
<li><a href="CommentClient.html">CommentClient</a></li>
<li><a href="ComponentClient.html">ComponentClient</a></li>
<li><a href="CustomFieldOptionClient.html">CustomFieldOptionClient</a></li>
<li><a href="DashboardClient.html">DashboardClient</a></li>
<li><a href="FieldClient.html">FieldClient</a></li>
<li><a href="FilterClient.html">FilterClient</a></li>
<li><a href="GroupClient.html">GroupClient</a></li>
<li><a href="GroupsClient.html">GroupsClient</a></li>
<li><a href="GroupUserPickerClient.html">GroupUserPickerClient</a></li>
<li><a href="IssueClient.html">IssueClient</a></li>
<li><a href="IssueLinkClient.html">IssueLinkClient</a></li>
<li><a href="IssueLinkTypeClient.html">IssueLinkTypeClient</a></li>
<li><a href="IssueTypeClient.html">IssueTypeClient</a></li>
<li><a href="JiraClient.html">JiraClient</a></li>
<li><a href="JqlClient.html">JqlClient</a></li>
<li><a href="LicenseRoleClient.html">LicenseRoleClient</a></li>
<li><a href="LicenseValidatorClient.html">LicenseValidatorClient</a></li>
<li><a href="MyPermissionsClient.html">MyPermissionsClient</a></li>
<li><a href="MyPreferencesClient.html">MyPreferencesClient</a></li>
<li><a href="MyselfClient.html">MyselfClient</a></li>
<li><a href="PasswordClient.html">PasswordClient</a></li>
<li><a href="PriorityClient.html">PriorityClient</a></li>
<li><a href="ProjectClient.html">ProjectClient</a></li>
<li><a href="ProjectValidateClient.html">ProjectValidateClient</a></li>
<li><a href="ReindexClient.html">ReindexClient</a></li>
<li><a href="ResolutionClient.html">ResolutionClient</a></li>
<li><a href="ScreensClient.html">ScreensClient</a></li>
<li><a href="SearchClient.html">SearchClient</a></li>
<li><a href="SecurityLevelClient.html">SecurityLevelClient</a></li>
<li><a href="ServerInfoClient.html">ServerInfoClient</a></li>
<li><a href="SettingsClient.html">SettingsClient</a></li>
<li><a href="StatusCategoryClient.html">StatusCategoryClient</a></li>
<li><a href="StatusClient.html">StatusClient</a></li>
<li><a href="UserClient.html">UserClient</a></li>
<li><a href="VersionClient.html">VersionClient</a></li>
<li><a href="WorkflowClient.html">WorkflowClient</a></li>
<li><a href="WorkflowSchemeClient.html">WorkflowSchemeClient</a></li>
</ul>
<h3>Namespaces</h3>
<ul>
<li><a href="OauthUtil.html">OauthUtil</a></li>
</ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a> on Sun Aug 09 2015
00:40:20 GMT-0500 (CDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"></script>
</body>
</html>