Skip to content

Commit 77af1a8

Browse files
Sprint types fixed (#140)
* sprint types fixed * small project types improvements
1 parent 27ede89 commit 77af1a8

Some content is hidden

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

54 files changed

+362
-263
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Jira.js changelog
22

3+
### 2.4.1
4+
5+
- A lot of small improvements in types for agile and for project API
6+
37
### 2.4.0
48

59
- Some properties to some endpoints added :D

package-lock.json

Lines changed: 96 additions & 149 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "jira.js is a powerful Node.JS/Browser module that allows you to interact with the Jira API very easily",
55
"main": "out/index.js",
66
"types": "out/index.d.ts",
@@ -29,9 +29,9 @@
2929
"lint:base": "eslint --ext .ts",
3030
"lint:fix": "npm run lint:tests -- --fix && npm run lint:src:agile -- --fix && npm run lint:src:clients -- --fix && npm run lint:src:services -- --fix && npm run lint:src:version2 -- --fix && npm run lint:src:version3 -- --fix && npm run lint:src:files -- --fix",
3131
"doc": "typedoc --name Jira.js --out docs ./src",
32-
"test": "npm run test:unit && npm run test:system",
32+
"test": "npm run test:unit && npm run test:e2e",
3333
"test:unit": "jest tests/unit",
34-
"test:system": "jest tests/system --setupFiles=./tests/setup.ts --runInBand",
34+
"test:e2e": "jest tests/integration --setupFiles=./tests/setup.ts --runInBand",
3535
"test:verbose": "npm run test -- --verbose",
3636
"test:coverage": "npm run test:unit:coverage && npm run test:system:coverage",
3737
"test:unit:coverage": "npm run test:unit -- --coverage",
@@ -44,23 +44,23 @@
4444
"devDependencies": {
4545
"@types/express": "^4.17.12",
4646
"@types/jest": "^26.0.23",
47-
"@types/node": "^15.12.2",
47+
"@types/node": "^15.12.5",
4848
"@types/oauth": "^0.9.1",
4949
"@types/sinon": "^10.0.2",
50-
"@typescript-eslint/eslint-plugin": "^4.26.1",
51-
"@typescript-eslint/parser": "^4.26.1",
50+
"@typescript-eslint/eslint-plugin": "^4.28.1",
51+
"@typescript-eslint/parser": "^4.28.1",
5252
"dotenv": "^10.0.0",
53-
"eslint": "^7.28.0",
53+
"eslint": "^7.29.0",
5454
"eslint-config-airbnb-typescript": "^12.3.1",
5555
"eslint-import-resolver-typescript": "^2.4.0",
5656
"eslint-plugin-import": "^2.23.4",
5757
"jest": "^26.6.3",
58-
"prettier": "^2.3.1",
58+
"prettier": "^2.3.2",
5959
"prettier-plugin-jsdoc": "^0.3.23",
6060
"sinon": "^11.1.1",
6161
"ts-jest": "^26.5.6",
62-
"typedoc": "^0.20.36",
63-
"typescript": "^4.3.2"
62+
"typedoc": "^0.21.2",
63+
"typescript": "^4.3.4"
6464
},
6565
"dependencies": {
6666
"atlassian-jwt": "^2.0.1",

src/agile/backlog.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class Backlog {
1313
* be moved at once.
1414
*/
1515
async moveIssuesToBacklog<T = void>(
16-
parameters: Parameters.MoveIssuesToBacklog | undefined,
16+
parameters: Parameters.MoveIssuesToBacklog,
1717
callback: Callback<T>
1818
): Promise<void>;
1919
/**
@@ -22,9 +22,9 @@ export class Backlog {
2222
* This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may
2323
* be moved at once.
2424
*/
25-
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: never): Promise<T>;
25+
async moveIssuesToBacklog<T = void>(parameters: Parameters.MoveIssuesToBacklog, callback?: never): Promise<T>;
2626
async moveIssuesToBacklog<T = void>(
27-
parameters?: Parameters.MoveIssuesToBacklog,
27+
parameters: Parameters.MoveIssuesToBacklog,
2828
callback?: Callback<T>,
2929
): Promise<void | T> {
3030
const config: RequestConfig = {

src/agile/board.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class Board {
7070
* </ul>
7171
*/
7272
async createBoard<T = Models.CreateBoard>(
73-
parameters: Parameters.CreateBoard | undefined,
73+
parameters: Parameters.CreateBoard,
7474
callback: Callback<T>
7575
): Promise<void>;
7676
/**
@@ -101,9 +101,9 @@ export class Board {
101101
* </li>
102102
* </ul>
103103
*/
104-
async createBoard<T = Models.CreateBoard>(parameters?: Parameters.CreateBoard, callback?: never): Promise<T>;
104+
async createBoard<T = Models.CreateBoard>(parameters: Parameters.CreateBoard, callback?: never): Promise<T>;
105105
async createBoard<T = Models.CreateBoard>(
106-
parameters?: Parameters.CreateBoard,
106+
parameters: Parameters.CreateBoard,
107107
callback?: Callback<T>,
108108
): Promise<void | T> {
109109
const config: RequestConfig = {
@@ -752,16 +752,16 @@ export class Board {
752752
}
753753

754754
/** Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to view. */
755-
async getAllSprints<T = Paginated<Models.SprintBean[]>>(
755+
async getAllSprints<T = Paginated<Models.Sprint>>(
756756
parameters: Parameters.GetAllSprints,
757757
callback: Callback<T>
758758
): Promise<void>;
759759
/** Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to view. */
760-
async getAllSprints<T = Paginated<Models.SprintBean[]>>(
760+
async getAllSprints<T = Paginated<Models.Sprint>>(
761761
parameters: Parameters.GetAllSprints,
762762
callback?: never
763763
): Promise<T>;
764-
async getAllSprints<T = Paginated<Models.SprintBean[]>>(
764+
async getAllSprints<T = Paginated<Models.Sprint>>(
765765
parameters: Parameters.GetAllSprints,
766766
callback?: Callback<T>,
767767
): Promise<void | T> {

src/agile/models/createBoard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface CreateBoard {
2-
id?: number;
2+
id: number;
33
self?: string;
44
name?: string;
55
type?: string;

src/agile/models/getAllBoards.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export interface GetAllBoards {
33
startAt?: number;
44
total?: number;
55
isLast?: boolean;
6-
values?: {
7-
id?: number;
6+
values: {
7+
id: number;
88
self?: string;
99
name?: string;
1010
type?: string;

src/agile/models/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export * from './reportBean';
6666
export * from './reportsResponseBean';
6767
export * from './searchResultsBean';
6868
export * from './simpleLinkBean';
69-
export * from './sprintBean';
69+
export * from './sprint';
7070
export * from './sprintCreateBean';
7171
export * from './sprintSwapBean';
7272
export * from './statusCategoryJsonBean';

src/agile/models/searchResultsBean.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export interface SearchResultsBean {
44
/** Expand options that include additional search result details in the response. */
55
expand?: string;
66
/** The index of the first item returned on the page. */
7-
startAt?: number;
7+
startAt: number;
88
/** The maximum number of results that could be on the page. */
9-
maxResults?: number;
9+
maxResults: number;
1010
/** The number of results on the page. */
11-
total?: number;
11+
total: number;
1212
/** The list of issues found by the search. */
13-
issues?: IssueBean[];
13+
issues: IssueBean[];
1414
/** Any warnings related to the JQL query. */
1515
warningMessages?: string[];
1616
/** The ID and name of each field in the search results. */

src/agile/models/sprint.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export type SprintBean = Sprint;
2+
3+
export interface Sprint {
4+
id: number;
5+
self?: string;
6+
state: string | Sprint.State;
7+
name: string;
8+
startDate?: string;
9+
endDate?: string;
10+
completeDate?: string;
11+
originBoardId?: number;
12+
goal?: string;
13+
}
14+
15+
export namespace Sprint {
16+
export enum State {
17+
Future = 'future',
18+
Active = 'active',
19+
Closed = 'closed',
20+
}
21+
}

0 commit comments

Comments
 (0)