Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: v4.1.0 #346

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ parserOptions:
project: ./tsconfig.lint.json
plugins:
- import
- "@typescript-eslint"
env:
node: true
browser: true
rules:
"@typescript-eslint/lines-between-class-members": off
"@typescript-eslint/no-unnecessary-condition": [ error, { allowConstantLoopConditions: false } ]
arrow-parens:
- error
- as-needed
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Jira.js changelog

### 4.1.0

// todo add links to code

- **General Improvements:** Enhanced JSDoc documentation across the project for better clarity and developer experience.
- **Fix:** Updated the following methods in `Version2Client` and `Version3Client` to make the `parameters` argument mandatory (as it should have been initially):
- `IssueFieldConfigurations.createFieldConfiguration`
- `IssueFieldConfigurations.createFieldConfigurationScheme`
- `IssueLinks.linkIssues`
- `IssueTypeSchemes.createIssueTypeScheme`
- `IssueTypeSchemes.assignIssueTypeSchemeToProject`
- `IssueTypeScreenSchemes.createIssueTypeScreenScheme`
- `JQL.parseJqlQueries`
- `TimeTracking.setSharedTimeTrackingConfiguration`
- `WorkflowSchemeProjectAssociations.assignSchemeToProject`
- **Improvement:** Changed the return type of `ProjectKeyAndNameValidation.getValidProjectKey` and `ProjectKeyAndNameValidation.getValidProjectName` from `unknown` to `string` for improved type safety and usability.
- **New APIs:** Added the following classes to support additional Jira APIs:
- **`AppDataPolicies`**: Manage app access rule data policies, allowing developers to set and retrieve rules controlling app access ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-data-policies/#api-group-app-data-policies)).
- **`ClassificationLevels`**: Define and manage classification levels for sensitive information in Jira ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/#api-group-classification-levels)).
- **`IssueBulkOperations`**: Perform bulk operations on issues, such as moving multiple issues between projects or updating multiple fields in one request. For additional guidance, refer to [Bulk operation APIs: additional examples and FAQ](https://developer.atlassian.com/cloud/jira/platform/bulk-operation-additional-examples-and-faqs/) ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-bulk-operations/#api-group-issue-bulk-operations)).
- **`Plans`**: Manage advanced roadmaps plans, including creating, duplicating, updating, archiving, and trashing plans ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-plans/#api-group-plans)).
- **`PrioritySchemes`**: Create, retrieve, update, and delete issue priority schemes to standardize prioritization across projects ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-priority-schemes/#api-group-priority-schemes)).
- **`ProjectClassificationLevels`**: View and manage classification levels within individual projects to ensure compliance with organizational standards ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-classification-levels/#api-group-project-classification-levels)).
- **`ServiceRegistry`**: Access and manage attributes related to Jira Service Management’s service registry, which helps organize and maintain services ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/#api-group-service-registry)).
- **`TeamsInPlan`**: Configure settings for Atlassian and custom teams within advanced roadmaps plans, including creating, updating, and deleting team configurations ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-teams-in-plan/#api-group-teams-in-plan)).

### 4.0.6

- **#347:** Fixed an issue with adding attachments of type `Readable` or `ReadableStream` (e.g., `fs.createReadStream`). Thanks to [Lunatic174](https://github.com/Lunatic174) for [reporting the issue](https://github.com/MrRefactoring/jira.js/issues/347).
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ Available groups:
<summary>Version 2 Cloud REST API group</summary>

- [announcementBanner](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-announcement-banner/#api-group-announcement-banner)
- [appDataPolicies](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-data-policies/#api-group-app-data-policies)
- [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-application-roles/#api-group-application-roles)
- [appMigration](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-migration/#api-group-app-migration)
- [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-audit-records/#api-group-audit-records)
- [avatars](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-avatars/#api-group-avatars)
- [classificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-classification-levels/#api-group-classification-levels)
- [dashboards](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-dashboards/#api-group-dashboards)
- [filters](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filters/#api-group-filters)
- [filterSharing](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filter-sharing/#api-group-filter-sharing)
Expand Down Expand Up @@ -333,10 +335,12 @@ Available groups:
<summary>Version 3 Cloud REST API group</summary>

- [announcementBanner](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-announcement-banner/#api-group-announcement-banner)
- [appDataPolicy](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-data-policies/#api-group-app-data-policies)
- [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-application-roles/#api-group-application-roles)
- [appMigration](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-migration/#api-group-app-migration)
- [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-audit-records/#api-group-audit-records)
- [avatars](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-group-avatars)
- [classificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/#api-group-classification-levels)
- [dashboards](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-group-dashboards)
- [filters](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-group-filters)
- [filterSharing](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filter-sharing/#api-group-filter-sharing)
Expand All @@ -345,6 +349,7 @@ Available groups:
- [instanceInformation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-instance-information/#api-group-instance-information)
- [issues](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-group-issues)
- [issueAttachments](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-group-issue-attachments)
- [issueBulkOperations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-bulk-operations/#api-group-issue-bulk-operations)
- [issueComments](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-group-issue-comments)
- [issueCustomFieldConfigurationApps](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-configuration--apps-/#api-group-issue-custom-field-configuration--apps-)
- [issueCommentProperties](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comment-properties/#api-group-issue-comment-properties)
Expand Down Expand Up @@ -382,9 +387,12 @@ Available groups:
- [myself](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-group-myself)
- [permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/#api-group-permissions)
- [permissionSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#api-group-permission-schemes)
- [plans](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-plans/#api-group-plans)
- [prioritySchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-priority-schemes/#api-group-priority-schemes)
- [projects](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-group-projects)
- [projectAvatars](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-group-project-avatars)
- [projectCategories](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-categories/#api-group-project-categories)
- [projectClassificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-classification-levels/#api-group-project-classification-levels)
- [projectComponents](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-components/#api-group-project-components)
- [projectEmail](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-email/#api-group-project-email)
- [projectFeatures](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-features/#api-group-project-features)
Expand All @@ -400,8 +408,10 @@ Available groups:
- [screenTabFields](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-group-screen-tab-fields)
- [screenSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-group-screen-schemes)
- [serverInfo](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-server-info/#api-group-server-info)
- [serviceRegistry](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/#api-group-service-registry)
- [status](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-status/#api-group-status)
- [tasks](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-group-tasks)
- [teamsInPlan](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-teams-in-plan/#api-group-teams-in-plan)
- [timeTracking](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-time-tracking/#api-group-time-tracking)
- [uiModificationsApps](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-ui-modifications--apps-/#api-group-ui-modifications--apps-)
- [users](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-group-users)
Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
node_modules/
src/credentials.ts

.DS_Store
7 changes: 4 additions & 3 deletions examples/src/credentials.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const host = 'https://jira-js.atlassian.net/';
export const email = '[email protected]';
export const apiToken = 'ATATT3xFfGF0CQo3Ed8gqWxZmT2nlOEinQZJkp7hVY-ynttVtAsRwGF5JYD1vBcSu0i3RNfilR_RbksRFBxU33tsWTi7R5ontSouy0mwNqPhTazoZiVm5ah3_Emcy9g7-KB0rW7XTm5uLHeCdUW9X-Fv1jqWUHjtrOgCr4pXtcV6DmJPyBLa3Jg=582DE538';
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
export const host = '';
export const email = '';
export const apiToken = '';

if (!host) {
throw new Error('Please specify host');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira.js",
"version": "4.0.6",
"version": "4.1.0",
"description": "A comprehensive JavaScript/TypeScript library designed for both Node.JS and browsers, facilitating seamless interaction with the Atlassian Jira API.",
"main": "out/index.js",
"types": "out/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/clients/baseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ export class BaseClient implements Client {
code: e.code,
message: e.message,
data: e.response.data,
status: e.response?.status,
statusText: e.response?.statusText,
status: e.response.status,
statusText: e.response.statusText,
},
e.response.status,
{ cause: e },
Expand Down
1 change: 1 addition & 0 deletions src/clients/httpException.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class HttpException extends Error {
return (response as Record<string, any>).message;
}

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (this.constructor) {
return this.constructor.name.match(/[A-Z][a-z]+|[0-9]+/g)?.join(' ') ?? 'Error';
}
Expand Down
2 changes: 1 addition & 1 deletion src/version2/announcementBanner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class AnnouncementBanner {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/appMigration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class AppMigration {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/appProperties.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class AppProperties {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/applicationRoles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class ApplicationRoles {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/auditRecords.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class AuditRecords {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/avatars.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class Avatars {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/dashboards.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { paramSerializer } from '../paramSerializer';
import { RequestConfig } from '../requestConfig';

Expand Down
2 changes: 1 addition & 1 deletion src/version2/dynamicModules.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class DynamicModules {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/filterSharing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class FilterSharing {
Expand Down
6 changes: 3 additions & 3 deletions src/version2/filters.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class Filters {
Expand Down Expand Up @@ -31,8 +31,8 @@ export class Filters {
url: '/rest/api/2/filter',
method: 'POST',
params: {
expand: parameters?.expand,
overrideSharePermissions: parameters?.overrideSharePermissions,
expand: parameters.expand,
overrideSharePermissions: parameters.overrideSharePermissions,
},
data: {
description: parameters.description,
Expand Down
2 changes: 1 addition & 1 deletion src/version2/groupAndUserPicker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class GroupAndUserPicker {
Expand Down
10 changes: 5 additions & 5 deletions src/version2/groups.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class Groups {
Expand Down Expand Up @@ -50,10 +50,10 @@ export class Groups {
url: '/rest/api/2/group',
method: 'DELETE',
params: {
groupname: parameters?.groupname,
groupId: parameters?.groupId,
swapGroup: parameters?.swapGroup,
swapGroupId: parameters?.swapGroupId,
groupname: parameters.groupname,
groupId: parameters.groupId,
swapGroup: parameters.swapGroup,
swapGroupId: parameters.swapGroupId,
},
};

Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueAttachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { FormData, File } from 'formdata-node';
import type { Mime } from 'mime' with { 'resolution-mode': 'import' };
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueAttachments {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueCommentProperties.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueCommentProperties {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueComments.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueComments {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueCustomFieldConfigurationApps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueCustomFieldConfigurationApps {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueCustomFieldContexts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueCustomFieldContexts {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueCustomFieldOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueCustomFieldOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueCustomFieldOptionsApps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueCustomFieldOptionsApps {
Expand Down
2 changes: 1 addition & 1 deletion src/version2/issueCustomFieldValuesApps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';

export class IssueCustomFieldValuesApps {
Expand Down
Loading
Loading