Skip to content

Commit 39ca5a3

Browse files
2.14.0 RC (MrRefactoring#202)
* models index file updated * dependencies updates * MrRefactoring#199 fixVersion definition fixed * sorting exports * Version 2 api updates * Version 3 api updates
1 parent a6d7676 commit 39ca5a3

Some content is hidden

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

73 files changed

+1485
-368
lines changed

CHANGELOG.md

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

3+
### 2.14.0
4+
5+
- README: Fast jump to basic authentication topic fixed.
6+
- Version 2 and Version 3:
7+
- `fixVersion` type definition fixed (`Issue.Fields` model). Thanks to [Eloy Lafuente](https://github.com/stronk7) for reporting the issue.
8+
- `AnnouncementBanner` API added.
9+
- `Status` API added.
10+
- `groupId` property added to `getDashboardsPaginated` method in `Dashboard` API.
11+
- `groupId` property added to `addActorUsers`, `deleteActor`, `addProjectRoleActorsToRole`, `deleteProjectRoleActorsFromRole` methods in `ProjectRoleActors` API.
12+
313
### 2.13.0
414

515
- Service Desk:

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usability, consistency, and performance are key focuses of jira.js, and it also
2121
- [Documentation](#documentation)
2222
- [Usage](#usage)
2323
- [Authentication](#authentication)
24-
- [Basic](#basic-authenticationhttpsdeveloperatlassiancomcloudjiraplatformbasic-auth-for-rest-apis)
24+
- [Basic](#basic-authentication)
2525
- [OAuth](#oauth)
2626
- [OAuth 2.0](#oauth-20)
2727
- [JWT](#jwt)
@@ -233,6 +233,7 @@ Available groups:
233233
<details>
234234
<summary>Version 2 Cloud REST API group</summary>
235235

236+
- [announcementBanner](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-announcement-banner/#api-group-announcement-banner)
236237
- [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-application-roles/#api-group-application-roles)
237238
- [appMigration](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-migration/#api-group-app-migration)
238239
- [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-audit-records/#api-group-audit-records)
@@ -299,6 +300,7 @@ Available groups:
299300
- [screenTabFields](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-tab-fields/#api-group-screen-tab-fields)
300301
- [screenSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-schemes/#api-group-screen-schemes)
301302
- [serverInfo](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-server-info/#api-group-server-info)
303+
- [status](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-status/#api-group-status)
302304
- [tasks](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-group-tasks)
303305
- [timeTracking](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-time-tracking/#api-group-time-tracking)
304306
- [users](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-group-users)
@@ -319,6 +321,7 @@ Available groups:
319321
<details>
320322
<summary>Version 3 Cloud REST API group</summary>
321323

324+
- [announcementBanner](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-announcement-banner/#api-group-announcement-banner)
322325
- [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-application-roles/#api-group-application-roles)
323326
- [appMigration](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-migration/#api-group-app-migration)
324327
- [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-audit-records/#api-group-audit-records)
@@ -385,6 +388,7 @@ Available groups:
385388
- [screenTabFields](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-group-screen-tab-fields)
386389
- [screenSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-group-screen-schemes)
387390
- [serverInfo](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-server-info/#api-group-server-info)
391+
- [status](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-status/#api-group-status)
388392
- [tasks](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-group-tasks)
389393
- [timeTracking](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-time-tracking/#api-group-time-tracking)
390394
- [users](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-group-users)

package-lock.json

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

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.13.0",
3+
"version": "2.14.0",
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",
@@ -10,6 +10,9 @@
1010
"keywords": [
1111
"jira",
1212
"api",
13+
"agile",
14+
"cloud",
15+
"serviceDesk",
1316
"wrapper",
1417
"client",
1518
"rest"
@@ -47,31 +50,31 @@
4750
}
4851
},
4952
"devDependencies": {
50-
"@swc-node/register": "^1.4.2",
53+
"@swc-node/register": "^1.5.1",
5154
"@types/express": "^4.17.13",
52-
"@types/node": "^17.0.27",
55+
"@types/node": "^17.0.33",
5356
"@types/oauth": "^0.9.1",
5457
"@types/sinon": "^10.0.11",
55-
"@typescript-eslint/eslint-plugin": "^5.21.0",
56-
"@typescript-eslint/parser": "^5.21.0",
58+
"@typescript-eslint/eslint-plugin": "^5.23.0",
59+
"@typescript-eslint/parser": "^5.23.0",
5760
"ava": "^4.2.0",
58-
"dotenv": "^16.0.0",
59-
"eslint": "^8.14.0",
61+
"dotenv": "^16.0.1",
62+
"eslint": "^8.15.0",
6063
"eslint-config-airbnb": "^19.0.4",
6164
"eslint-config-airbnb-typescript": "^17.0.0",
6265
"eslint-import-resolver-typescript": "^2.7.1",
6366
"eslint-plugin-import": "^2.26.0",
6467
"eslint-plugin-sort-exports": "^0.6.0",
6568
"prettier": "^2.6.2",
6669
"prettier-plugin-jsdoc": "^0.3.38",
67-
"sinon": "^13.0.2",
70+
"sinon": "^14.0.0",
6871
"typedoc": "^0.22.15",
6972
"typedoc-plugin-extras": "^2.2.3",
70-
"typescript": "^4.6.3"
73+
"typescript": "^4.6.4"
7174
},
7275
"dependencies": {
7376
"atlassian-jwt": "^2.0.2",
74-
"axios": "^0.27.0",
77+
"axios": "^0.27.2",
7578
"form-data": "^4.0.0",
7679
"oauth": "^0.9.15",
7780
"tslib": "^2.4.0"

src/version2/announcementBanner.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import * as Models from './models';
2+
import * as Parameters from './parameters';
3+
import { Callback } from '../callback';
4+
import { Client } from '../clients';
5+
import { RequestConfig } from '../requestConfig';
6+
7+
export class AnnouncementBanner {
8+
constructor(private client: Client) {}
9+
10+
/**
11+
* Returns the current announcement banner configuration.
12+
*
13+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
14+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
15+
*/
16+
async getBanner<T = Models.AnnouncementBannerConfiguration>(callback: Callback<T>): Promise<void>;
17+
/**
18+
* Returns the current announcement banner configuration.
19+
*
20+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
21+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
22+
*/
23+
async getBanner<T = Models.AnnouncementBannerConfiguration>(callback?: never): Promise<T>;
24+
async getBanner<T = Models.AnnouncementBannerConfiguration>(callback?: Callback<T>): Promise<void | T> {
25+
const config: RequestConfig = {
26+
url: '/rest/api/2/announcementBanner',
27+
method: 'GET',
28+
};
29+
30+
return this.client.sendRequest(config, callback);
31+
}
32+
33+
/**
34+
* Updates the announcement banner configuration.
35+
*
36+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
37+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
38+
*/
39+
async setBanner<T = void>(parameters: Parameters.SetBanner, callback: Callback<T>): Promise<void>;
40+
/**
41+
* Updates the announcement banner configuration.
42+
*
43+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
44+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
45+
*/
46+
async setBanner<T = void>(parameters: Parameters.SetBanner, callback?: never): Promise<T>;
47+
async setBanner<T = void>(parameters: Parameters.SetBanner, callback?: Callback<T>): Promise<void | T> {
48+
const config: RequestConfig = {
49+
url: '/rest/api/2/announcementBanner',
50+
method: 'PUT',
51+
data: {
52+
message: parameters.message,
53+
isDismissible: parameters.isDismissible,
54+
isEnabled: parameters.isEnabled,
55+
visibility: parameters.visibility,
56+
},
57+
};
58+
59+
return this.client.sendRequest(config, callback);
60+
}
61+
}

src/version2/client/version2Client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BaseClient } from '../../clients';
22
import {
3+
AnnouncementBanner,
34
ApplicationRoles,
45
AppMigration,
56
AppProperties,
@@ -68,6 +69,7 @@ import {
6869
ScreenTabFields,
6970
ScreenTabs,
7071
ServerInfo,
72+
Status,
7173
Tasks,
7274
TimeTracking,
7375
UserProperties,
@@ -85,6 +87,7 @@ import {
8587
} from '..';
8688

8789
export class Version2Client extends BaseClient {
90+
announcementBanner = new AnnouncementBanner(this);
8891
applicationRoles = new ApplicationRoles(this);
8992
appMigration = new AppMigration(this);
9093
appProperties = new AppProperties(this);
@@ -153,6 +156,7 @@ export class Version2Client extends BaseClient {
153156
screenTabFields = new ScreenTabFields(this);
154157
screenTabs = new ScreenTabs(this);
155158
serverInfo = new ServerInfo(this);
159+
status = new Status(this);
156160
tasks = new Tasks(this);
157161
timeTracking = new TimeTracking(this);
158162
userProperties = new UserProperties(this);

src/version2/dashboards.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export class Dashboards {
161161
accountId: parameters?.accountId,
162162
owner: parameters?.owner,
163163
groupname: parameters?.groupname,
164+
groupId: parameters?.groupId,
164165
projectId: parameters?.projectId,
165166
orderBy: parameters?.orderBy,
166167
startAt: parameters?.startAt,

src/version2/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from './announcementBanner';
12
export * from './appMigration';
23
export * from './appProperties';
34
export * from './applicationRoles';
@@ -66,6 +67,7 @@ export * from './screenTabFields';
6667
export * from './screenTabs';
6768
export * from './screens';
6869
export * from './serverInfo';
70+
export * from './status';
6971
export * from './tasks';
7072
export * from './timeTracking';
7173
export * from './userProperties';

src/version2/models/actorInput.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ export type ActorInputBean = ActorInput;
33

44
export interface ActorInput {
55
/**
6-
* The account IDs of the users to add as default actors. This parameter accepts a comma-separated list. For example,
7-
* `"user":["5b10a2844c20165700ede21g", "5b109f2e9729b51b54dc274d"]`.
6+
* The account IDs of the users to add as default actors. This parameter accepts a comma-separated list. For
7+
* example, `"user":["5b10a2844c20165700ede21g", "5b109f2e9729b51b54dc274d"]`.
88
*/
99
user?: string[];
1010
/**
11-
* The name of the group to add as a default actor. This parameter accepts a comma-separated list. For example,
12-
* `"group":["project-admin", "jira-developers"]`.
11+
* The ID of the group to add as a default actor. This parameter cannot be used with the `group` parameter This
12+
* parameter accepts a comma-separated list. For example, `"groupId":["77f6ab39-e755-4570-a6ae-2d7a8df0bcb8",
13+
* "0c011f85-69ed-49c4-a801-3b18d0f771bc"]`.
14+
*/
15+
groupId?: string[];
16+
/**
17+
* The name of the group to add as a default actor. This parameter cannot be used with the `groupId` parameter. As a
18+
* group's name can change,use of `groupId` is recommended. This parameter accepts a comma-separated list. For
19+
* example, `"group":["project-admin", "jira-developers"]`.
1320
*/
1421
group?: string[];
1522
}

src/version2/models/actorsMap.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
export interface ActorsMap {
22
/** The user account ID of the user to add. */
33
user?: string[];
4-
/** The name of the group to add. */
4+
/**
5+
* The name of the group to add. This parameter cannot be used with the `groupId` parameter. As a group's name can
6+
* change, use of `groupId` is recommended.
7+
*/
58
group?: string[];
9+
/** The ID of the group to add. This parameter cannot be used with the `group` parameter. */
10+
groupId?: string[];
611
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** Announcement banner configuration. */
2+
export interface AnnouncementBannerConfiguration {
3+
/** The text on the announcement banner. */
4+
message?: string;
5+
/** Flag indicating if the announcement banner can be dismissed by the user. */
6+
isDismissible?: boolean;
7+
/** Flag indicating if the announcement banner is enabled or not. */
8+
isEnabled?: boolean;
9+
/** Hash of the banner data. The client detects updates by comparing hash IDs. */
10+
hashId?: string;
11+
/** Visibility of the announcement banner. */
12+
visibility?: string;
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** Configuration of the announcement banner. */
2+
export interface AnnouncementBannerConfigurationUpdate {
3+
/** The text on the announcement banner. */
4+
message?: string;
5+
/** Flag indicating if the announcement banner can be dismissed by the user. */
6+
isDismissible?: boolean;
7+
/** Flag indicating if the announcement banner is enabled or not. */
8+
isEnabled?: boolean;
9+
/** Visibility of the announcement banner. Can be public or private. */
10+
visibility?: string;
11+
}

src/version2/models/fields.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Attachment } from './attachment';
22
import { Comment } from './comment';
33
import { Component } from './component';
4+
import { FixVersion } from './fixVersion';
45
import { Issue } from './issue';
56
import { IssueLink } from './issueLink';
67
import { IssueTypeDetails } from './issueTypeDetails';
@@ -19,14 +20,15 @@ import { Worklog } from './worklog';
1920
export interface Fields {
2021
[key: string]: any;
2122

23+
statuscategorychangedate?: string;
2224
/** The estimate of how much longer working on the issue will take, in seconds. */
2325
aggregatetimespent: number | null;
2426
/** The assignee of the linked issue. */
2527
assignee: UserDetails;
2628
/** The time the issue is due. */
2729
duedate: string | null;
2830
/** The list of versions where the issue was fixed. */
29-
fixVersions: string[];
31+
fixVersions: FixVersion[];
3032
lastViewed: string | null;
3133
/** The issue parent. */
3234
parent?: Issue;

src/version2/models/fixVersion.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export interface FixVersion {
2+
self: string;
3+
id: string;
4+
description: string;
5+
name: string;
6+
archived: boolean;
7+
released: boolean;
8+
releaseDate?: string;
9+
}

src/version2/models/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export * from './actorInput';
22
export * from './actorsMap';
33
export * from './addField';
44
export * from './addGroup';
5+
export * from './announcementBannerConfiguration';
6+
export * from './announcementBannerConfigurationUpdate';
57
export * from './application';
68
export * from './applicationProperty';
79
export * from './applicationRole';
@@ -134,6 +136,7 @@ export * from './filter';
134136
export * from './filterDetails';
135137
export * from './filterSubscription';
136138
export * from './filterSubscriptionsList';
139+
export * from './fixVersion';
137140
export * from './foundGroup';
138141
export * from './foundGroups';
139142
export * from './foundUsers';
@@ -226,6 +229,7 @@ export * from './jiraExpressionsAnalysis';
226229
export * from './jiraExpressionsComplexity';
227230
export * from './jiraExpressionsComplexityValue';
228231
export * from './jiraExpressionValidationError';
232+
export * from './jiraStatus';
229233
export * from './jQLPersonalDataMigrationRequest';
230234
export * from './jqlQueriesToParse';
231235
export * from './jqlQueriesToSanitize';
@@ -304,6 +308,7 @@ export * from './pageNotificationScheme';
304308
export * from './pageOfChangelogs';
305309
export * from './pageOfComments';
306310
export * from './pageOfDashboards';
311+
export * from './pageOfStatuses';
307312
export * from './pageOfWorklogs';
308313
export * from './pageProject';
309314
export * from './pageProjectDetails';
@@ -339,6 +344,7 @@ export * from './projectEmailAddress';
339344
export * from './projectFeature';
340345
export * from './projectFeatures';
341346
export * from './projectFeatureToggleRequest';
347+
export * from './projectId';
342348
export * from './projectIdentifier';
343349
export * from './projectIdentifiers';
344350
export * from './projectIds';
@@ -348,6 +354,7 @@ export * from './projectIssueSecurityLevels';
348354
export * from './projectIssueTypeHierarchy';
349355
export * from './projectIssueTypeMapping';
350356
export * from './projectIssueTypeMappings';
357+
export * from './projectIssueTypes';
351358
export * from './projectIssueTypesHierarchyLevel';
352359
export * from './projectLandingPageInfo';
353360
export * from './projectPermissions';
@@ -404,8 +411,13 @@ export * from './simpleListWrapperApplicationRole';
404411
export * from './simpleListWrapperGroupName';
405412
export * from './status';
406413
export * from './statusCategory';
414+
export * from './statusCreate';
415+
export * from './statusCreateRequest';
407416
export * from './statusDetails';
408417
export * from './statusMapping';
418+
export * from './statusScope';
419+
export * from './statusUpdate';
420+
export * from './statusUpdateRequest';
409421
export * from './stringList';
410422
export * from './suggestedIssue';
411423
export * from './systemAvatars';

0 commit comments

Comments
 (0)