Skip to content

Commit 49e9ea9

Browse files
Return types improvements and createIssue bug fixed (#116)
* types defined for method on telemetry based information * types improvement * build fix * more tests added * types updates * test fixes * fixing issue with description typing when create issue * CHANGELOG updates * version updated
1 parent e59c686 commit 49e9ea9

File tree

140 files changed

+1128
-679
lines changed

Some content is hidden

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

140 files changed

+1128
-679
lines changed

CHANGELOG.md

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

3+
### 2.1.1
4+
5+
- Typings improved
6+
- Fixed [bug](https://github.com/MrRefactoring/jira.js/issues/117) with typings in createIssue
7+
38
### 2.1.0
49

510
- Typings improved

package-lock.json

+77-83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.1.0",
3+
"version": "2.1.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",
@@ -42,21 +42,21 @@
4242
},
4343
"devDependencies": {
4444
"@types/express": "4.17.11",
45-
"@types/jest": "^26.0.22",
46-
"@types/node": "^14.14.41",
45+
"@types/jest": "^26.0.23",
46+
"@types/node": "^15.0.1",
4747
"@types/oauth": "^0.9.1",
4848
"@types/sinon": "^10.0.0",
4949
"@typescript-eslint/eslint-plugin": "^4.22.0",
5050
"@typescript-eslint/parser": "^4.22.0",
5151
"dotenv": "^8.2.0",
52-
"eslint": "^7.24.0",
52+
"eslint": "^7.25.0",
5353
"eslint-config-airbnb-typescript": "^12.3.1",
5454
"eslint-import-resolver-typescript": "^2.4.0",
5555
"eslint-plugin-import": "^2.22.1",
5656
"jest": "^26.6.3",
5757
"sinon": "^10.0.0",
5858
"ts-jest": "^26.5.5",
59-
"typedoc": "^0.20.35",
59+
"typedoc": "^0.20.36",
6060
"typescript": "^4.2.4"
6161
},
6262
"dependencies": {

src/agile/board.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -664,12 +664,12 @@ export class Board {
664664
/**
665665
* Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to view.
666666
*/
667-
async getAllSprints<T = unknown>(parameters: Parameters.GetAllSprints, callback: Callback<T>): Promise<void>;
667+
async getAllSprints<T = Paginated<Models.SprintBean[]>>(parameters: Parameters.GetAllSprints, callback: Callback<T>): Promise<void>;
668668
/**
669669
* Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to view.
670670
*/
671-
async getAllSprints<T = unknown>(parameters: Parameters.GetAllSprints, callback?: never): Promise<T>;
672-
async getAllSprints<T = unknown>(parameters: Parameters.GetAllSprints, callback?: Callback<T>): Promise<void | T> {
671+
async getAllSprints<T = Paginated<Models.SprintBean[]>>(parameters: Parameters.GetAllSprints, callback?: never): Promise<T>;
672+
async getAllSprints<T = Paginated<Models.SprintBean[]>>(parameters: Parameters.GetAllSprints, callback?: Callback<T>): Promise<void | T> {
673673
const config = {
674674
url: `/agile/1.0/board/${parameters.boardId}/sprint`,
675675
method: 'GET',
@@ -717,14 +717,14 @@ export class Board {
717717
* Note, if the user does not have permission to view the board, no versions will be returned at all.
718718
* Returned versions are ordered by the name of the project from which they belong and then by sequence defined by user.
719719
*/
720-
async getAllVersions<T = unknown>(parameters: Parameters.GetAllVersions, callback: Callback<T>): Promise<void>;
720+
async getAllVersions<T = Paginated<Models.Version>>(parameters: Parameters.GetAllVersions, callback: Callback<T>): Promise<void>;
721721
/**
722722
* Returns all versions from a board, for a given board ID. This only includes versions that the user has permission to view.
723723
* Note, if the user does not have permission to view the board, no versions will be returned at all.
724724
* Returned versions are ordered by the name of the project from which they belong and then by sequence defined by user.
725725
*/
726-
async getAllVersions<T = unknown>(parameters: Parameters.GetAllVersions, callback?: never): Promise<T>;
727-
async getAllVersions<T = unknown>(parameters: Parameters.GetAllVersions, callback?: Callback<T>): Promise<void | T> {
726+
async getAllVersions<T = Paginated<Models.Version>>(parameters: Parameters.GetAllVersions, callback?: never): Promise<T>;
727+
async getAllVersions<T = Paginated<Models.Version>>(parameters: Parameters.GetAllVersions, callback?: Callback<T>): Promise<void | T> {
728728
const config = {
729729
url: `/agile/1.0/board/${parameters.boardId}/version`,
730730
method: 'GET',

src/agile/deployments.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Callback } from '../callback';
55
import { RequestConfig } from '../requestConfig';
66

77
export class Deployments {
8-
constructor(private client: Client) { }
8+
constructor(private client: Client) {
9+
}
910

1011
/**
1112
* Update / insert deployment data.

src/agile/developmentInformation.ts

+20-13
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import { Callback } from '../callback';
55
import { RequestConfig } from '../requestConfig';
66

77
export class DevelopmentInformation {
8-
constructor(private client: Client) { }
8+
constructor(private client: Client) {
9+
}
10+
911
/**
10-
* Stores development information provided in the request to make it available when viewing issues in Jira. Existing repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are available within a short period of time, but may take some time during peak load and/or maintenance times. */
12+
* Stores development information provided in the request to make it available when viewing issues in Jira. Existing repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are available within a short period of time, but may take some time during peak load and/or maintenance times. */
1113
async storeDevelopmentInformation<T = Models.StoreDevelopmentInformation>(parameters: Parameters.StoreDevelopmentInformation, callback: Callback<T>): Promise<void>;
1214
/**
13-
* Stores development information provided in the request to make it available when viewing issues in Jira. Existing repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are available within a short period of time, but may take some time during peak load and/or maintenance times. */
15+
* Stores development information provided in the request to make it available when viewing issues in Jira. Existing repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are available within a short period of time, but may take some time during peak load and/or maintenance times. */
1416
async storeDevelopmentInformation<T = Models.StoreDevelopmentInformation>(parameters: Parameters.StoreDevelopmentInformation, callback?: never): Promise<T>;
1517
async storeDevelopmentInformation<T = Models.StoreDevelopmentInformation>(parameters: Parameters.StoreDevelopmentInformation, callback?: Callback<T>): Promise<void | T> {
1618
const config = {
@@ -26,11 +28,12 @@ export class DevelopmentInformation {
2628

2729
return this.client.sendRequest(config, callback, { methodName: 'storeDevelopmentInformation' });
2830
}
31+
2932
/**
30-
* For the specified repository ID, retrieves the repository and the most recent 400 development information entities. The result will be what is currently stored, ignoring any pending updates or deletes. */
33+
* For the specified repository ID, retrieves the repository and the most recent 400 development information entities. The result will be what is currently stored, ignoring any pending updates or deletes. */
3134
async getRepository<T = Models.GetRepository>(parameters: Parameters.GetRepository, callback: Callback<T>): Promise<void>;
3235
/**
33-
* For the specified repository ID, retrieves the repository and the most recent 400 development information entities. The result will be what is currently stored, ignoring any pending updates or deletes. */
36+
* For the specified repository ID, retrieves the repository and the most recent 400 development information entities. The result will be what is currently stored, ignoring any pending updates or deletes. */
3437
async getRepository<T = Models.GetRepository>(parameters: Parameters.GetRepository, callback?: never): Promise<T>;
3538
async getRepository<T = Models.GetRepository>(parameters: Parameters.GetRepository, callback?: Callback<T>): Promise<void | T> {
3639
const config = {
@@ -40,11 +43,12 @@ export class DevelopmentInformation {
4043

4144
return this.client.sendRequest(config, callback, { methodName: 'getRepository' });
4245
}
46+
4347
/**
44-
* Deletes the repository data stored by the given ID and all related development information entities. Deletion is performed asynchronously. */
48+
* Deletes the repository data stored by the given ID and all related development information entities. Deletion is performed asynchronously. */
4549
async deleteRepository<T = unknown>(parameters: Parameters.DeleteRepository, callback: Callback<T>): Promise<void>;
4650
/**
47-
* Deletes the repository data stored by the given ID and all related development information entities. Deletion is performed asynchronously. */
51+
* Deletes the repository data stored by the given ID and all related development information entities. Deletion is performed asynchronously. */
4852
async deleteRepository<T = unknown>(parameters: Parameters.DeleteRepository, callback?: never): Promise<T>;
4953
async deleteRepository<T = unknown>(parameters: Parameters.DeleteRepository, callback?: Callback<T>): Promise<void | T> {
5054
const config = {
@@ -57,11 +61,12 @@ export class DevelopmentInformation {
5761

5862
return this.client.sendRequest(config, callback, { methodName: 'deleteRepository' });
5963
}
64+
6065
/**
61-
* Deletes development information entities which have all the provided properties. Entities will be deleted that match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will eventually be removed from Jira. */
66+
* Deletes development information entities which have all the provided properties. Entities will be deleted that match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will eventually be removed from Jira. */
6267
async deleteByProperties<T = unknown>(parameters: Parameters.DeleteByProperties, callback: Callback<T>): Promise<void>;
6368
/**
64-
* Deletes development information entities which have all the provided properties. Entities will be deleted that match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will eventually be removed from Jira. */
69+
* Deletes development information entities which have all the provided properties. Entities will be deleted that match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will eventually be removed from Jira. */
6570
async deleteByProperties<T = unknown>(parameters: Parameters.DeleteByProperties, callback?: never): Promise<T>;
6671
async deleteByProperties<T = unknown>(parameters: Parameters.DeleteByProperties, callback?: Callback<T>): Promise<void | T> {
6772
const config = {
@@ -74,11 +79,12 @@ export class DevelopmentInformation {
7479

7580
return this.client.sendRequest(config, callback, { methodName: 'deleteByProperties' });
7681
}
82+
7783
/**
78-
* Checks if development information which have all the provided properties exists. For example, if request is `GET existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */
84+
* Checks if development information which have all the provided properties exists. For example, if request is `GET existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */
7985
async existsByProperties<T = Models.ExistsByProperties>(parameters: Parameters.ExistsByProperties, callback: Callback<T>): Promise<void>;
8086
/**
81-
* Checks if development information which have all the provided properties exists. For example, if request is `GET existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */
87+
* Checks if development information which have all the provided properties exists. For example, if request is `GET existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */
8288
async existsByProperties<T = Models.ExistsByProperties>(parameters: Parameters.ExistsByProperties, callback?: never): Promise<T>;
8389
async existsByProperties<T = Models.ExistsByProperties>(parameters: Parameters.ExistsByProperties, callback?: Callback<T>): Promise<void | T> {
8490
const config = {
@@ -91,11 +97,12 @@ export class DevelopmentInformation {
9197

9298
return this.client.sendRequest(config, callback, { methodName: 'existsByProperties' });
9399
}
100+
94101
/**
95-
* Deletes particular development information entity. Deletion is performed asynchronously. */
102+
* Deletes particular development information entity. Deletion is performed asynchronously. */
96103
async deleteEntity<T = unknown>(parameters: Parameters.DeleteEntity, callback: Callback<T>): Promise<void>;
97104
/**
98-
* Deletes particular development information entity. Deletion is performed asynchronously. */
105+
* Deletes particular development information entity. Deletion is performed asynchronously. */
99106
async deleteEntity<T = unknown>(parameters: Parameters.DeleteEntity, callback?: never): Promise<T>;
100107
async deleteEntity<T = unknown>(parameters: Parameters.DeleteEntity, callback?: Callback<T>): Promise<void | T> {
101108
const config = {

src/agile/epic.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Callback } from '../callback';
55
import { RequestConfig } from '../requestConfig';
66

77
export class Epic {
8-
constructor(private client: Client) { }
8+
constructor(private client: Client) {
9+
}
910

1011
/**
1112
* Returns all issues that do not belong to any epic.

src/agile/featureFlags.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Callback } from '../callback';
55
import { RequestConfig } from '../requestConfig';
66

77
export class FeatureFlags {
8-
constructor(private client: Client) { }
8+
constructor(private client: Client) {
9+
}
910

1011
/**
1112
* Update / insert Feature Flag data.

src/agile/issue.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Callback } from '../callback';
55
import { RequestConfig } from '../requestConfig';
66

77
export class Issue {
8-
constructor(private client: Client) { }
8+
constructor(private client: Client) {
9+
}
910

1011
/**
1112
* Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once.

0 commit comments

Comments
 (0)