Skip to content

Commit 7d15f55

Browse files
committed
v2.18.0
1 parent 81c91a8 commit 7d15f55

22 files changed

+446
-262
lines changed

CHANGELOG.md

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

3+
### 2.18.0
4+
5+
- Agile
6+
- `Fields` model added for `Issue` Model.
7+
- Version 3:
8+
- Support simple string body (comment) was added to `addComment` method of `issueComments` API.
9+
- Version 2, Version 3:
10+
- `putAddonProperty` method fixed. Now you can provide property for set.
11+
312
### 2.17.0
413

514
- JSDoc improvements

package-lock.json

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

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.17.0",
3+
"version": "2.18.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",
@@ -51,29 +51,28 @@
5151
}
5252
},
5353
"devDependencies": {
54-
"@swc-node/register": "^1.6.2",
55-
"@swc/helpers": "^0.4.14",
54+
"@swc-node/register": "^1.6.4",
55+
"@swc/helpers": "^0.5.0",
5656
"@types/express": "^4.17.17",
57-
"@types/node": "^18.15.10",
57+
"@types/node": "^18.15.11",
5858
"@types/oauth": "^0.9.1",
5959
"@types/sinon": "^10.0.13",
60-
"@typescript-eslint/eslint-plugin": "^5.56.0",
61-
"@typescript-eslint/parser": "^5.56.0",
60+
"@typescript-eslint/eslint-plugin": "^5.58.0",
61+
"@typescript-eslint/parser": "^5.58.0",
6262
"ava": "^5.2.0",
6363
"dotenv": "^16.0.3",
64-
"eslint": "^8.36.0",
64+
"eslint": "^8.38.0",
6565
"eslint-config-airbnb": "^19.0.4",
6666
"eslint-config-airbnb-typescript": "^17.0.0",
67-
"eslint-import-resolver-typescript": "^3.5.3",
67+
"eslint-import-resolver-typescript": "^3.5.5",
6868
"eslint-plugin-import": "^2.27.5",
69-
"eslint-plugin-sort-exports": "^0.8.0",
7069
"prettier": "^2.8.7",
7170
"prettier-plugin-jsdoc": "^0.4.2",
7271
"sinon": "^15.0.3",
7372
"ts-node": "^10.9.1",
7473
"typedoc": "^0.23.28",
7574
"typedoc-plugin-extras": "^2.3.2",
76-
"typescript": "^5.0.2"
75+
"typescript": "^5.0.4"
7776
},
7877
"dependencies": {
7978
"atlassian-jwt": "^2.0.2",

src/agile/models/fields.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { Attachment } from '../../version3/models';
2+
import { Epic } from './epic';
3+
import { FixVersion } from './fixVersion';
4+
import { Issue } from './issue';
5+
import { IssueType } from './issueType';
6+
import { Progress } from './progress';
7+
import { Project } from './project';
8+
import { Sprint } from './sprint';
9+
import { Status } from './status';
10+
import { User } from './user';
11+
import { Version } from './version';
12+
import {
13+
Comment,
14+
IssueLink,
15+
Priority,
16+
ProjectComponent,
17+
Resolution,
18+
RichText,
19+
TimeTrackingDetails,
20+
Votes,
21+
Watchers,
22+
Worklog,
23+
} from '../../version2/models';
24+
25+
export interface Fields {
26+
[key: string]: any;
27+
28+
aggregateprogress: Progress;
29+
aggregatetimeestimate: number | null;
30+
aggregatetimeoriginalestimate: number | null;
31+
aggregatetimespent: number | null;
32+
assignee: User;
33+
attachment: Attachment[];
34+
comment: {
35+
comments: Comment[];
36+
self: string;
37+
maxResults: number;
38+
total: number;
39+
startAt: number;
40+
};
41+
components: ProjectComponent[];
42+
created: string;
43+
creator: User;
44+
description: string | null;
45+
duedate: string | null;
46+
environment: RichText | null;
47+
epic: Epic | null;
48+
fixVersions: FixVersion[];
49+
flagged: boolean;
50+
issuelinks: IssueLink[];
51+
issuerestriction: {
52+
issuerestrictions: any;
53+
shouldDisplay: boolean;
54+
};
55+
issuetype: IssueType;
56+
labels: string[];
57+
lastViewed: string | null;
58+
priority: Priority;
59+
progress: Progress;
60+
project: Project;
61+
reporter: User;
62+
resolution: Resolution | null;
63+
resolutiondate: string | null;
64+
security: any | null;
65+
sprint: Sprint;
66+
status: Status;
67+
statuscategorychangedate: string;
68+
subtasks: Issue[];
69+
summary: string;
70+
timeestimate: number | null;
71+
timeoriginalestimate: any | null;
72+
timespent: number | null;
73+
timetracking: TimeTrackingDetails;
74+
updated: string;
75+
versions: Version[];
76+
votes: Votes;
77+
watches: Watchers;
78+
worklog: {
79+
startAt: number;
80+
maxResults: number;
81+
total: number;
82+
worklogs: Worklog[];
83+
};
84+
workratio: number;
85+
}

src/agile/models/fixVersion.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** Represents a fix version in a Jira project. */
2+
export interface FixVersion {
3+
/** The URL of the fix version details. */
4+
self: string;
5+
/** The unique identifier of the fix version. */
6+
id: string;
7+
/** The description of the fix version. */
8+
description: string;
9+
/** The name of the fix version. */
10+
name: string;
11+
/** Whether the fix version is archived. */
12+
archived: boolean;
13+
/** Whether the fix version is released. */
14+
released: boolean;
15+
/** The release date of the fix version, if applicable. */
16+
releaseDate?: string;
17+
}

src/agile/models/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ export * from './submittedVulnerabilitiesResult';
8585
export * from './subquery';
8686
export * from './toggleFeatures';
8787
export * from './userAvatarUrls';
88-
export * from './userJson';
88+
export * from './user';
8989
export * from './version';
9090
export * from './vulnerability';

src/agile/models/issue.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Fields } from './fields';
12
import { Operations } from './operations';
23

34
/** @deprecated Use {@link Issue} instead. */
@@ -243,5 +244,5 @@ export interface Issue {
243244
actuallyIncluded?: string[];
244245
excluded?: string[];
245246
};
246-
fields?: {};
247+
fields?: Fields;
247248
}

src/agile/models/issueType.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** Details about an issue type. */
2+
export interface IssueType {
3+
/** The URL of the issue type. */
4+
self: string;
5+
/** The unique identifier of the issue type. */
6+
id: string;
7+
/** The description of the issue type. */
8+
description: string;
9+
/** The URL of the icon for the issue type. */
10+
iconUrl: string;
11+
/** The name of the issue type. */
12+
name: string;
13+
/** Whether the issue type is a subtask type. */
14+
subtask: boolean;
15+
/** The ID of the avatar for the issue type. */
16+
avatarId: number;
17+
/** The ID of the entity for the issue type. */
18+
entityId: string;
19+
/** The hierarchy level of the issue type. */
20+
hierarchyLevel: number;
21+
}

src/agile/models/progress.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** Represents the progress of a task. */
2+
export interface Progress {
3+
/** The current progress value. */
4+
progress: number;
5+
/** The total progress value. */
6+
total: number;
7+
}

src/agile/models/project.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AvatarUrls } from './avatarUrls';
2+
3+
/** Details about a project. */
4+
export interface Project {
5+
/** The URL of the project details. */
6+
self: string;
7+
/** The ID of the project. */
8+
id: string;
9+
/** The key of the project. */
10+
key: string;
11+
/** The name of the project. */
12+
name: string;
13+
/**
14+
* The [project
15+
* type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the
16+
* project.
17+
*/
18+
projectTypeKey: string;
19+
/** Whether the project is simplified. */
20+
simplified: boolean;
21+
/** The avatar URLs of the project. */
22+
avatarUrls: AvatarUrls;
23+
}

src/agile/models/status.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { StatusCategory } from './statusCategory';
2+
3+
export interface Status {
4+
self: string;
5+
description: string;
6+
iconUrl: string;
7+
name: string;
8+
id: string;
9+
statusCategory: StatusCategory;
10+
}

src/agile/models/statusCategory.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface StatusCategory {
2+
self: string;
3+
id: number;
4+
key: string;
5+
colorName: string;
6+
name: string;
7+
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/** @deprecated Use {@link UserJson} instead. */
2-
export type UserJsonBean = UserJson;
1+
/** @deprecated Use {@link User} instead. */
2+
export type UserJsonBean = User;
33

44
/**
55
* User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:*
@@ -12,16 +12,16 @@ export type UserJsonBean = UserJson;
1212
* - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have
1313
* fallback values.
1414
*/
15-
export interface UserJson {
15+
export interface User {
1616
/** The URL of the user. */
17-
self?: string;
17+
self: string;
1818
/**
1919
* @deprecated This property is no longer available and will be removed from the documentation soon. See the
2020
* [deprecation
2121
* notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
2222
* for details.
2323
*/
24-
name?: string;
24+
name: string;
2525
/**
2626
* @deprecated This property is no longer available and will be removed from the documentation soon. See the
2727
* [deprecation
@@ -33,11 +33,11 @@ export interface UserJson {
3333
* The account ID of the user, which uniquely identifies the user across all Atlassian products. For example,
3434
* _5b10ac8d82e05b22cc7d4ef5_.
3535
*/
36-
accountId?: string;
36+
accountId: string;
3737
/** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */
38-
emailAddress?: string;
38+
emailAddress: string | null;
3939
/** Details about the avatars for an item. */
40-
avatarUrls?: {
40+
avatarUrls: {
4141
/** The URL of the item's 16x16 pixel avatar. */
4242
'16x16'?: string;
4343
/** The URL of the item's 24x24 pixel avatar. */
@@ -48,17 +48,17 @@ export interface UserJson {
4848
'48x48'?: string;
4949
};
5050
/** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */
51-
displayName?: string;
51+
displayName: string;
5252
/** Whether the user is active. */
53-
active?: boolean;
53+
active: boolean;
5454
/**
5555
* The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as
5656
* null.
5757
*/
58-
timeZone?: string;
58+
timeZone: string | null;
5959
/**
6060
* The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application
6161
* user) or 'customer' (Jira Service Desk customer user)
6262
*/
63-
accountType?: string;
63+
accountType: string;
6464
}

src/version2/announcementBanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export class AnnouncementBanner {
4949
url: '/rest/api/2/announcementBanner',
5050
method: 'PUT',
5151
data: {
52-
message: parameters.message,
5352
isDismissible: parameters.isDismissible,
5453
isEnabled: parameters.isEnabled,
54+
message: parameters.message,
5555
visibility: parameters.visibility,
5656
},
5757
};

src/version2/appMigration.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export class AppMigration {
3131
url: '/rest/atlassian-connect/1/migration/field',
3232
method: 'PUT',
3333
headers: {
34-
'Atlassian-Transfer-Id': parameters.transferId,
3534
'Atlassian-Account-Id': parameters.accountId,
35+
'Atlassian-Transfer-Id': parameters.transferId,
3636
},
3737
data: {
3838
updateValueList: parameters.updateValueList,
@@ -66,9 +66,9 @@ export class AppMigration {
6666
url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`,
6767
method: 'PUT',
6868
headers: {
69-
'Content-Type': 'application/json',
70-
'Atlassian-Transfer-Id': parameters.transferId,
7169
'Atlassian-Account-Id': parameters.accountId,
70+
'Atlassian-Transfer-Id': parameters.transferId,
71+
'Content-Type': 'application/json',
7272
},
7373
data: parameters.body ?? parameters.entities,
7474
};
@@ -103,9 +103,9 @@ export class AppMigration {
103103
'Atlassian-Transfer-Id': parameters.transferId,
104104
},
105105
data: {
106-
workflowEntityId: parameters.workflowEntityId,
107-
ruleIds: parameters.ruleIds,
108106
expand: parameters.expand,
107+
ruleIds: parameters.ruleIds,
108+
workflowEntityId: parameters.workflowEntityId,
109109
},
110110
};
111111

src/version2/appProperties.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export class AppProperties {
114114
const config: RequestConfig = {
115115
url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`,
116116
method: 'PUT',
117+
data: parameters.property,
117118
};
118119

119120
return this.client.sendRequest(config, callback);

0 commit comments

Comments
 (0)