Skip to content

Commit 39bf16d

Browse files
MrRefactoringVladislav Tupikincakerug
authored
* Agile API code updated * Agile Parameters updated * Agile Models code updated * Respect the configured expiry time in JWT authentication (MrRefactoring#248) --------- Co-authored-by: Vladislav Tupikin <vlad.tupikin@raftds.com> Co-authored-by: Grace Ku <cakerug@gmail.com>
1 parent 220892b commit 39bf16d

Some content is hidden

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

53 files changed

+1780
-886
lines changed

CHANGELOG.md

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

3+
### 2.16.1
4+
5+
- Agile
6+
- `Projects` API was deprecated.
7+
- `type`, `filterId` properties changed from **optional** to **mandatory** in `CreateBoard` parameters interface.
8+
- `operationType` property added to `storeDevelopmentInformation` method in `DevelopmentInformation` API.
9+
- `SecurityInformation` API added.
10+
311
### 2.16.0
412

513
Short parameters were added for applicable methods.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ Available groups:
292292
- [deployments](https://developer.atlassian.com/cloud/jira/software/rest/api-group-deployments/#api-group-deployments)
293293
- [builds](https://developer.atlassian.com/cloud/jira/software/rest/api-group-builds/#api-group-builds)
294294
- [remoteLinks](https://developer.atlassian.com/cloud/jira/software/rest/api-group-remote-links/#api-group-remote-links)
295+
- [securityInformation](https://developer.atlassian.com/cloud/jira/software/rest/api-group-security-information/#api-group-security-information)
295296
- [otherOperations](https://developer.atlassian.com/cloud/jira/software/rest/api-group-other-operations/#api-group-other-operations)
296297
</details>
297298
<details>

package-lock.json

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

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.16.0",
3+
"version": "2.16.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",
@@ -52,32 +52,32 @@
5252
},
5353
"devDependencies": {
5454
"@swc-node/register": "^1.5.5",
55-
"@types/express": "^4.17.15",
55+
"@types/express": "^4.17.17",
5656
"@types/node": "^18.11.18",
5757
"@types/oauth": "^0.9.1",
5858
"@types/sinon": "^10.0.13",
59-
"@typescript-eslint/eslint-plugin": "^5.48.0",
60-
"@typescript-eslint/parser": "^5.48.0",
61-
"ava": "^5.1.0",
59+
"@typescript-eslint/eslint-plugin": "^5.50.0",
60+
"@typescript-eslint/parser": "^5.50.0",
61+
"ava": "^5.1.1",
6262
"dotenv": "^16.0.3",
63-
"eslint": "^8.31.0",
63+
"eslint": "^8.33.0",
6464
"eslint-config-airbnb": "^19.0.4",
6565
"eslint-config-airbnb-typescript": "^17.0.0",
66-
"eslint-import-resolver-typescript": "^3.5.2",
67-
"eslint-plugin-import": "^2.26.0",
66+
"eslint-import-resolver-typescript": "^3.5.3",
67+
"eslint-plugin-import": "^2.27.5",
6868
"eslint-plugin-sort-exports": "^0.8.0",
69-
"prettier": "^2.8.2",
69+
"prettier": "^2.8.3",
7070
"prettier-plugin-jsdoc": "^0.4.2",
7171
"sinon": "^15.0.1",
7272
"typedoc": "^0.23.24",
7373
"typedoc-plugin-extras": "^2.3.2",
74-
"typescript": "^4.9.4"
74+
"typescript": "^4.9.5"
7575
},
7676
"dependencies": {
7777
"atlassian-jwt": "^2.0.2",
7878
"axios": "^0.27.2",
7979
"form-data": "^4.0.0",
8080
"oauth": "^0.10.0",
81-
"tslib": "^2.4.1"
81+
"tslib": "^2.5.0"
8282
}
8383
}

src/agile/backlog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Backlog {
2828
url: '/rest/agile/1.0/backlog/issue',
2929
method: 'POST',
3030
data: {
31-
issues: parameters?.issues,
31+
issues: parameters.issues,
3232
},
3333
};
3434

src/agile/board.ts

Lines changed: 144 additions & 118 deletions
Large diffs are not rendered by default.

src/agile/builds.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Builds {
2525
* resource. This resource requires the 'WRITE' scope for Connect apps.
2626
*/
2727
async submitBuilds<T = Models.SubmitBuilds>(
28-
parameters: Parameters.SubmitBuilds | undefined,
28+
parameters: Parameters.SubmitBuilds,
2929
callback: Callback<T>
3030
): Promise<void>;
3131
/**
@@ -45,18 +45,18 @@ export class Builds {
4545
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
4646
* resource. This resource requires the 'WRITE' scope for Connect apps.
4747
*/
48-
async submitBuilds<T = Models.SubmitBuilds>(parameters?: Parameters.SubmitBuilds, callback?: never): Promise<T>;
48+
async submitBuilds<T = Models.SubmitBuilds>(parameters: Parameters.SubmitBuilds, callback?: never): Promise<T>;
4949
async submitBuilds<T = Models.SubmitBuilds>(
50-
parameters?: Parameters.SubmitBuilds,
50+
parameters: Parameters.SubmitBuilds,
5151
callback?: Callback<T>,
5252
): Promise<void | T> {
5353
const config: RequestConfig = {
5454
url: '/rest/builds/0.1/bulk',
5555
method: 'POST',
5656
data: {
57-
properties: parameters?.properties,
58-
builds: parameters?.builds,
59-
providerMetadata: parameters?.providerMetadata,
57+
properties: parameters.properties,
58+
builds: parameters.builds,
59+
providerMetadata: parameters.providerMetadata,
6060
},
6161
};
6262

@@ -78,10 +78,10 @@ export class Builds {
7878
* deleted successfully (if needed).
7979
*
8080
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
81-
* resource. This resource requires the 'WRITE' scope for Connect apps.
81+
* resource. This resource requires the 'DELETE' scope for Connect apps.
8282
*/
8383
async deleteBuildsByProperty<T = unknown>(
84-
parameters: Parameters.DeleteBuildsByProperty | undefined,
84+
parameters: Parameters.DeleteBuildsByProperty,
8585
callback: Callback<T>
8686
): Promise<void>;
8787
/**
@@ -99,21 +99,21 @@ export class Builds {
9999
* deleted successfully (if needed).
100100
*
101101
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
102-
* resource. This resource requires the 'WRITE' scope for Connect apps.
102+
* resource. This resource requires the 'DELETE' scope for Connect apps.
103103
*/
104104
async deleteBuildsByProperty<T = unknown>(
105-
parameters?: Parameters.DeleteBuildsByProperty,
105+
parameters: Parameters.DeleteBuildsByProperty,
106106
callback?: never
107107
): Promise<T>;
108108
async deleteBuildsByProperty<T = unknown>(
109-
parameters?: Parameters.DeleteBuildsByProperty,
109+
parameters: Parameters.DeleteBuildsByProperty,
110110
callback?: Callback<T>,
111111
): Promise<void | T> {
112112
const config: RequestConfig = {
113113
url: '/rest/builds/0.1/bulkByProperties',
114114
method: 'DELETE',
115115
params: {
116-
_updateSequenceNumber: parameters?._updateSequenceNumber || parameters?.updateSequenceNumber,
116+
_updateSequenceNumber: parameters._updateSequenceNumber || parameters.updateSequenceNumber,
117117
},
118118
};
119119

@@ -126,7 +126,7 @@ export class Builds {
126126
* The result will be what is currently stored, ignoring any pending updates or deletes.
127127
*
128128
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
129-
* resource. This resource requires the 'WRITE' scope for Connect apps.
129+
* resource. This resource requires the 'READ' scope for Connect apps.
130130
*/
131131
async getBuildByKey<T = Models.GetBuildByKey>(
132132
parameters: Parameters.GetBuildByKey,
@@ -138,7 +138,7 @@ export class Builds {
138138
* The result will be what is currently stored, ignoring any pending updates or deletes.
139139
*
140140
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
141-
* resource. This resource requires the 'WRITE' scope for Connect apps.
141+
* resource. This resource requires the 'READ' scope for Connect apps.
142142
*/
143143
async getBuildByKey<T = Models.GetBuildByKey>(parameters: Parameters.GetBuildByKey, callback?: never): Promise<T>;
144144
async getBuildByKey<T = Models.GetBuildByKey>(
@@ -160,7 +160,7 @@ export class Builds {
160160
* deleted successfully (if needed).
161161
*
162162
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
163-
* resource. This resource requires the 'WRITE' scope for Connect apps.
163+
* resource. This resource requires the 'DELETE' scope for Connect apps.
164164
*/
165165
async deleteBuildByKey<T = unknown>(parameters: Parameters.DeleteBuildByKey, callback: Callback<T>): Promise<void>;
166166
/**
@@ -170,7 +170,7 @@ export class Builds {
170170
* deleted successfully (if needed).
171171
*
172172
* Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this
173-
* resource. This resource requires the 'WRITE' scope for Connect apps.
173+
* resource. This resource requires the 'DELETE' scope for Connect apps.
174174
*/
175175
async deleteBuildByKey<T = unknown>(parameters: Parameters.DeleteBuildByKey, callback?: never): Promise<T>;
176176
async deleteBuildByKey<T = unknown>(

src/agile/client/agileClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Issue,
1111
Project,
1212
RemoteLinks,
13+
SecurityInformation,
1314
Sprint,
1415
} from '..';
1516

@@ -24,5 +25,6 @@ export class AgileClient extends BaseClient {
2425
issue = new Issue(this);
2526
project = new Project(this);
2627
remoteLinks = new RemoteLinks(this);
28+
securityInformation = new SecurityInformation(this);
2729
sprint = new Sprint(this);
2830
}

src/agile/deployments.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Deployments {
2525
* resource. This resource requires the 'WRITE' scope for Connect apps.
2626
*/
2727
async submitDeployments<T = Models.SubmitDeployments>(
28-
parameters: Parameters.SubmitDeployments | undefined,
28+
parameters: Parameters.SubmitDeployments,
2929
callback: Callback<T>
3030
): Promise<void>;
3131
/**
@@ -46,20 +46,20 @@ export class Deployments {
4646
* resource. This resource requires the 'WRITE' scope for Connect apps.
4747
*/
4848
async submitDeployments<T = Models.SubmitDeployments>(
49-
parameters?: Parameters.SubmitDeployments,
49+
parameters: Parameters.SubmitDeployments,
5050
callback?: never
5151
): Promise<T>;
5252
async submitDeployments<T = Models.SubmitDeployments>(
53-
parameters?: Parameters.SubmitDeployments,
53+
parameters: Parameters.SubmitDeployments,
5454
callback?: Callback<T>,
5555
): Promise<void | T> {
5656
const config: RequestConfig = {
5757
url: '/rest/deployments/0.1/bulk',
5858
method: 'POST',
5959
data: {
60-
properties: parameters?.properties,
61-
deployments: parameters?.deployments,
62-
providerMetadata: parameters?.providerMetadata,
60+
properties: parameters.properties,
61+
deployments: parameters.deployments,
62+
providerMetadata: parameters.providerMetadata,
6363
},
6464
};
6565

@@ -83,7 +83,7 @@ export class Deployments {
8383
* resource. This resource requires the 'DELETE' scope for Connect apps.
8484
*/
8585
async deleteDeploymentsByProperty<T = unknown>(
86-
parameters: Parameters.DeleteDeploymentsByProperty | undefined,
86+
parameters: Parameters.DeleteDeploymentsByProperty,
8787
callback: Callback<T>
8888
): Promise<void>;
8989
/**
@@ -103,18 +103,18 @@ export class Deployments {
103103
* resource. This resource requires the 'DELETE' scope for Connect apps.
104104
*/
105105
async deleteDeploymentsByProperty<T = unknown>(
106-
parameters?: Parameters.DeleteDeploymentsByProperty,
106+
parameters: Parameters.DeleteDeploymentsByProperty,
107107
callback?: never
108108
): Promise<T>;
109109
async deleteDeploymentsByProperty<T = unknown>(
110-
parameters?: Parameters.DeleteDeploymentsByProperty,
110+
parameters: Parameters.DeleteDeploymentsByProperty,
111111
callback?: Callback<T>,
112112
): Promise<void | T> {
113113
const config: RequestConfig = {
114114
url: '/rest/deployments/0.1/bulkByProperties',
115115
method: 'DELETE',
116116
params: {
117-
_updateSequenceNumber: parameters?._updateSequenceNumber || parameters?.updateSequenceNumber,
117+
_updateSequenceNumber: parameters._updateSequenceNumber || parameters.updateSequenceNumber,
118118
},
119119
};
120120

src/agile/developmentInformation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class DevelopmentInformation {
3939
data: {
4040
repositories: parameters.repositories,
4141
preventTransitions: parameters.preventTransitions,
42+
operationType: parameters.operationType,
4243
properties: parameters.properties,
4344
providerMetadata: parameters.providerMetadata,
4445
},

src/agile/featureFlags.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export class FeatureFlags {
2020
* In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to
2121
* submission. Details of which Feature Flags failed submission (if any) are available in the response object.
2222
*
23-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'WRITE' scope.
23+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
24+
* requires the 'WRITE' scope for Connect apps.
2425
*/
2526
async submitFeatureFlags<T = Models.SubmitFeatureFlags>(
26-
parameters: Parameters.SubmitFeatureFlags | undefined,
27+
parameters: Parameters.SubmitFeatureFlags,
2728
callback: Callback<T>
2829
): Promise<void>;
2930
/**
@@ -39,23 +40,24 @@ export class FeatureFlags {
3940
* In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to
4041
* submission. Details of which Feature Flags failed submission (if any) are available in the response object.
4142
*
42-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'WRITE' scope.
43+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
44+
* requires the 'WRITE' scope for Connect apps.
4345
*/
4446
async submitFeatureFlags<T = Models.SubmitFeatureFlags>(
45-
parameters?: Parameters.SubmitFeatureFlags,
47+
parameters: Parameters.SubmitFeatureFlags,
4648
callback?: never
4749
): Promise<T>;
4850
async submitFeatureFlags<T = Models.SubmitFeatureFlags>(
49-
parameters?: Parameters.SubmitFeatureFlags,
51+
parameters: Parameters.SubmitFeatureFlags,
5052
callback?: Callback<T>,
5153
): Promise<void | T> {
5254
const config: RequestConfig = {
5355
url: '/rest/featureflags/0.1/bulk',
5456
method: 'POST',
5557
data: {
56-
properties: parameters?.properties,
57-
flags: parameters?.flags,
58-
providerMetadata: parameters?.providerMetadata,
58+
properties: parameters.properties,
59+
flags: parameters.flags,
60+
providerMetadata: parameters.providerMetadata,
5961
},
6062
};
6163

@@ -74,10 +76,11 @@ export class FeatureFlags {
7476
* Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been
7577
* deleted successfully (if needed).
7678
*
77-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'DELETE' scope.
79+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
80+
* requires the 'DELETE' scope for Connect apps.
7881
*/
7982
async deleteFeatureFlagsByProperty<T = unknown>(
80-
parameters: Parameters.DeleteFeatureFlagsByProperty | undefined,
83+
parameters: Parameters.DeleteFeatureFlagsByProperty,
8184
callback: Callback<T>
8285
): Promise<void>;
8386
/**
@@ -92,14 +95,15 @@ export class FeatureFlags {
9295
* Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been
9396
* deleted successfully (if needed).
9497
*
95-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'DELETE' scope.
98+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
99+
* requires the 'DELETE' scope for Connect apps.
96100
*/
97101
async deleteFeatureFlagsByProperty<T = unknown>(
98-
parameters?: Parameters.DeleteFeatureFlagsByProperty,
102+
parameters: Parameters.DeleteFeatureFlagsByProperty,
99103
callback?: never
100104
): Promise<T>;
101105
async deleteFeatureFlagsByProperty<T = unknown>(
102-
parameters?: Parameters.DeleteFeatureFlagsByProperty,
106+
parameters: Parameters.DeleteFeatureFlagsByProperty,
103107
callback?: Callback<T>,
104108
): Promise<void | T> {
105109
const config: RequestConfig = {
@@ -118,7 +122,8 @@ export class FeatureFlags {
118122
*
119123
* The result will be what is currently stored, ignoring any pending updates or deletes.
120124
*
121-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'READ' scope.
125+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
126+
* requires the 'READ' scope for Connect apps.
122127
*/
123128
async getFeatureFlagById<T = Models.GetFeatureFlagById>(
124129
parameters: Parameters.GetFeatureFlagById,
@@ -129,7 +134,8 @@ export class FeatureFlags {
129134
*
130135
* The result will be what is currently stored, ignoring any pending updates or deletes.
131136
*
132-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'READ' scope.
137+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
138+
* requires the 'READ' scope for Connect apps.
133139
*/
134140
async getFeatureFlagById<T = Models.GetFeatureFlagById>(
135141
parameters: Parameters.GetFeatureFlagById,
@@ -153,7 +159,8 @@ export class FeatureFlags {
153159
* Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been
154160
* deleted successfully (if needed).
155161
*
156-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'DELETE' scope.
162+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
163+
* requires the 'DELETE' scope for Connect apps.
157164
*/
158165
async deleteFeatureFlagById<T = unknown>(
159166
parameters: Parameters.DeleteFeatureFlagById,
@@ -165,7 +172,8 @@ export class FeatureFlags {
165172
* Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been
166173
* deleted successfully (if needed).
167174
*
168-
* Only apps that define the Feature Flags module can access this resource. This resource requires the 'DELETE' scope.
175+
* Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource
176+
* requires the 'DELETE' scope for Connect apps.
169177
*/
170178
async deleteFeatureFlagById<T = unknown>(parameters: Parameters.DeleteFeatureFlagById, callback?: never): Promise<T>;
171179
async deleteFeatureFlagById<T = unknown>(

0 commit comments

Comments
 (0)