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

Add missing endpoints #25

Merged
merged 4 commits into from
Jan 8, 2021
Merged
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
36 changes: 36 additions & 0 deletions dist/backlog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ declare module 'backlog-js' {
patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise<any>;
deleteGroup(groupId: number): Promise<any>;
getStatuses(): Promise<any>;
getProjectStatuses(projectIdOrKey: string): Promise<any>;
getResolutions(): Promise<any>;
getPriorities(): Promise<any>;
getProjects(params?: Option.Project.GetProjectsParams): Promise<any>;
Expand All @@ -78,6 +79,10 @@ declare module 'backlog-js' {
postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise<any>;
getProjectAdministrators(projectIdOrKey: string): Promise<any>;
deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise<any>;
postProjectStatus(projectIdOrKey: string, params: Option.Project.PostStatusParams): Promise<any>;
patchProjectStatus(projectIdOrKey: string, id: number, params: Option.Project.PatchStatusParams): Promise<any>;
deleteProjectStatus(projectIdOrKey: string, id: number, substituteStatusId: number): Promise<any>;
patchProjectStatusOrder(projectIdOrKey: string, statusId: number[]): Promise<any>;
getIssueTypes(projectIdOrKey: string): Promise<any>;
postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise<any>;
patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise<any>;
Expand Down Expand Up @@ -115,12 +120,14 @@ declare module 'backlog-js' {
postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise<any>;
getIssueCommentsCount(issueIdOrKey: string): Promise<any>;
getIssueComment(issueIdOrKey: string, commentId: number): Promise<any>;
deleteIssueComment(issueIdOrKey: string, commentId: number): Promise<any>;
patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise<any>;
getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise<any>;
postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise<any>;
getIssueAttachments(issueIdOrKey: string): Promise<any>;
getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise<Entity.File.FileData>;
deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise<any>;
getIssueParticipants(issueIdOrKey: string): Promise<any>;
getIssueSharedFiles(issueIdOrKey: string): Promise<any>;
linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise<any>;
unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise<any>;
Expand Down Expand Up @@ -171,6 +178,15 @@ declare module 'backlog-js' {
deleteProjectGroup(projectIdOrKey: string|number);
getGroupIcon(groupId: string): Promise<any>;
getLicence(): Promise<any>;
getTeams(params?: Option.Team.GetTeamsParams): Promise<any>;
postTeam(members: number[]): Promise<any>;
getTeam(teamId: number): Promise<any>;
patchTeam(teamId: number, params: Option.Team.PatchTeamParams): Promise<any>;
deleteTeam(teamId: number): Promise<any>;
getTeamIcon(teamId: number): Promise<Entity.File.FileData>;
getProjectTeams(projectIdOrKey: string): Promise<any>;
postProjectTeam(projectIdOrKey: string, teamId: number): Promise<any>;
deleteProjectTeam(projectIdOrKey: string, teamId: number): Promise<any>;
private download;
private upload;
private parseFileData;
Expand Down Expand Up @@ -332,6 +348,17 @@ declare module 'backlog-js' {
members?: string[];
}
}
export namespace Team {
export interface GetTeamsParams {
order?: Order;
offset?: number;
count?: number;
}
export interface PatchTeamParams {
name?: string;
members?: number[];
}
}
export namespace Project {
export type TextFormattingRule = "backlog" | "markdown";
export interface PostProjectParams {
Expand Down Expand Up @@ -486,6 +513,15 @@ declare module 'backlog-js' {
pullRequestId?: number;
pullRequestCommentId?: number;
}
export type ProjectStatusColor = "#ea2c00" | "#e87758" | "#e07b9a" | "#868cb7" | "#3b9dbd" | "#4caf93" | "#b0be3c" | "#eda62a" | "#f42858" | "#393939";
export interface PostStatusParams {
name: string;
color: ProjectStatusColor;
}
export interface PatchStatusParams {
name?: string;
color?: ProjectStatusColor;
}
}
export namespace Issue {
export interface PostIssueParams {
Expand Down
58 changes: 58 additions & 0 deletions dist/backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,32 @@ var Backlog = (function (_super) {
return this.get('users/myself/recentlyViewedWikis', params);
};
Backlog.prototype.getGroups = function (params) {
console.warn("Deprecated: Use getTeams instead.");
return this.get('groups', params);
};
Backlog.prototype.postGroups = function (params) {
console.warn("Deprecated: Use postTeam instead.");
return this.post('groups', params);
};
Backlog.prototype.getGroup = function (groupId) {
console.warn("Deprecated: Use getTeam instead.");
return this.get("groups/" + groupId);
};
Backlog.prototype.patchGroup = function (groupId, params) {
console.warn("Deprecated: Use patchTeam instead.");
return this.patch("groups/" + groupId, params);
};
Backlog.prototype.deleteGroup = function (groupId) {
console.warn("Deprecated: Use deleteTeam instead.");
return this.delete("groups/" + groupId);
};
Backlog.prototype.getStatuses = function () {
console.warn("Deprecated: Use getProjectStatuses instead.");
return this.get('statuses');
};
Backlog.prototype.getProjectStatuses = function (projectIdOrKey) {
return this.get("projects/" + projectIdOrKey + "/statuses");
};
Backlog.prototype.getResolutions = function () {
return this.get('resolutions');
};
Expand Down Expand Up @@ -143,6 +152,18 @@ var Backlog = (function (_super) {
Backlog.prototype.deleteProjectAdministrators = function (projectIdOrKey, params) {
return this.delete("projects/" + projectIdOrKey + "/administrators", params);
};
Backlog.prototype.postProjectStatus = function (projectIdOrKey, params) {
return this.post("projects/" + projectIdOrKey + "/statuses", params);
};
Backlog.prototype.patchProjectStatus = function (projectIdOrKey, id, params) {
return this.patch("projects/" + projectIdOrKey + "/statuses/" + id, params);
};
Backlog.prototype.deleteProjectStatus = function (projectIdOrKey, id, substituteStatusId) {
return this.delete("projects/" + projectIdOrKey + "/statuses/" + id, { substituteStatusId: substituteStatusId });
};
Backlog.prototype.patchProjectStatusOrder = function (projectIdOrKey, statusId) {
return this.patch("projects/" + projectIdOrKey + "/statuses/updateDisplayOrder", { statusId: statusId });
};
Backlog.prototype.getIssueTypes = function (projectIdOrKey) {
return this.get("projects/" + projectIdOrKey + "/issueTypes");
};
Expand Down Expand Up @@ -254,6 +275,9 @@ var Backlog = (function (_super) {
Backlog.prototype.getIssueComment = function (issueIdOrKey, commentId) {
return this.get("issues/" + issueIdOrKey + "/comments/" + commentId);
};
Backlog.prototype.deleteIssueComment = function (issueIdOrKey, commentId) {
return this.delete("issues/" + issueIdOrKey + "/comments/" + commentId);
};
Backlog.prototype.patchIssueComment = function (issueIdOrKey, commentId, params) {
return this.patch("issues/" + issueIdOrKey + "/comments/" + commentId, params);
};
Expand All @@ -272,6 +296,9 @@ var Backlog = (function (_super) {
Backlog.prototype.deleteIssueAttachment = function (issueIdOrKey, attachmentId) {
return this.delete("issues/" + issueIdOrKey + "/attachments/" + attachmentId);
};
Backlog.prototype.getIssueParticipants = function (issueIdOrKey) {
return this.get("issues/" + issueIdOrKey + "/participants");
};
Backlog.prototype.getIssueSharedFiles = function (issueIdOrKey) {
return this.get("issues/" + issueIdOrKey + "/sharedFiles");
};
Expand Down Expand Up @@ -408,20 +435,51 @@ var Backlog = (function (_super) {
return this.post("watchings/" + watchId + "/markAsRead");
};
Backlog.prototype.getProjectGroupList = function (projectIdOrKey) {
console.warn("Deprecated: Use getProjectTeams instead.");
return this.get("projects/" + projectIdOrKey + "/groups");
};
Backlog.prototype.postProjectGroup = function (projectIdOrKey, params) {
console.warn("Deprecated: Use postProjectTeam instead.");
return this.post("projects/" + projectIdOrKey + "/groups", params);
};
Backlog.prototype.deleteProjectGroup = function (projectIdOrKey) {
console.warn("Deprecated: Use deleteProjectTeam instead.");
return this.delete("projects/" + projectIdOrKey + "/groups");
};
Backlog.prototype.getGroupIcon = function (groupId) {
console.warn("Deprecated: Use getTeamIcon instead.");
return this.download("groups/" + groupId + "/icon");
};
Backlog.prototype.getLicence = function () {
return this.get("space/licence");
};
Backlog.prototype.getTeams = function (params) {
return this.get("teams", params);
};
Backlog.prototype.postTeam = function (members) {
return this.post("teams", { members: members });
};
Backlog.prototype.getTeam = function (teamId) {
return this.get("teams/" + teamId);
};
Backlog.prototype.patchTeam = function (teamId, params) {
return this.patch("teams/" + teamId, params);
};
Backlog.prototype.deleteTeam = function (teamId) {
return this.delete("teams/" + teamId);
};
Backlog.prototype.getTeamIcon = function (teamId) {
return this.download("teams/" + teamId + "/icon");
};
Backlog.prototype.getProjectTeams = function (projectIdOrKey) {
return this.get("projects/" + projectIdOrKey + "/teams");
};
Backlog.prototype.postProjectTeam = function (projectIdOrKey, teamId) {
return this.post("projects/" + projectIdOrKey + "/teams", { teamId: teamId });
};
Backlog.prototype.deleteProjectTeam = function (projectIdOrKey, teamId) {
return this.delete("projects/" + projectIdOrKey + "/teams", { teamId: teamId });
};
Backlog.prototype.download = function (path) {
return this.request({ method: 'GET', path: path }).then(this.parseFileData);
};
Expand Down
2 changes: 1 addition & 1 deletion dist/backlog.min.js

Large diffs are not rendered by default.

Loading