Skip to content

Commit

Permalink
feat: add extra endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeolun committed Feb 5, 2024
1 parent 7dd041d commit bac4fbb
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 74 deletions.
6 changes: 5 additions & 1 deletion lib/jira.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="node" />
import { AxiosInstance, AxiosRequestConfig } from "axios";
import { AxiosInstance, AxiosRequestConfig } from 'axios';
interface MakeUrlParams {
pathname?: string;
query?: Record<string, any>;
Expand Down Expand Up @@ -1140,6 +1140,10 @@ export default class JiraApi {
* [Jira Doc](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-createmeta-get)
*/
getIssueCreateMetadata(optional?: {}): Promise<any>;
getIssueCreateMetaProjectIssueTypes(projectIdOrKey: string | number, startAt: number, maxResults: number): Promise<any>;
getIssueCreateMetaFields(projectIdOrKey: string | number, issueTypeId: string, startAt: number, maxResults: number): Promise<any>;
getWorkflows(query?: {}): Promise<any>;
getWorkflowScheme(projectKeyOrId: string, query?: {}): Promise<any>;
/** Generic Get Request
* [Jira Doc](https://docs.atlassian.com/jira-software/REST/cloud/2/)
* @name genericGet
Expand Down
36 changes: 36 additions & 0 deletions lib/jira.js
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,42 @@ var JiraApi = /** @class */ (function () {
query: optional
})));
};
JiraApi.prototype.getIssueCreateMetaProjectIssueTypes = function (projectIdOrKey, startAt, maxResults) {
return this.doRequest(this.makeRequestHeader(this.makeUri({
pathname: '/issue/createmeta/' + projectIdOrKey + '/issuetypes',
query: {
startAt: startAt,
maxResults: maxResults
}
})));
};
JiraApi.prototype.getIssueCreateMetaFields = function (projectIdOrKey, issueTypeId, startAt, maxResults) {
return this.doRequest(this.makeRequestHeader(this.makeUri({
pathname: '/issue/createmeta/' + projectIdOrKey + '/issuetypes/' + issueTypeId,
query: {
startAt: startAt,
maxResults: maxResults
}
})));
};
JiraApi.prototype.getWorkflows = function (query) {
if (query === void 0) { query = {}; }
return this.doRequest(this.makeRequestHeader(this.makeUri({
pathname: '/workflow',
query: query
}), {
method: 'GET'
}));
};
JiraApi.prototype.getWorkflowScheme = function (projectKeyOrId, query) {
if (query === void 0) { query = {}; }
return this.doRequest(this.makeRequestHeader(this.makeUri({
pathname: "/project/" + projectKeyOrId + "/workflowscheme",
query: query
}), {
method: 'GET'
}));
};
/** Generic Get Request
* [Jira Doc](https://docs.atlassian.com/jira-software/REST/cloud/2/)
* @name genericGet
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"scripts": {
"build": "rm -rf lib && tsc",
"watch": "rm -rf lib && tsc -w",
"docs-build": "rm -rf docs && esdoc -c esdoc.json",
"lint": "eslint ./",
"test": "npm run lint && mocha --require @babel/register && npm run docs-build",
Expand Down
Loading

0 comments on commit bac4fbb

Please sign in to comment.