Skip to content

Commit

Permalink
v2.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRefactoring committed Apr 12, 2023
1 parent 81c91a8 commit 7d15f55
Show file tree
Hide file tree
Showing 22 changed files with 446 additions and 262 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Jira.js changelog

### 2.18.0

- Agile
- `Fields` model added for `Issue` Model.
- Version 3:
- Support simple string body (comment) was added to `addComment` method of `issueComments` API.
- Version 2, Version 3:
- `putAddonProperty` method fixed. Now you can provide property for set.

### 2.17.0

- JSDoc improvements
Expand Down
372 changes: 187 additions & 185 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira.js",
"version": "2.17.0",
"version": "2.18.0",
"description": "jira.js is a powerful Node.JS/Browser module that allows you to interact with the Jira API very easily",
"main": "out/index.js",
"types": "out/index.d.ts",
Expand Down Expand Up @@ -51,29 +51,28 @@
}
},
"devDependencies": {
"@swc-node/register": "^1.6.2",
"@swc/helpers": "^0.4.14",
"@swc-node/register": "^1.6.4",
"@swc/helpers": "^0.5.0",
"@types/express": "^4.17.17",
"@types/node": "^18.15.10",
"@types/node": "^18.15.11",
"@types/oauth": "^0.9.1",
"@types/sinon": "^10.0.13",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"ava": "^5.2.0",
"dotenv": "^16.0.3",
"eslint": "^8.36.0",
"eslint": "^8.38.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-sort-exports": "^0.8.0",
"prettier": "^2.8.7",
"prettier-plugin-jsdoc": "^0.4.2",
"sinon": "^15.0.3",
"ts-node": "^10.9.1",
"typedoc": "^0.23.28",
"typedoc-plugin-extras": "^2.3.2",
"typescript": "^5.0.2"
"typescript": "^5.0.4"
},
"dependencies": {
"atlassian-jwt": "^2.0.2",
Expand Down
85 changes: 85 additions & 0 deletions src/agile/models/fields.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { Attachment } from '../../version3/models';
import { Epic } from './epic';
import { FixVersion } from './fixVersion';
import { Issue } from './issue';
import { IssueType } from './issueType';
import { Progress } from './progress';
import { Project } from './project';
import { Sprint } from './sprint';
import { Status } from './status';
import { User } from './user';
import { Version } from './version';
import {
Comment,
IssueLink,
Priority,
ProjectComponent,
Resolution,
RichText,
TimeTrackingDetails,
Votes,
Watchers,
Worklog,
} from '../../version2/models';

export interface Fields {
[key: string]: any;

aggregateprogress: Progress;
aggregatetimeestimate: number | null;
aggregatetimeoriginalestimate: number | null;
aggregatetimespent: number | null;
assignee: User;
attachment: Attachment[];
comment: {
comments: Comment[];
self: string;
maxResults: number;
total: number;
startAt: number;
};
components: ProjectComponent[];
created: string;
creator: User;
description: string | null;
duedate: string | null;
environment: RichText | null;
epic: Epic | null;
fixVersions: FixVersion[];
flagged: boolean;
issuelinks: IssueLink[];
issuerestriction: {
issuerestrictions: any;
shouldDisplay: boolean;
};
issuetype: IssueType;
labels: string[];
lastViewed: string | null;
priority: Priority;
progress: Progress;
project: Project;
reporter: User;
resolution: Resolution | null;
resolutiondate: string | null;
security: any | null;
sprint: Sprint;
status: Status;
statuscategorychangedate: string;
subtasks: Issue[];
summary: string;
timeestimate: number | null;
timeoriginalestimate: any | null;
timespent: number | null;
timetracking: TimeTrackingDetails;
updated: string;
versions: Version[];
votes: Votes;
watches: Watchers;
worklog: {
startAt: number;
maxResults: number;
total: number;
worklogs: Worklog[];
};
workratio: number;
}
17 changes: 17 additions & 0 deletions src/agile/models/fixVersion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** Represents a fix version in a Jira project. */
export interface FixVersion {
/** The URL of the fix version details. */
self: string;
/** The unique identifier of the fix version. */
id: string;
/** The description of the fix version. */
description: string;
/** The name of the fix version. */
name: string;
/** Whether the fix version is archived. */
archived: boolean;
/** Whether the fix version is released. */
released: boolean;
/** The release date of the fix version, if applicable. */
releaseDate?: string;
}
2 changes: 1 addition & 1 deletion src/agile/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ export * from './submittedVulnerabilitiesResult';
export * from './subquery';
export * from './toggleFeatures';
export * from './userAvatarUrls';
export * from './userJson';
export * from './user';
export * from './version';
export * from './vulnerability';
3 changes: 2 additions & 1 deletion src/agile/models/issue.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Fields } from './fields';
import { Operations } from './operations';

/** @deprecated Use {@link Issue} instead. */
Expand Down Expand Up @@ -243,5 +244,5 @@ export interface Issue {
actuallyIncluded?: string[];
excluded?: string[];
};
fields?: {};
fields?: Fields;
}
21 changes: 21 additions & 0 deletions src/agile/models/issueType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** Details about an issue type. */
export interface IssueType {
/** The URL of the issue type. */
self: string;
/** The unique identifier of the issue type. */
id: string;
/** The description of the issue type. */
description: string;
/** The URL of the icon for the issue type. */
iconUrl: string;
/** The name of the issue type. */
name: string;
/** Whether the issue type is a subtask type. */
subtask: boolean;
/** The ID of the avatar for the issue type. */
avatarId: number;
/** The ID of the entity for the issue type. */
entityId: string;
/** The hierarchy level of the issue type. */
hierarchyLevel: number;
}
7 changes: 7 additions & 0 deletions src/agile/models/progress.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** Represents the progress of a task. */
export interface Progress {
/** The current progress value. */
progress: number;
/** The total progress value. */
total: number;
}
23 changes: 23 additions & 0 deletions src/agile/models/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AvatarUrls } from './avatarUrls';

/** Details about a project. */
export interface Project {
/** The URL of the project details. */
self: string;
/** The ID of the project. */
id: string;
/** The key of the project. */
key: string;
/** The name of the project. */
name: string;
/**
* The [project
* type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the
* project.
*/
projectTypeKey: string;
/** Whether the project is simplified. */
simplified: boolean;
/** The avatar URLs of the project. */
avatarUrls: AvatarUrls;
}
10 changes: 10 additions & 0 deletions src/agile/models/status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { StatusCategory } from './statusCategory';

export interface Status {
self: string;
description: string;
iconUrl: string;
name: string;
id: string;
statusCategory: StatusCategory;
}
7 changes: 7 additions & 0 deletions src/agile/models/statusCategory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface StatusCategory {
self: string;
id: number;
key: string;
colorName: string;
name: string;
}
24 changes: 12 additions & 12 deletions src/agile/models/userJson.ts → src/agile/models/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @deprecated Use {@link UserJson} instead. */
export type UserJsonBean = UserJson;
/** @deprecated Use {@link User} instead. */
export type UserJsonBean = User;

/**
* User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:*
Expand All @@ -12,16 +12,16 @@ export type UserJsonBean = UserJson;
* - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have
* fallback values.
*/
export interface UserJson {
export interface User {
/** The URL of the user. */
self?: string;
self: string;
/**
* @deprecated This property is no longer available and will be removed from the documentation soon. See the
* [deprecation
* notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
* for details.
*/
name?: string;
name: string;
/**
* @deprecated This property is no longer available and will be removed from the documentation soon. See the
* [deprecation
Expand All @@ -33,11 +33,11 @@ export interface UserJson {
* The account ID of the user, which uniquely identifies the user across all Atlassian products. For example,
* _5b10ac8d82e05b22cc7d4ef5_.
*/
accountId?: string;
accountId: string;
/** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */
emailAddress?: string;
emailAddress: string | null;
/** Details about the avatars for an item. */
avatarUrls?: {
avatarUrls: {
/** The URL of the item's 16x16 pixel avatar. */
'16x16'?: string;
/** The URL of the item's 24x24 pixel avatar. */
Expand All @@ -48,17 +48,17 @@ export interface UserJson {
'48x48'?: string;
};
/** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */
displayName?: string;
displayName: string;
/** Whether the user is active. */
active?: boolean;
active: boolean;
/**
* The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as
* null.
*/
timeZone?: string;
timeZone: string | null;
/**
* The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application
* user) or 'customer' (Jira Service Desk customer user)
*/
accountType?: string;
accountType: string;
}
2 changes: 1 addition & 1 deletion src/version2/announcementBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export class AnnouncementBanner {
url: '/rest/api/2/announcementBanner',
method: 'PUT',
data: {
message: parameters.message,
isDismissible: parameters.isDismissible,
isEnabled: parameters.isEnabled,
message: parameters.message,
visibility: parameters.visibility,
},
};
Expand Down
10 changes: 5 additions & 5 deletions src/version2/appMigration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class AppMigration {
url: '/rest/atlassian-connect/1/migration/field',
method: 'PUT',
headers: {
'Atlassian-Transfer-Id': parameters.transferId,
'Atlassian-Account-Id': parameters.accountId,
'Atlassian-Transfer-Id': parameters.transferId,
},
data: {
updateValueList: parameters.updateValueList,
Expand Down Expand Up @@ -66,9 +66,9 @@ export class AppMigration {
url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`,
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Atlassian-Transfer-Id': parameters.transferId,
'Atlassian-Account-Id': parameters.accountId,
'Atlassian-Transfer-Id': parameters.transferId,
'Content-Type': 'application/json',
},
data: parameters.body ?? parameters.entities,
};
Expand Down Expand Up @@ -103,9 +103,9 @@ export class AppMigration {
'Atlassian-Transfer-Id': parameters.transferId,
},
data: {
workflowEntityId: parameters.workflowEntityId,
ruleIds: parameters.ruleIds,
expand: parameters.expand,
ruleIds: parameters.ruleIds,
workflowEntityId: parameters.workflowEntityId,
},
};

Expand Down
1 change: 1 addition & 0 deletions src/version2/appProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export class AppProperties {
const config: RequestConfig = {
url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`,
method: 'PUT',
data: parameters.property,
};

return this.client.sendRequest(config, callback);
Expand Down

0 comments on commit 7d15f55

Please sign in to comment.