UNPKG

synergia-jira-connector

Version:

Easy to use NodeJS wrapper for the Jira REST API.

169 lines (148 loc) 6.71 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: api/auditing.js</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">Source: api/auditing.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>"use strict"; var errorStrings = require('./../lib/error'); module.exports = AuditingClient; /** * Used to access Jira REST endpoints in '/rest/api/2/auditing' * @param {JiraClient} jiraClient * @constructor AuditingClient */ function AuditingClient(jiraClient) { this.jiraClient = jiraClient; /** * Returns auditing records filtered using provided parameters * * @method getAudits * @memberOf AuditingClient# * @param opts The filtering options for retrieving audits. * @param [opts.offset] The number of record from which search starts * @param [opts.limit] Maximum number of returned results (if is limit is &lt;= 0 or > 1000, it will be set do default * value: 1000) * @param [opts.filter] Text query; each record that will be returned must contain the provided text in one of its * fields * @param [opts.from] Timestamp in past; 'from' must be less or equal 'to', otherwise the result set will be empty * only records that where created in the same moment or after the 'from' timestamp will be provided in * response * @param [opts.to] Timestamp in past; 'from' must be less or equal 'to', otherwise the result set will be empty * only records that where created in the same moment or earlier than the 'to' timestamp will be provided in * response * @param callback Called when the audits are retrieved. */ this.getAudits = function (opts, callback) { var options = { uri: this.jiraClient.buildURL('/auditing/record'), json: true, followAllRedirects: true, method: 'GET', qs: { offset: opts.offset, limit: opts.limit, filter: opts.filter, from: opts.from, to: opts.to } }; this.jiraClient.makeRequest(options, callback); }; /** * * @method createAudit * @memberOf AuditingClient# * @param opts The request options. * @param opts.audit See {@link https://docs.atlassian.com/jira/REST/latest/#d2e2557} * @param callback Called when the audit is created. */ this.createAudit = function (opts, callback) { if (!opts.audit) { throw new Error(errorStrings.NO_AUDIT_ERROR); } var options = { uri: this.jiraClient.buildURL('/auditing/record'), json: true, followAllRedirects: true, method: 'POST', body: opts.audit }; this.jiraClient.makeRequest(options, callback, 'Audit Record Added'); }; }</code></pre> </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="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="ProjectCategoryClient.html">ProjectCategoryClient</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 Tue Oct 27 2015 13:43:13 GMT-0500 (CDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"></script> </body> </html>