Skip to content

Commit

Permalink
v2.15.13
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRefactoring committed Oct 25, 2022
1 parent 17e1f44 commit c9da957
Show file tree
Hide file tree
Showing 35 changed files with 764 additions and 118 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Jira.js changelog

### 2.15.13

- Version 2, 3:
- `getResolutions` in `IssueResolution` was deprecated.
- `getResolution` in `IssueResolution` was deprecated.
- `createResolution` method added to `IssueResolution`.
- `setDefaultResolution` method added to `IssueResolution`.
- `moveResolutions` method added to `IssueResolution`.
- `searchResolutions` method added to `IssueResolution`.
- `updateResolution` method added to `IssueResolution`.
- `deleteResolution` method added to `IssueResolution`.

### 2.15.12

- Version 2, 3:
Expand Down Expand Up @@ -58,7 +70,7 @@ Version 3: maxContentLength was increased for attachments upload. Thanks to [Rea

### 2.15.2

- `isAxiosError` detecting mechanism improved. Thanks [Stephane Moser](https://github.com/Moser-ss) for the report.
- `isAxiosError` detecting mechanism improved. Thanks to [Stephane Moser](https://github.com/Moser-ss) for the report.

### 2.15.1

Expand Down
182 changes: 91 additions & 91 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira.js",
"version": "2.15.12",
"version": "2.15.13",
"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 @@ -53,11 +53,11 @@
"devDependencies": {
"@swc-node/register": "^1.5.4",
"@types/express": "^4.17.14",
"@types/node": "^18.11.4",
"@types/node": "^18.11.5",
"@types/oauth": "^0.9.1",
"@types/sinon": "^10.0.13",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"ava": "^5.0.1",
"dotenv": "^16.0.3",
"eslint": "^8.26.0",
Expand Down
235 changes: 225 additions & 10 deletions src/version2/issueResolutions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ export class IssueResolutions {
constructor(private client: Client) {}

/**
* Returns a list of all issue resolution values.
* @deprecated Returns a list of all issue resolution values.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
*/
async getResolutions<T = Models.Resolution[]>(callback: Callback<T>): Promise<void>;
/**
* Returns a list of all issue resolution values.
* @deprecated Returns a list of all issue resolution values.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
*/
async getResolutions<T = Models.Resolution[]>(callback?: never): Promise<T>;
async getResolutions<T = Models.Resolution[]>(callback?: Callback<T>): Promise<void | T> {
Expand All @@ -31,21 +31,162 @@ export class IssueResolutions {
}

/**
* Returns an issue resolution value.
* Creates an issue resolution.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async createResolution<T = Models.ResolutionId>(
parameters: Parameters.CreateResolution,
callback: Callback<T>
): Promise<void>;
/**
* Creates an issue resolution.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async createResolution<T = Models.ResolutionId>(
parameters: Parameters.CreateResolution,
callback?: never
): Promise<T>;
async createResolution<T = Models.ResolutionId>(
parameters: Parameters.CreateResolution,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/api/2/resolution',
method: 'POST',
data: parameters,
};

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

/**
* Sets default issue resolution.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async setDefaultResolution<T = void>(
parameters: Parameters.SetDefaultResolution,
callback: Callback<T>
): Promise<void>;
/**
* Sets default issue resolution.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async setDefaultResolution<T = void>(parameters: Parameters.SetDefaultResolution, callback?: never): Promise<T>;
async setDefaultResolution<T = void>(
parameters: Parameters.SetDefaultResolution,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/api/2/resolution/default',
method: 'PUT',
data: {
id: parameters.id,
},
};

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

/**
* Changes the order of issue resolutions.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async moveResolutions<T = void>(parameters: Parameters.MoveResolutions, callback: Callback<T>): Promise<void>;
/**
* Changes the order of issue resolutions.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async moveResolutions<T = void>(parameters: Parameters.MoveResolutions, callback?: never): Promise<T>;
async moveResolutions<T = void>(parameters: Parameters.MoveResolutions, callback?: Callback<T>): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/api/2/resolution/move',
method: 'PUT',
data: {
ids: parameters.ids,
after: parameters.after,
position: parameters.position,
},
};

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

/**
* Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of
* resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria:
*
* - A list of resolutions IDs.
* - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects
* only, as there is no concept of default resolutions in team-managed projects.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
*/
async getResolution<T = Models.Resolution>(
parameters: Parameters.GetResolution,
async searchResolutions<T = Models.PageResolution>(
parameters: Parameters.SearchResolutions | undefined,
callback: Callback<T>
): Promise<void>;
/**
* Returns an issue resolution value.
* Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of
* resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria:
*
* - A list of resolutions IDs.
* - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects
* only, as there is no concept of default resolutions in team-managed projects.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
*/
async searchResolutions<T = Models.PageResolution>(
parameters?: Parameters.SearchResolutions,
callback?: never
): Promise<T>;
async searchResolutions<T = Models.PageResolution>(
parameters?: Parameters.SearchResolutions,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/api/2/resolution/search',
method: 'GET',
params: {
startAt: parameters?.startAt,
maxResults: parameters?.maxResults,
id: parameters?.id,
onlyDefault: parameters?.onlyDefault,
},
};

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

/**
* @deprecated Returns an issue resolution value.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
*/
async getResolution<T = Models.Resolution>(
parameters: Parameters.GetResolution,
callback: Callback<T>
): Promise<void>;
/**
* @deprecated Returns an issue resolution value.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* Permission to access Jira.
*/
async getResolution<T = Models.Resolution>(parameters: Parameters.GetResolution, callback?: never): Promise<T>;
async getResolution<T = Models.Resolution>(
parameters: Parameters.GetResolution,
Expand All @@ -58,4 +199,78 @@ export class IssueResolutions {

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

/**
* Updates an issue resolution.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async updateResolution<T = void>(parameters: Parameters.UpdateResolution, callback: Callback<T>): Promise<void>;
/**
* Updates an issue resolution.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async updateResolution<T = void>(parameters: Parameters.UpdateResolution, callback?: never): Promise<T>;
async updateResolution<T = void>(parameters: Parameters.UpdateResolution, callback?: Callback<T>): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/api/2/resolution/${parameters.id}`,
method: 'PUT',
data: {
...parameters,
name: parameters.name,
description: parameters.description,
id: undefined,
},
};

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

/**
* Deletes an issue resolution.
*
* This operation is
* [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the
* `location` link in the response to determine the status of the task and use [Get
* task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async deleteResolution<T = Models.TaskProgressObject>(
parameters: Parameters.DeleteResolution,
callback: Callback<T>
): Promise<void>;
/**
* Deletes an issue resolution.
*
* This operation is
* [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the
* `location` link in the response to determine the status of the task and use [Get
* task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async deleteResolution<T = Models.TaskProgressObject>(
parameters: Parameters.DeleteResolution,
callback?: never
): Promise<T>;
async deleteResolution<T = Models.TaskProgressObject>(
parameters: Parameters.DeleteResolution,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/api/2/resolution/${parameters.id}`,
method: 'DELETE',
params: {
replaceWith: parameters.replaceWith,
},
};

return this.client.sendRequest(config, callback);
}
}
7 changes: 7 additions & 0 deletions src/version2/models/createResolutionDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** Details of an issue resolution. */
export interface CreateResolutionDetails {
/** The name of the resolution. Must be unique (case-insensitive). */
name: string;
/** The description of the resolution. */
description?: string;
}
6 changes: 6 additions & 0 deletions src/version2/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export * from './createdIssues';
export * from './createIssueAdjustmentDetails';
export * from './createPriorityDetails';
export * from './createProjectDetails';
export * from './createResolutionDetails';
export * from './createUiModificationDetails';
export * from './createUpdateRoleRequest';
export * from './createWorkflowCondition';
Expand Down Expand Up @@ -315,6 +316,7 @@ export * from './pageOfWorklogs';
export * from './pagePriority';
export * from './pageProject';
export * from './pageProjectDetails';
export * from './pageResolution';
export * from './pageScreen';
export * from './pageScreenScheme';
export * from './pageScreenWithTab';
Expand Down Expand Up @@ -383,7 +385,9 @@ export * from './removeOptionFromIssuesResult';
export * from './renamedCascadingOption';
export * from './renamedOption';
export * from './reorderIssuePriorities';
export * from './reorderIssueResolutionsRequest';
export * from './resolution';
export * from './resolutionId';
export * from './restrictedPermission';
export * from './richText';
export * from './roleActor';
Expand All @@ -409,6 +413,7 @@ export * from './securityScheme';
export * from './securitySchemes';
export * from './serverInformation';
export * from './setDefaultPriorityRequest';
export * from './setDefaultResolutionRequest';
export * from './sharePermission';
export * from './sharePermissionInput';
export * from './simpleApplicationProperty';
Expand Down Expand Up @@ -449,6 +454,7 @@ export * from './updateFieldConfigurationSchemeDetails';
export * from './updateIssueAdjustmentDetails';
export * from './updatePriorityDetails';
export * from './updateProjectDetails';
export * from './updateResolutionDetails';
export * from './updateScreenDetails';
export * from './updateScreenSchemeDetails';
export * from './updateScreenTypes';
Expand Down
19 changes: 19 additions & 0 deletions src/version2/models/pageResolution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Resolution } from './resolution';

/** A page of items. */
export interface PageResolution {
/** The URL of the page. */
self?: string;
/** If there is another page of results, the URL of the next page. */
nextPage?: string;
/** The maximum number of items that could be returned. */
maxResults?: number;
/** The index of the first item returned. */
startAt?: number;
/** The number of items returned. */
total?: number;
/** Whether this is the last page. */
isLast?: boolean;
/** The list of items. */
values?: Resolution[];
}
9 changes: 9 additions & 0 deletions src/version2/models/reorderIssueResolutionsRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** Change the order of issue resolutions. */
export interface ReorderIssueResolutionsRequest {
/** The list of resolution IDs to be reordered. Cannot contain duplicates nor after ID. */
ids: string[];
/** The ID of the resolution. Required if `position` isn't provided. */
after?: string;
/** The position for issue resolutions to be moved to. Required if `after` isn't provided. */
position?: string;
}
Loading

0 comments on commit c9da957

Please sign in to comment.