Skip to content

Commit b4e08d9

Browse files
Types bug fixes (MrRefactoring#101)
* endpoint types changed * type definition changed * version 2.0.1 * changelog added * issueTypeIds fixed * models types changed
1 parent 9e41bae commit b4e08d9

File tree

239 files changed

+4182
-3417
lines changed

Some content is hidden

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

239 files changed

+4182
-3417
lines changed

CHANGELOG.md

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

3+
### 2.0.1
4+
5+
- Types bug fixes
6+
37
### 2.0.0
48

59
- One client divided to three: [Agile](https://developer.atlassian.com/cloud/jira/software/rest/intro/), [Version2](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/), [Version3](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"main": "out/index.js",
55
"types": "out/index.d.ts",
66
"repository": "https://github.com/MrRefactoring/jira.js.git",

src/agile/backlog.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ export class Backlog {
1010
* <br />
1111
* This operation is equivalent to remove future and active sprints from a given set of issues.
1212
* At most 50 issues may be moved at once. */
13-
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: Callback<T>): Promise<void>;
13+
async moveIssuesToBacklog<T = void>(parameters: Parameters.MoveIssuesToBacklog | undefined, callback: Callback<T>): Promise<void>;
1414
/**
1515
* Move issues to the backlog.
1616
* <br />
1717
* This operation is equivalent to remove future and active sprints from a given set of issues.
1818
* At most 50 issues may be moved at once. */
19-
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: undefined): Promise<T>;
19+
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: never): Promise<T>;
2020
async moveIssuesToBacklog<T = void>(parameters?: Parameters.MoveIssuesToBacklog, callback?: Callback<T>): Promise<void | T> {
21-
const config = ({
21+
const config = {
2222
url: '/agile/1.0/backlog/issue',
2323
method: 'POST',
2424
data: {
2525
issues: parameters?.issues,
2626
},
27-
} as RequestConfig);
27+
} as RequestConfig;
2828

2929
return this.client.sendRequest(config, callback, { methodName: 'moveIssuesToBacklog' });
3030
}
@@ -41,9 +41,9 @@ export class Backlog {
4141
* This operation is equivalent to remove future and active sprints from a given set of issues if the board has sprints
4242
* If the board does not have sprints this will put the issues back into the backlog from the board.
4343
* At most 50 issues may be moved at once. */
44-
async moveIssuesToBacklogForBoard<T = void>(parameters: Parameters.MoveIssuesToBacklogForBoard, callback?: undefined): Promise<T>;
44+
async moveIssuesToBacklogForBoard<T = void>(parameters: Parameters.MoveIssuesToBacklogForBoard, callback?: never): Promise<T>;
4545
async moveIssuesToBacklogForBoard<T = void>(parameters: Parameters.MoveIssuesToBacklogForBoard, callback?: Callback<T>): Promise<void | T> {
46-
const config = ({
46+
const config = {
4747
url: `/agile/1.0/backlog/${parameters.boardId}/issue`,
4848
method: 'POST',
4949
data: {
@@ -52,7 +52,7 @@ export class Backlog {
5252
rankAfterIssue: parameters.rankAfterIssue,
5353
rankCustomFieldId: parameters.rankCustomFieldId,
5454
},
55-
} as RequestConfig);
55+
} as RequestConfig;
5656

5757
return this.client.sendRequest(config, callback, { methodName: 'moveIssuesToBacklogForBoard' });
5858
}

src/agile/board.ts

+80-80
Large diffs are not rendered by default.

src/agile/builds.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class Builds {
2323
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
2424
* This resource requires the 'WRITE' scope for Connect apps.
2525
* */
26-
async submitBuilds<T = Models.SubmitBuilds>(parameters?: Parameters.SubmitBuilds, callback?: Callback<T>): Promise<void>;
26+
async submitBuilds<T = Models.SubmitBuilds>(parameters: Parameters.SubmitBuilds | undefined, callback: Callback<T>): Promise<void>;
2727
/**
2828
* Update / insert builds data.
2929
*
@@ -41,17 +41,17 @@ export class Builds {
4141
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
4242
* This resource requires the 'WRITE' scope for Connect apps.
4343
* */
44-
async submitBuilds<T = Models.SubmitBuilds>(parameters?: Parameters.SubmitBuilds, callback?: undefined): Promise<T>;
44+
async submitBuilds<T = Models.SubmitBuilds>(parameters?: Parameters.SubmitBuilds, callback?: never): Promise<T>;
4545
async submitBuilds<T = Models.SubmitBuilds>(parameters?: Parameters.SubmitBuilds, callback?: Callback<T>): Promise<void | T> {
46-
const config = ({
46+
const config = {
4747
url: '/builds/0.1/bulk',
4848
method: 'POST',
4949
data: {
5050
properties: parameters?.properties,
5151
builds: parameters?.builds,
5252
providerMetadata: parameters?.providerMetadata,
5353
},
54-
} as RequestConfig);
54+
} as RequestConfig;
5555

5656
return this.client.sendRequest(config, callback, { methodName: 'submitBuilds' });
5757
}
@@ -71,9 +71,9 @@ export class Builds {
7171
* deleted successfully (if needed).
7272
*
7373
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
74-
* This resource requires the 'DELETE' scope for Connect apps.
74+
* This resource requires the 'WRITE' scope for Connect apps.
7575
* */
76-
async deleteBuildsByProperty<T = unknown>(parameters?: Parameters.DeleteBuildsByProperty, callback?: Callback<T>): Promise<void>;
76+
async deleteBuildsByProperty<T = unknown>(parameters: Parameters.DeleteBuildsByProperty | undefined, callback: Callback<T>): Promise<void>;
7777
/**
7878
* Bulk delete all builds data that match the given request.
7979
*
@@ -90,17 +90,17 @@ export class Builds {
9090
* deleted successfully (if needed).
9191
*
9292
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
93-
* This resource requires the 'DELETE' scope for Connect apps.
93+
* This resource requires the 'WRITE' scope for Connect apps.
9494
* */
95-
async deleteBuildsByProperty<T = unknown>(parameters?: Parameters.DeleteBuildsByProperty, callback?: undefined): Promise<T>;
95+
async deleteBuildsByProperty<T = unknown>(parameters?: Parameters.DeleteBuildsByProperty, callback?: never): Promise<T>;
9696
async deleteBuildsByProperty<T = unknown>(parameters?: Parameters.DeleteBuildsByProperty, callback?: Callback<T>): Promise<void | T> {
97-
const config = ({
97+
const config = {
9898
url: '/builds/0.1/bulkByProperties',
9999
method: 'DELETE',
100100
params: {
101101
_updateSequenceNumber: parameters?._updateSequenceNumber,
102102
},
103-
} as RequestConfig);
103+
} as RequestConfig;
104104

105105
return this.client.sendRequest(config, callback, { methodName: 'deleteBuildsByProperty' });
106106
}
@@ -110,7 +110,7 @@ export class Builds {
110110
* The result will be what is currently stored, ignoring any pending updates or deletes.
111111
*
112112
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
113-
* This resource requires the 'READ' scope for Connect apps.
113+
* This resource requires the 'WRITE' scope for Connect apps.
114114
* */
115115
async getBuildByKey<T = Models.GetBuildByKey>(parameters: Parameters.GetBuildByKey, callback: Callback<T>): Promise<void>;
116116
/**
@@ -119,14 +119,14 @@ export class Builds {
119119
* The result will be what is currently stored, ignoring any pending updates or deletes.
120120
*
121121
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
122-
* This resource requires the 'READ' scope for Connect apps.
122+
* This resource requires the 'WRITE' scope for Connect apps.
123123
* */
124-
async getBuildByKey<T = Models.GetBuildByKey>(parameters: Parameters.GetBuildByKey, callback?: undefined): Promise<T>;
124+
async getBuildByKey<T = Models.GetBuildByKey>(parameters: Parameters.GetBuildByKey, callback?: never): Promise<T>;
125125
async getBuildByKey<T = Models.GetBuildByKey>(parameters: Parameters.GetBuildByKey, callback?: Callback<T>): Promise<void | T> {
126-
const config = ({
126+
const config = {
127127
url: `/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`,
128128
method: 'GET',
129-
} as RequestConfig);
129+
} as RequestConfig;
130130

131131
return this.client.sendRequest(config, callback, { methodName: 'getBuildByKey' });
132132
}
@@ -149,15 +149,15 @@ export class Builds {
149149
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this resource.
150150
* This resource requires the 'WRITE' scope for Connect apps.
151151
* */
152-
async deleteBuildByKey<T = unknown>(parameters: Parameters.DeleteBuildByKey, callback?: undefined): Promise<T>;
152+
async deleteBuildByKey<T = unknown>(parameters: Parameters.DeleteBuildByKey, callback?: never): Promise<T>;
153153
async deleteBuildByKey<T = unknown>(parameters: Parameters.DeleteBuildByKey, callback?: Callback<T>): Promise<void | T> {
154-
const config = ({
154+
const config = {
155155
url: `/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`,
156156
method: 'DELETE',
157157
params: {
158158
_updateSequenceNumber: parameters._updateSequenceNumber,
159159
},
160-
} as RequestConfig);
160+
} as RequestConfig;
161161

162162
return this.client.sendRequest(config, callback, { methodName: 'deleteBuildByKey' });
163163
}

src/agile/deployments.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class Deployments {
1818
* Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this resource.
1919
* This resource requires the 'WRITE' scope for Connect apps.
2020
* */
21-
async submitDeployments<T = Models.SubmitDeployments>(parameters?: Parameters.SubmitDeployments, callback?: Callback<T>): Promise<void>;
21+
async submitDeployments<T = Models.SubmitDeployments>(parameters: Parameters.SubmitDeployments | undefined, callback: Callback<T>): Promise<void>;
2222
/**
2323
* Update / insert deployment data.
2424
*
@@ -31,17 +31,17 @@ export class Deployments {
3131
* Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this resource.
3232
* This resource requires the 'WRITE' scope for Connect apps.
3333
* */
34-
async submitDeployments<T = Models.SubmitDeployments>(parameters?: Parameters.SubmitDeployments, callback?: undefined): Promise<T>;
34+
async submitDeployments<T = Models.SubmitDeployments>(parameters?: Parameters.SubmitDeployments, callback?: never): Promise<T>;
3535
async submitDeployments<T = Models.SubmitDeployments>(parameters?: Parameters.SubmitDeployments, callback?: Callback<T>): Promise<void | T> {
36-
const config = ({
36+
const config = {
3737
url: '/deployments/0.1/bulk',
3838
method: 'POST',
3939
data: {
4040
properties: parameters?.properties,
4141
deployments: parameters?.deployments,
4242
providerMetadata: parameters?.providerMetadata,
4343
},
44-
} as RequestConfig);
44+
} as RequestConfig;
4545

4646
return this.client.sendRequest(config, callback, { methodName: 'submitDeployments' });
4747
}
@@ -59,7 +59,7 @@ export class Deployments {
5959
* Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this resource.
6060
* This resource requires the 'DELETE' scope for Connect apps.
6161
* */
62-
async deleteDeploymentsByProperty<T = unknown>(parameters?: Parameters.DeleteDeploymentsByProperty, callback?: Callback<T>): Promise<void>;
62+
async deleteDeploymentsByProperty<T = unknown>(parameters: Parameters.DeleteDeploymentsByProperty | undefined, callback: Callback<T>): Promise<void>;
6363
/**
6464
* Bulk delete all deployments that match the given request.
6565
*
@@ -74,15 +74,15 @@ export class Deployments {
7474
* Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this resource.
7575
* This resource requires the 'DELETE' scope for Connect apps.
7676
* */
77-
async deleteDeploymentsByProperty<T = unknown>(parameters?: Parameters.DeleteDeploymentsByProperty, callback?: undefined): Promise<T>;
77+
async deleteDeploymentsByProperty<T = unknown>(parameters?: Parameters.DeleteDeploymentsByProperty, callback?: never): Promise<T>;
7878
async deleteDeploymentsByProperty<T = unknown>(parameters?: Parameters.DeleteDeploymentsByProperty, callback?: Callback<T>): Promise<void | T> {
79-
const config = ({
79+
const config = {
8080
url: '/deployments/0.1/bulkByProperties',
8181
method: 'DELETE',
8282
params: {
8383
_updateSequenceNumber: parameters?._updateSequenceNumber,
8484
},
85-
} as RequestConfig);
85+
} as RequestConfig;
8686

8787
return this.client.sendRequest(config, callback, { methodName: 'deleteDeploymentsByProperty' });
8888
}
@@ -103,12 +103,12 @@ export class Deployments {
103103
* Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this resource.
104104
* This resource requires the 'READ' scope for Connect apps.
105105
* */
106-
async getDeploymentByKey<T = Models.GetDeploymentByKey>(parameters: Parameters.GetDeploymentByKey, callback?: undefined): Promise<T>;
106+
async getDeploymentByKey<T = Models.GetDeploymentByKey>(parameters: Parameters.GetDeploymentByKey, callback?: never): Promise<T>;
107107
async getDeploymentByKey<T = Models.GetDeploymentByKey>(parameters: Parameters.GetDeploymentByKey, callback?: Callback<T>): Promise<void | T> {
108-
const config = ({
108+
const config = {
109109
url: `/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`,
110110
method: 'GET',
111-
} as RequestConfig);
111+
} as RequestConfig;
112112

113113
return this.client.sendRequest(config, callback, { methodName: 'getDeploymentByKey' });
114114
}
@@ -129,15 +129,15 @@ export class Deployments {
129129
* Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this resource.
130130
* This resource requires the 'DELETE' scope for Connect apps.
131131
* */
132-
async deleteDeploymentByKey<T = unknown>(parameters: Parameters.DeleteDeploymentByKey, callback?: undefined): Promise<T>;
132+
async deleteDeploymentByKey<T = unknown>(parameters: Parameters.DeleteDeploymentByKey, callback?: never): Promise<T>;
133133
async deleteDeploymentByKey<T = unknown>(parameters: Parameters.DeleteDeploymentByKey, callback?: Callback<T>): Promise<void | T> {
134-
const config = ({
134+
const config = {
135135
url: `/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`,
136136
method: 'DELETE',
137137
params: {
138138
_updateSequenceNumber: parameters._updateSequenceNumber,
139139
},
140-
} as RequestConfig);
140+
} as RequestConfig;
141141

142142
return this.client.sendRequest(config, callback, { methodName: 'deleteDeploymentByKey' });
143143
}
@@ -148,12 +148,12 @@ export class Deployments {
148148
/**
149149
* Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource requires the 'READ' scope.
150150
* */
151-
async getDeploymentGatingStatusByKey<T = Models.GetDeploymentGatingStatusByKey>(parameters: Parameters.GetDeploymentGatingStatusByKey, callback?: undefined): Promise<T>;
151+
async getDeploymentGatingStatusByKey<T = Models.GetDeploymentGatingStatusByKey>(parameters: Parameters.GetDeploymentGatingStatusByKey, callback?: never): Promise<T>;
152152
async getDeploymentGatingStatusByKey<T = Models.GetDeploymentGatingStatusByKey>(parameters: Parameters.GetDeploymentGatingStatusByKey, callback?: Callback<T>): Promise<void | T> {
153-
const config = ({
153+
const config = {
154154
url: `/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}/gating-status`,
155155
method: 'GET',
156-
} as RequestConfig);
156+
} as RequestConfig;
157157

158158
return this.client.sendRequest(config, callback, { methodName: 'getDeploymentGatingStatusByKey' });
159159
}

0 commit comments

Comments
 (0)