UNPKG

synergia-jira-connector

Version:

Easy to use NodeJS wrapper for the Jira REST API.

33 lines (29 loc) 899 B
"use strict"; module.exports = LicenseValidatorClient; /** * Used to access Jira REST endpoints in '/rest/api/2/licenseValidator' * * @param {JiraClient} jiraClient * @constructor LicenseValidatorClient */ function LicenseValidatorClient (jiraClient) { this.jiraClient = jiraClient; /** * * @method validateLicense * @memberOf LicenseValidatorClient# * @param opts The request options sent to the Jira API. * @param opts.license The license to validate. * @param callback Called when the license has been validated, or fails to validate. */ this.validateLicense = function (opts, callback) { var options = { uri: this.jiraClient.buildURL('/licenseValidator'), method: 'POST', json: true, followAllRedirects: true, body: opts.license }; this.jiraClient.makeRequest(options, callback); } }