diff --git a/dist/types/backlog.d.ts b/dist/types/backlog.d.ts index 112ab30..8eb7d7c 100644 --- a/dist/types/backlog.d.ts +++ b/dist/types/backlog.d.ts @@ -550,7 +550,7 @@ export default class Backlog extends Request { /** * https://developer.nulab.com/docs/backlog/api/2/add-watching */ - postWatchingListItem(params: any): Promise; + postWatchingListItem(params: Option.WatchingList.PostWatchingListItemParams): Promise; /** * https://developer.nulab.com/docs/backlog/api/2/update-watching */ @@ -572,7 +572,7 @@ export default class Backlog extends Request { * https://developer.nulab.com/docs/backlog/api/2/add-project-group * @deprecated */ - postProjectGroup(projectIdOrKey: string | number, params: any): Promise; + postProjectGroup(projectIdOrKey: string | number, params: Option.Group.PostProjectGroupParams): Promise; /** * https://developer.nulab.com/docs/backlog/api/2/delete-project-group * @deprecated diff --git a/dist/types/option.d.ts b/dist/types/option.d.ts index 65d5fb2..9b8974c 100644 --- a/dist/types/option.d.ts +++ b/dist/types/option.d.ts @@ -61,20 +61,41 @@ export declare namespace User { count?: number; } } +export declare namespace WatchingList { + interface PostWatchingListItemParams { + issueIdOrKey: string | number; + note: string; + } +} export declare namespace Group { + /** + * @deprecated + */ interface GetGroupsParams { order?: Order; offset?: number; count?: number; } + /** + * @deprecated + */ interface PostGroupsParams { name: string; members?: string[]; } + /** + * @deprecated + */ interface PatchGroupParams { name?: string; members?: string[]; } + /** + * @deprecated + */ + interface PostProjectGroupParams { + groupId: number; + } } export declare namespace Team { interface GetTeamsParams { diff --git a/src/backlog.ts b/src/backlog.ts index 1d48883..1e27cb8 100644 --- a/src/backlog.ts +++ b/src/backlog.ts @@ -1109,7 +1109,9 @@ export default class Backlog extends Request { /** * https://developer.nulab.com/docs/backlog/api/2/add-watching */ - public postWatchingListItem(params: any): Promise { + public postWatchingListItem( + params: Option.WatchingList.PostWatchingListItemParams, + ): Promise { return this.post(`watchings`, params); } @@ -1147,7 +1149,10 @@ export default class Backlog extends Request { * https://developer.nulab.com/docs/backlog/api/2/add-project-group * @deprecated */ - public postProjectGroup(projectIdOrKey: string | number, params: any): Promise { + public postProjectGroup( + projectIdOrKey: string | number, + params: Option.Group.PostProjectGroupParams, + ): Promise { console.warn("Deprecated: Use postProjectTeam instead."); return this.post(`projects/${projectIdOrKey}/groups`, params); } diff --git a/src/option.ts b/src/option.ts index 7aa32a5..b58af1e 100644 --- a/src/option.ts +++ b/src/option.ts @@ -79,24 +79,45 @@ } - export namespace Group { + export namespace WatchingList { + export interface PostWatchingListItemParams { + issueIdOrKey: string | number; + note: string; + } + } + export namespace Group { + /** + * @deprecated + */ export interface GetGroupsParams { order?: Order; offset?: number; count?: number; } + /** + * @deprecated + */ export interface PostGroupsParams { name: string; members?: string[]; } + /** + * @deprecated + */ export interface PatchGroupParams { name?: string; members?: string[]; } + /** + * @deprecated + */ + export interface PostProjectGroupParams { + groupId: number; + } } export namespace Team {