Skip to content

Commit 8c1b61e

Browse files
Code styles improved (MrRefactoring#134)
* Updates for agile code * prettier for version2 and version3 code * prettier for version2 and version3 code * project key changed for tests * CI flow improved * tests speed up and fixes for attachments
1 parent 4ad8665 commit 8c1b61e

File tree

1,324 files changed

+27275
-13682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,324 files changed

+27275
-13682
lines changed

.github/workflows/ci.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
with:
2020
node-version: ${{ matrix.node-version }}
2121
- run: npm ci
22-
- run: npm install
2322
- name: Create .env file
2423
run: |
2524
touch .env

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"plugins": [
3+
"prettier-plugin-jsdoc"
4+
]
5+
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Jira.js changelog
22

3+
### 2.3.1
4+
5+
- [#136](https://github.com/MrRefactoring/jira.js/pull/136) Fixed all URLs for Cloud Agile endpoint. Thanks [John Brunton](https://github.com/jbrunton)!
6+
- Internal code styles improved
7+
38
### 2.3.0
49

510
- Huge type improvements

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## About
1313

14-
jira.js is a powerful [Node.JS](https://nodejs.org/) / Browser module that allows you to interact with the [Jira API](https://developer.atlassian.com/cloud/jira/platform/rest/) very easily.
14+
jira.js is a powerful [Node.JS](https://nodejs.org/) / Browser module that allows you to interact with the [Jira Cloud API](https://developer.atlassian.com/cloud/jira/platform/rest/) very easily.
1515

1616
Usability, consistency, and performance are key focuses of jira.js, and it also has nearly 100% coverage of the Jira API. It receives new Jira features shortly after they arrive in the API.
1717

@@ -241,7 +241,7 @@ client.<group>.<methodName>(parametersObject);
241241
```
242242

243243
Available groups:
244-
- Agile:
244+
- Agile group:
245245
- [backlog](https://developer.atlassian.com/cloud/jira/software/rest/api-group-backlog/#api-group-backlog)
246246
- [board](https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-group-board)
247247
- [epic](https://developer.atlassian.com/cloud/jira/software/rest/api-group-epic/#api-group-epic)
@@ -253,7 +253,7 @@ Available groups:
253253
- [builds](https://developer.atlassian.com/cloud/jira/software/rest/api-group-builds/#api-group-builds)
254254
- [remoteLinks](https://developer.atlassian.com/cloud/jira/software/rest/api-group-remote-links/#api-group-remote-links)
255255
- [otherOperations](https://developer.atlassian.com/cloud/jira/software/rest/api-group-other-operations/#api-group-other-operations)
256-
- Version 2:
256+
- Version 2 group:
257257
- [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-application-roles/#api-group-application-roles)
258258
- [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-audit-records/#api-group-audit-records)
259259
- [avatars](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-avatars/#api-group-avatars)
@@ -333,7 +333,7 @@ Available groups:
333333
- [workflowTransitionProperties](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-properties/#api-group-workflow-transition-properties)
334334
- [appProperties](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-properties/#api-group-app-properties)
335335
- [dynamicModules](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-dynamic-modules/#api-group-dynamic-modules)
336-
- Version 3:
336+
- Version 3 group:
337337
- [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-application-roles/#api-group-application-roles)
338338
- [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-audit-records/#api-group-audit-records)
339339
- [avatars](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-group-avatars)

package-lock.json

+1,511-1,428
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14-11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"scripts": {
1818
"build": "tsc",
1919
"prepublishOnly": "npm run build && npm run test && npm run lint",
20+
"prettier": "prettier --write src/**/*.ts",
2021
"lint": "npm run lint:tests && npm run lint:src:agile && npm run lint:src:clients && npm run lint:src:services && npm run lint:src:version2 && npm run lint:src:version3 && npm run lint:src:files",
2122
"lint:tests": "npm run lint:base -- tests",
2223
"lint:src:agile": "npm run lint:base -- src/agile",
@@ -41,26 +42,28 @@
4142
"testEnvironment": "node"
4243
},
4344
"devDependencies": {
44-
"@types/express": "^4.17.11",
45+
"@types/express": "^4.17.12",
4546
"@types/jest": "^26.0.23",
46-
"@types/node": "^15.3.0",
47+
"@types/node": "^15.12.2",
4748
"@types/oauth": "^0.9.1",
48-
"@types/sinon": "^10.0.0",
49-
"@typescript-eslint/eslint-plugin": "^4.23.0",
50-
"@typescript-eslint/parser": "^4.23.0",
51-
"dotenv": "^9.0.2",
52-
"eslint": "^7.26.0",
49+
"@types/sinon": "^10.0.2",
50+
"@typescript-eslint/eslint-plugin": "^4.26.1",
51+
"@typescript-eslint/parser": "^4.26.1",
52+
"dotenv": "^10.0.0",
53+
"eslint": "^7.28.0",
5354
"eslint-config-airbnb-typescript": "^12.3.1",
5455
"eslint-import-resolver-typescript": "^2.4.0",
55-
"eslint-plugin-import": "^2.23.2",
56+
"eslint-plugin-import": "^2.23.4",
5657
"jest": "^26.6.3",
57-
"sinon": "^10.0.0",
58+
"prettier": "^2.3.1",
59+
"prettier-plugin-jsdoc": "^0.3.23",
60+
"sinon": "^11.1.1",
5861
"ts-jest": "^26.5.6",
5962
"typedoc": "^0.20.36",
60-
"typescript": "^4.2.4"
63+
"typescript": "^4.3.2"
6164
},
6265
"dependencies": {
63-
"atlassian-jwt": "^2.0.0",
66+
"atlassian-jwt": "^2.0.1",
6467
"axios": "^0.21.1",
6568
"form-data": "^4.0.0",
6669
"oauth": "^0.9.15",

src/agile/backlog.ts

+31-17
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,29 @@ import { Callback } from '../callback';
44
import { RequestConfig } from '../requestConfig';
55

66
export class Backlog {
7-
constructor(private client: Client) {
8-
}
7+
constructor(private client: Client) {}
98

109
/**
1110
* Move issues to the backlog.
1211
*
13-
* This operation is equivalent to remove future and active sprints from a given set of issues.
14-
* At most 50 issues may be moved at once.
12+
* This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may
13+
* be moved at once.
1514
*/
16-
async moveIssuesToBacklog<T = void>(parameters: Parameters.MoveIssuesToBacklog | undefined, callback: Callback<T>): Promise<void>;
15+
async moveIssuesToBacklog<T = void>(
16+
parameters: Parameters.MoveIssuesToBacklog | undefined,
17+
callback: Callback<T>
18+
): Promise<void>;
1719
/**
1820
* Move issues to the backlog.
1921
*
20-
* This operation is equivalent to remove future and active sprints from a given set of issues.
21-
* At most 50 issues may be moved at once.
22+
* This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may
23+
* be moved at once.
2224
*/
2325
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: never): Promise<T>;
24-
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: Callback<T>): Promise<void | T> {
26+
async moveIssuesToBacklog<T = void>(
27+
parameters?: Parameters.MoveIssuesToBacklog,
28+
callback?: Callback<T>,
29+
): Promise<void | T> {
2530
const config: RequestConfig = {
2631
url: '/rest/agile/1.0/backlog/issue',
2732
method: 'POST',
@@ -36,20 +41,29 @@ export class Backlog {
3641
/**
3742
* Move issues to the backlog of a particular board (if they are already on that board).
3843
*
39-
* This operation is equivalent to remove future and active sprints from a given set of issues if the board has sprints
40-
* If the board does not have sprints this will put the issues back into the backlog from the board.
41-
* At most 50 issues may be moved at once.
44+
* This operation is equivalent to remove future and active sprints from a given set of issues if the board has
45+
* sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most
46+
* 50 issues may be moved at once.
4247
*/
43-
async moveIssuesToBacklogForBoard<T = void>(parameters: Parameters.MoveIssuesToBacklogForBoard, callback: Callback<T>): Promise<void>;
48+
async moveIssuesToBacklogForBoard<T = void>(
49+
parameters: Parameters.MoveIssuesToBacklogForBoard,
50+
callback: Callback<T>
51+
): Promise<void>;
4452
/**
4553
* Move issues to the backlog of a particular board (if they are already on that board).
4654
*
47-
* This operation is equivalent to remove future and active sprints from a given set of issues if the board has sprints
48-
* If the board does not have sprints this will put the issues back into the backlog from the board.
49-
* At most 50 issues may be moved at once.
55+
* This operation is equivalent to remove future and active sprints from a given set of issues if the board has
56+
* sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most
57+
* 50 issues may be moved at once.
5058
*/
51-
async moveIssuesToBacklogForBoard<T = void>(parameters: Parameters.MoveIssuesToBacklogForBoard, callback?: never): Promise<T>;
52-
async moveIssuesToBacklogForBoard<T = void>(parameters: Parameters.MoveIssuesToBacklogForBoard, callback?: Callback<T>): Promise<void | T> {
59+
async moveIssuesToBacklogForBoard<T = void>(
60+
parameters: Parameters.MoveIssuesToBacklogForBoard,
61+
callback?: never
62+
): Promise<T>;
63+
async moveIssuesToBacklogForBoard<T = void>(
64+
parameters: Parameters.MoveIssuesToBacklogForBoard,
65+
callback?: Callback<T>,
66+
): Promise<void | T> {
5367
const config: RequestConfig = {
5468
url: `/rest/agile/1.0/backlog/${parameters.boardId}/issue`,
5569
method: 'POST',

0 commit comments

Comments
 (0)