{"_id":"@codeanker/jira-connector","_rev":"4-c1c6a972897d0ee12cc78d919fd043ab","name":"@codeanker/jira-connector","dist-tags":{"latest":"2.7.0"},"versions":{"2.7.0":{"name":"@codeanker/jira-connector","version":"2.7.0","description":"Easy to use NodeJS wrapper for the Jira REST API.","keywords":["JIRA","REST","OAuth"],"main":".","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Caleb Brinkman","email":"floralvikings@gmail.com"},"license":"MIT","dependencies":{"oauth":"^0.9.12","request":"^2.51.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/floralvikings/jira-connector.git"},"gitHead":"36f1585aa4b4e88bba942985a9d332b5ec235044","bugs":{"url":"https://github.com/floralvikings/jira-connector/issues"},"homepage":"https://github.com/floralvikings/jira-connector#readme","_id":"@codeanker/jira-connector@2.7.0","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"swiatek","email":"daniel.swiatek@codeanker.de"},"dist":{"integrity":"sha512-K/FO1iNbF+3CWRtE0BvfPofI+SgRCeOB8hCDYlWruO40+L3QLPQag20K7fb8/Y9v0P+m9ISesQvbw9nneSNVUg==","shasum":"c22a209236b818a0ac59fbece733995fb5e33d5d","tarball":"https://registry.npmjs.org/@codeanker/jira-connector/-/jira-connector-2.7.0.tgz","fileCount":1162,"unpackedSize":22671221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckiZjCRA9TVsSAnZWagAAs2UP/jd1ziNofOzb+I5+vd5B\naL0a0KpUUNm7kvx82af1xg683Exfblz9BCUS0eslxXr9dGpkNUOTlbJ1mQ53\nmbbb6lPYF9MCWTfPk8Ruv1Tf6tUGqlnT9uqA8uSTM/3f937kFPh1ht9nnmq9\n7lk3FeN+t4JMtjylxrlCVRMo4ZO8JBZvLICvoYZXBEMQEy/dI1nRgswOjE/t\nAW39I2REJQPN9yxBOs1snOWQbDm2xe3wGh8FNbsQV4vfxk1BTzMhsU/kiUcB\nWOje2iwOYXI+iLEtwS27TzYSNGvqC6BkiJTIp9xXLq/MmY++FwEFfdYDbHq5\ng01rjSJvUpb7tyFnc7r6KUZbRPsuJw9f7B4Ho0crf5pQg6uNNfYzUFFSFvqd\nf1p0647MgLM4a2rYaIRuhoEnxhgVMTtTz02awDtq97sU0Y5XvcKAMZ8kb9cM\nl3lE19+0Iup+jCo2hB6oequ1Ox8U/NKL8/tX5J+BjSx+Cz1kBVFF18+qCrj9\nAm0VTz0PgnaKLvrJd/Q2qBSNRCfkfZZh4M8crm8P2iqXewO0L6P5TMMs8yOf\nX8aC2Hl3ROns/0/0uYPElN5bsgW2uZOW0HYgjbM8x7QxoeMEd3Jfj0d4R1mH\nPikZiWvYshmS0rIVCvjuiQ2uLrRhd1GHs+xHCbaK2UO8LGNsafj9eMmN1rDF\nIUDH\r\n=ayB/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqmkY+TtUOiRZtMvchi4DWxf8G9hyE7DY5g+6nP7HXlAIgfsjQvqkoQ4y+G3whD0Ph+bBZ33fGMQBdOetaw3yRgeY="}]},"maintainers":[{"name":"torge.juergensen","email":"torge.juergensen@codeanker.de"},{"name":"swiatek","email":"daniel.swiatek@codeanker.de"},{"name":"supermomme","email":"momme@juergensen.me"},{"name":"superbarne","email":"barne.juergensen@googlemail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jira-connector_2.7.0_1553081954739_0.8064035709576953"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-20T11:39:14.528Z","2.7.0":"2019-03-20T11:39:14.957Z","modified":"2022-06-08T08:21:41.526Z"},"maintainers":[{"email":"barne.juergensen@googlemail.com","name":"superbarne"},{"email":"daniel.swiatek@codeanker.de","name":"swiatek"}],"description":"Easy to use NodeJS wrapper for the Jira REST API.","homepage":"https://github.com/floralvikings/jira-connector#readme","keywords":["JIRA","REST","OAuth"],"repository":{"type":"git","url":"git+ssh://git@github.com/floralvikings/jira-connector.git"},"author":{"name":"Caleb Brinkman","email":"floralvikings@gmail.com"},"bugs":{"url":"https://github.com/floralvikings/jira-connector/issues"},"license":"MIT","readme":"# JavaScript Jira API Wrapper for NodeJS\n\nNode.JS module which provides easy-to-use access to the Jira REST API.\n\n## Important Change in Version 1.0.0\n\nStarting with version 1.0.0, all functions and parameters utilize ```xxxId``` instead of ```xxxID```.\nPrior to this update, this naming convention was inconsistent and easily confused.\n\nPlease update your code accordingly.\n\n## Installation\n\nInstall with [npm](http://npmjs.org/):\n\n```\n    $ npm install jira-connector\n```\n\nInstall via Git clone:\n\n```\n    $ git clone https://github.com/floralvikings/jira-connector.git\n    $ cd jira-connector\n    $ npm install\n```\n\n## Documentation\n\nThe documentation for jira-connector can be found in the source; If you'd like to view\nthe source as an HTML document, you can use [JSDoc](http://usejsdoc.org/) to generate these\npages.  Simply run:\n\n```\n    $ jsdoc -c jsdoc.json\n```\n\nIn the jira-connector source directory.  This will create a ```docs``` directory, containing the HTML\nmarkup for the docs.\n\nAlso, the [official Jira API docs](https://docs.atlassian.com/jira/REST/latest/) are very useful; many of\nthe functions in jira-connector use the exact same format as the request bodies of these endpoints.\n\n## Example\n\nRetrieve an issue from Jira, and print its summary to the console.\n\n```javascript\n\nvar JiraClient = require('jira-connector');\n\nvar jira = new JiraClient( {\n    host: 'jenjinstudios.atlassian.net'\n});\n\njira.issue.getIssue({\n    issueKey: 'JWR-19'\n}, function(error, issue) {\n    console.log(issue.fields.summary);\n});\n\n```\n\nFirst, the ```JiraApi``` class is imported from the ```jira-connector``` module.  This class\nprovides access to the Jira REST endpoints, organized into related classes.\n\nThe ```issue``` property of the ```JiraApi``` class is used to retrieve and modify Jira Issues.\n\nAll of the methods in the jira-connector API classes take two arguments; the ```opts``` and ```callback```.\n\n* The ```opts``` argument specifies the options that will be used when communicating with the Jira API.  For a detailed\n  list of options, see the documentation for the method into which you are passing the options.\n* The ```callback``` argument should be a function expecting two arguments; and error, and the results of the API\n  request.\n\n## Authentication\n\nDepending on the Jira instance to which you are connecting, authentication may or may not be required\nfor various API calls.\n\njira-connector supports two forms of authentication:\n\n### Basic Authentication\n\nThis is not recommended; it will require you to provide a username and password each time you connect to the\nJira instance.  However, jira-connector supports it for users who are unable to use OAuth.\n\nExample:\n\n```javascript\nvar JiraClient = require('jira-connector');\n\nvar jira = new JiraClient( {\n    host: 'jenjinstudios.atlassian.net',\n    basic_auth: {\n        username: 'SirUserOfName',\n        password: 'Password123'\n    }\n});\n```\n\n\n### Basic Authentication (Base64)\n\nAlso not recommended, but slightly better than the above; it will require you to provide a Base64 encoded username\nand password (a Base64 encoding in the format of \"username:password\") each time you connect to the Jira instance.\n\nMore examples [here](https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication).\n\nExample:\n\n```javascript\nvar JiraClient = require('jira-connector');\n\nvar jira = new JiraClient( {\n    host: 'jenjinstudios.atlassian.net',\n    basic_auth: {\n        base64: 'U2lyVXNlck9mTmFtZTpQYXNzd29yZDEyMw=='\n    }\n});\n\n// Base64 encoding of 'SirUserOfName:Password123'\n```\n\n### OAuth Authentication\n\nThis should be the preferred method of authentication; it is more secure and does not require disclosing\nyour password.\n\nHowever, setting up OAuth access in Jira can be somewhat complicated; first the Jira administrator must create\nan Application Link; for instructions on how to do this, see\n[Linking to Another Application](https://confluence.atlassian.com/display/JIRA/Linking+to+Another+Application).\n\n[This example](https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+OAuth+authentication) may also\nbe helpful in configuring OAuth Access.\n\nOnce the Application Link has been created, you will need the private key that corresponds to the public key used to\ncreate the link, and the consumer key that was provided when the link was created.\n\nOnce you have this data, you will need to generate an OAuth token and secret for your account; jira-connector provides\nhelper functions for exactly this purpose:\n\n```javascript\nvar JiraClient = require('./index.js');\n\nJiraClient.oauth_util.getAuthorizeURL({\n    host: 'jenjinstudios.atlassian.net',\n    oauth: {\n        consumer_key: 'your-consumer-key',\n        private_key: '-----BEGIN RSA PRIVATE KEY-----\\n' +\n        'SomePrivateKeyHere\\n' +\n        '-----END RSA PRIVATE KEY-----'\n    }\n}, function (error, oauth) {\n    console.log(oauth);\n});\n```\n\nThis will output something similar to the following:\n\n```javascript\n{\n    url: 'https://jenjinstudios.atlassian.net/plugins/servlet/oauth/authorize?oauth_token=some-token-here',\n    token: 'some-token-here',\n    token_secret: 'some-secret-here'\n}\n```\n\nYou can then visit the specified URL, which will display a page asking you to allow or deny the request for access.\nAllowing access will display a verifier code.  Once you have this code, you can swap out your current OAuth token\nfor an Access Token with all the permissions of your account; jira-connector provides a function to help with this:\n\n```javascript\nvar JiraClient = require('./index.js');\n\nJiraClient.oauth_util.swapRequestTokenWithAccessToken({\n    host: 'jenjinstudios.atlassian.net',\n    oauth: {\n        token: 'your-oauth-token',\n        token_secret: 'your-token-secret',\n        oauth_verifier: 'verifier-code-from-jira',\n        consumer_key: 'your-consumer-key',\n        private_key: '-----BEGIN RSA PRIVATE KEY-----\\n' +\n        'SomePrivateKeyHere\\n' +\n        '-----END RSA PRIVATE KEY-----'\n    }\n}, function (error, accessToken) {\n    console.log(accessToken);\n});\n```\n\nThis will query Jira for an Access Token, which will then be printed to the screen.  Finally, you're ready to access\nJira with OAuth!\n\n```javascript\nvar JiraClient = require('./index.js');\n\nvar jira = new JiraClient({\n    host: 'jenjinstudios.atlassian.net',\n    oauth: {\n        consumer_key: 'your-consumer-key',\n        private_key: '-----BEGIN RSA PRIVATE KEY-----\\n' +\n        'SomePrivateKey\\n' +\n        '-----END RSA PRIVATE KEY-----',\n        token: 'your-access-token',\n        token_secret: 'your-token-secret'\n    }\n});\n\n// Jira is now authenticted with your account!\n```\n\n### Cookie Jar\n\nYou can also use a Cookie Jar for your request. It could be an easier way to prompt for a login only once, without the\npain of setting up an OAuth method.\n\nFor example, using `though-cookie-filestore`:\n```javascript\nvar JiraClient = require('../jira-connector'),\n    FileCookieStore = require('tough-cookie-filestore'),\n\n    request = require('request'),\n    path = require('path');\n\nvar jar = request.jar(new FileCookieStore(path.join(__dirname, 'cookies.json')));\n\n// For the first connection\nvar jira = new JiraClient( {\n    host: 'jenjinstudios.atlassian.net',\n    basic_auth: {\n        username: 'SirUserOfName',\n        password: 'Password123'\n    },\n    cookie_jar: jar\n});\n\n// For the following connections\nvar jira = new JiraClient( {\n    host: 'jenjinstudios.atlassian.net',\n    cookie_jar: jar\n});\n```\n\nIn this example, all your cookies are save in a file, `cookies.json`. Currently, the file **MUST** exist, it's a\nlimitation from `though-cookie-filestore`...\n\nYou can now only use the Cookie Jar for all the following request, as long as the file exists and the cookie\nis still valid!\n\n## Supported API Calls\n\n* applicationProperties (/rest/api/2/application-properties)\n  * getProperties\n  * setProperty\n* attachment (/rest/api/2/atachment)\n  * getAttachment\n  * deleteAttachment\n  * getGlobalAttachmentMetadata\n* auditing (/rest/api/2/auditing)\n  * getAudits\n  * createAudit\n* avatar (/rest/api/2/avatar) (Untested; use at your own peril)\n  * getAvatars\n  * createTemporaryAvatar\n  * cropTemporaryAvatar\n* board (/rest/agile/1.0/board)\n  * getAllBoards\n  * getBoard\n  * getIssuesForBoard\n  * getSprintsForBoard\n* comment (/rest/api/2/comment)\n  * getCommentPropertyKeys\n  * setCommentProperty\n  * getCommentProperty\n  * deleteCommentProperty\n* component (/rest/api/2/component)\n  * getComponent\n  * createComponent\n  * editComponent\n  * deleteComponent\n  * getRelatedIssueCount\n* customFieldOption (/rest/api/2/customFieldOptions)\n  * getCustomFieldOption\n* dashboard (/rest/api/2/dashboard)\n  * getAllDashboards\n  * getDashboard\n* field (/rest/api/2/field)\n  * getAllFields\n  * createCustomField\n* filter (/rest/api/2/filter)\n  * createFilter\n  * getFilter\n  * updateFilter\n  * deleteFilter\n  * getFilterColumns\n  * setFilterColumns\n  * resetFilterColumns\n  * getDefaultShareScope\n  * setDefaultShareScope\n  * getFavoriteFilters\n* group (/rest/api/2/group) (Experimental)\n  * createGroup\n  * getGroup\n  * addUserToGroup\n  * removeUserFromGroup\n  * deleteGroup\n* groups (/rest/api/2/groups)\n  * findGroups\n* groupUserPicker (/rest/api/2/groupuserpicker)\n  * findUsersAndGroups\n* issue (/rest/api/2/issue and /rest/agile/1.0/issue)\n  * getIssue (agile api, set `opts.agile: true`)\n  * getIssueEstimation (agile api)\n  * setIssueEstimation (agile api)\n  * setIssueRanks (agile api)\n  * createIssue\n  * getCreateMetadata\n  * bulkCreate\n  * getIssue\n  * deleteIssue\n  * editIssue\n  * assignIssue\n  * getComments\n  * addComment\n  * getComment\n  * editComment\n  * deleteComment\n  * getEditMetadata\n  * sendEmailNotification\n  * getRemoteLinks\n  * createRemoteLink\n  * updateRemoteLink\n  * deleteRemoteLink\n  * getRemoteLinkByID\n  * updateRemoteLinkByID\n  * deleteRemoteLinkByID\n  * getTransitions\n  * transitionIssue\n  * unvote\n  * vote\n  * getVotes\n  * getWatchers\n  * addWatcher\n  * removeWatcher\n  * getWorkLogs\n  * addWorkLog\n  * updateWorkLog\n  * deleteWorkLog\n  * addAttachment\n  * getProperties\n  * setProperty\n  * getProperty\n  * deleteProperty\n* issueLink (/rest/api/2/issueLink)\n  * createIssueLink\n  * getIssueLink\n  * deleteIssueLink\n* issueLinkType (/rest/api/2/issueLinkType)\n  * getAvailableTypes\n  * createIssueLinkType\n  * getIssueLinkType\n  * deleteIssueLinkType\n  * editIssueLinkType\n* issueType (/rest/api/2/issuetype)\n  * getAllIssueTypes\n  * getIssueType\n* jql (/rest/api/2/jql/autocompletedata)\n  * getAutoCompleteData\n* licenseRole (/rest/api/2/licenserole)\n  * getAllLicenseRoles\n  * getLicenseRole\n  * editLicenseRole\n* licenseValidator (/rest/api/2/licenseValidator)\n  * validateLicense\n* myPermissions (/rest/api/2/mypermissions)\n  * getMyPermissions\n* myPreferences (/rest/api/2/mypreferences)\n  * getPreference\n  * editPreference\n  * deletePreference\n* myself (/rest/api/2/myself)\n  * getMyself\n  * editMyslef\n  * changePassword\n* password (/rest/api/2/password)\n  * getPasswordPolicy\n* priority (/rest/api/2/priority)\n  * getAllPriorities\n  * getPriority\n* project (/rest/api/2/project)\n  * getAllProjects\n  * getProject\n  * getComponents\n  * getVersions\n  * getStatuses\n  * getRoles\n  * getRole\n  * updateRole\n  * addToRole\n* projectCategory (/rest/api/2/projectCategory)\n  * getAllProjectCategories\n  * getProjectCategory\n* projectValidate (/rest/api/2/projectvalidate)\n  * validateProjectKey\n* reindex (/rest/api/2/reindex)\n  * doReindex\n  * getReindex\n* resolution (/rest/api/2/resolution)\n  * getAllResolutions\n  * getResolution\n* screens (/rest/api/2/screens)\n  * getAvailableFields\n  * getTabs\n  * createTab\n  * renameTab\n  * deleteTab\n  * addFieldToTab\n  * getFieldsInTab\n  * removeFieldFromTab\n  * moveFieldOnTab\n  * moveTabPosition\n  * addFieldToDefaultTab\n* search (/rest/api/2/search)\n  * search\n* securityLevel (/rest/api/2/securitylevel)\n  * getSecurityLevel\n* serverInfo (/rest/api/2/serverInfo)\n  * getServerInfo\n* settings (/rest/api/2/settings)\n  * setBaseUrl\n  * getIssueNavColumns\n* sprint (/rest/agile/1.0/sprint)\n  * createSprint\n  * getSprint\n  * updateSprint\n  * partiallyUpdateSprint\n  * deleteSprint\n  * getSprintIssues\n  * moveSprintIssues\n  * swapSprint\n* status (/rest/api/2/status)\n  * getAllStatuses\n  * getStatus\n* statusCategory (/rest/api/2/statuscategory)\n  * getAllStatusCategories\n  * getStatusCategory\n* user (/rest/api/2/user)\n  * getUser\n  * deleteUser\n  * editUser\n  * multiProjectSearchAssignable\n  * searchAssignable\n  * createTemporaryAvatar\n  * convertTemporaryAvatar\n  * deleteAvatar\n  * getAvatars\n  * getDefaultColumns\n  * setDefaultColumns\n  * resetDefaultColumns\n  * changePassword\n  * searchPermissions\n  * searchPicker\n  * search\n  * viewIssueSearch\n* version (/rest/api/2/version)\n  * createVersion\n  * moveVersion\n  * getVersion\n  * editVersion\n  * getRelatedIssueCounts\n  * getUnresolvedIssueCount\n  * getRemoteLinks\n  * createRemoteLink\n  * getRemoteLink\n  * deleteRemoteLink\n  * deleteVersion\n  * deleteAllRemoteLinks\n  * getGlobalRemoteLink\n* webhook (/rest/webhooks/1.0/webhook)\n  * getAllWebhooks\n  * getWebhook\n  * createWebhook\n  * deleteWebhook\n* workflow (/rest/api/2/workflow)\n  * getWorkflows\n* workflowScheme (/rest/api/2/workflowscheme)\n  * createWorkflowScheme\n  * editWorkflowScheme\n  * deleteWorkflowScheme\n  * createDraft\n  * getDefaultWorkflow\n  * removeDefaultWorkflow\n  * setDefaultWorkflow\n  * getDraft\n  * editDraft\n  * deleteDraft\n  * getDraftDefaultWorkflow\n  * setDraftDefaultWorkflow\n  * removeDraftDefaultWorkflow\n  * getIssueType\n  * removeIssueType\n  * editIssueType\n  * getDraftIssueType\n  * editDraftIssueType\n  * removeDraftIssueType\n  * getWorkflow\n  * editWorkflow\n  * deleteWorkflow\n  * getDraftWorkflow\n  * editDraftWorkflow\n  * deleteDraftWorkflow\n\n## License\n\n[MIT license](http://opensource.org/licenses/MIT)\n","readmeFilename":"README.md"}