From e681d23f524a055ec904fb9f785b2382a44aad48 Mon Sep 17 00:00:00 2001 From: Makoto Motohashi Date: Tue, 29 Dec 2020 18:36:51 +0900 Subject: [PATCH 1/4] add missing endpoints --- dist/backlog.js | 48 ++++++++++++++++++ dist/backlog.min.js | 2 +- src/backlog.ts | 119 ++++++++++++++++++++++++++++++++++++++++++++ src/option.ts | 28 +++++++++++ 4 files changed, 196 insertions(+), 1 deletion(-) diff --git a/dist/backlog.js b/dist/backlog.js index b21497f..2c9f10e 100644 --- a/dist/backlog.js +++ b/dist/backlog.js @@ -98,6 +98,9 @@ var Backlog = (function (_super) { Backlog.prototype.getStatuses = function () { return this.get('statuses'); }; + Backlog.prototype.getProjectStatuses = function (projectIdOrKey) { + return this.get("projects/" + projectIdOrKey + "/statuses"); + }; Backlog.prototype.getResolutions = function () { return this.get('resolutions'); }; @@ -143,6 +146,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"); }; @@ -254,6 +269,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); }; @@ -272,6 +290,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"); }; @@ -422,6 +443,33 @@ var Backlog = (function (_super) { 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); }; diff --git a/dist/backlog.min.js b/dist/backlog.min.js index 06bc10d..f52369c 100644 --- a/dist/backlog.min.js +++ b/dist/backlog.min.js @@ -1 +1 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Backlog=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0}).join("&")};OAuth2.prototype.getAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"authorization_code",code:options.code,client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,redirect_uri:options.redirectUri})};OAuth2.prototype.refreshAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"refresh_token",client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,refresh_token:options.refreshToken})};return OAuth2}();exports.default=OAuth2},{"./request":7}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ActivityType;(function(ActivityType){ActivityType[ActivityType["Undefined"]=-1]="Undefined";ActivityType[ActivityType["IssueCreated"]=1]="IssueCreated";ActivityType[ActivityType["IssueUpdated"]=2]="IssueUpdated";ActivityType[ActivityType["IssueCommented"]=3]="IssueCommented";ActivityType[ActivityType["IssueDeleted"]=4]="IssueDeleted";ActivityType[ActivityType["WikiCreated"]=5]="WikiCreated";ActivityType[ActivityType["WikiUpdated"]=6]="WikiUpdated";ActivityType[ActivityType["WikiDeleted"]=7]="WikiDeleted";ActivityType[ActivityType["FileAdded"]=8]="FileAdded";ActivityType[ActivityType["FileUpdated"]=9]="FileUpdated";ActivityType[ActivityType["FileDeleted"]=10]="FileDeleted";ActivityType[ActivityType["SvnCommitted"]=11]="SvnCommitted";ActivityType[ActivityType["GitPushed"]=12]="GitPushed";ActivityType[ActivityType["GitRepositoryCreated"]=13]="GitRepositoryCreated";ActivityType[ActivityType["IssueMultiUpdated"]=14]="IssueMultiUpdated";ActivityType[ActivityType["ProjectUserAdded"]=15]="ProjectUserAdded";ActivityType[ActivityType["ProjectUserRemoved"]=16]="ProjectUserRemoved";ActivityType[ActivityType["NotifyAdded"]=17]="NotifyAdded";ActivityType[ActivityType["PullRequestAdded"]=18]="PullRequestAdded";ActivityType[ActivityType["PullRequestUpdated"]=19]="PullRequestUpdated";ActivityType[ActivityType["PullRequestCommented"]=20]="PullRequestCommented";ActivityType[ActivityType["PullRequestMerged"]=21]="PullRequestMerged"})(ActivityType=exports.ActivityType||(exports.ActivityType={}));var User;(function(User){var RoleType;(function(RoleType){RoleType[RoleType["Admin"]=1]="Admin";RoleType[RoleType["User"]=2]="User";RoleType[RoleType["Reporter"]=3]="Reporter";RoleType[RoleType["Viewer"]=4]="Viewer";RoleType[RoleType["GuestReporter"]=5]="GuestReporter";RoleType[RoleType["GuestViewer"]=6]="GuestViewer"})(RoleType=User.RoleType||(User.RoleType={}))})(User=exports.User||(exports.User={}));var Project;(function(Project){var FieldType;(function(FieldType){FieldType[FieldType["Text"]=1]="Text";FieldType[FieldType["TextArea"]=2]="TextArea";FieldType[FieldType["Numeric"]=3]="Numeric";FieldType[FieldType["Date"]=4]="Date";FieldType[FieldType["SingleList"]=5]="SingleList";FieldType[FieldType["MultipleList"]=6]="MultipleList";FieldType[FieldType["CheckBox"]=7]="CheckBox";FieldType[FieldType["Radio"]=8]="Radio"})(FieldType=Project.FieldType||(Project.FieldType={}))})(Project=exports.Project||(exports.Project={}));var Issue;(function(Issue){var ParentChildType;(function(ParentChildType){ParentChildType[ParentChildType["All"]=0]="All";ParentChildType[ParentChildType["NotChild"]=1]="NotChild";ParentChildType[ParentChildType["Child"]=2]="Child";ParentChildType[ParentChildType["NotChildNotParent"]=3]="NotChildNotParent";ParentChildType[ParentChildType["Parent"]=4]="Parent"})(ParentChildType=Issue.ParentChildType||(Issue.ParentChildType={}))})(Issue=exports.Issue||(exports.Issue={}))},{}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Error=require("./error");var qs=require("qs");var Request=function(){function Request(configure){this.configure=configure}Request.prototype.get=function(path,params){return this.request({method:"GET",path:path,params:params}).then(this.parseJSON)};Request.prototype.post=function(path,params){return this.request({method:"POST",path:path,params:params}).then(this.parseJSON)};Request.prototype.put=function(path,params){return this.request({method:"PUT",path:path,params:params}).then(this.parseJSON)};Request.prototype.patch=function(path,params){return this.request({method:"PATCH",path:path,params:params}).then(this.parseJSON)};Request.prototype.delete=function(path,params){return this.request({method:"DELETE",path:path,params:params}).then(this.parseJSON)};Request.prototype.request=function(options){var method=options.method,path=options.path,_a=options.params,params=_a===void 0?{}:_a;var _b=this.configure,apiKey=_b.apiKey,accessToken=_b.accessToken,timeout=_b.timeout;var query=apiKey?{apiKey:apiKey}:{};var init={method:method,headers:{}};if(timeout){init["timeout"]=timeout}if(!apiKey&&accessToken){init.headers["Authorization"]="Bearer "+accessToken}if(typeof window!=="undefined"){init.mode="cors"}if(method!=="GET"){if(params instanceof FormData){init.body=params}else{init.headers["Content-type"]="application/x-www-form-urlencoded";init.body=this.toQueryString(params)}}else{Object.keys(params).forEach(function(key){return query[key]=params[key]})}var queryStr=this.toQueryString(query);var url=this.restBaseURL+"/"+path+(queryStr.length>0?"?"+queryStr:"");return fetch(url,init).then(this.checkStatus)};Request.prototype.checkStatus=function(response){return new Promise(function(resolve,reject){if(200<=response.status&&response.status<300){resolve(response)}else{response.json().then(function(data){if(response.status===401){reject(new Error.BacklogAuthError(response,data))}else{reject(new Error.BacklogApiError(response,data))}}).catch(function(err){return reject(new Error.UnexpectedError(response))})}})};Request.prototype.parseJSON=function(response){return response.json()};Request.prototype.toQueryString=function(params){return qs.stringify(params,{arrayFormat:"brackets"})};Object.defineProperty(Request.prototype,"webAppBaseURL",{get:function(){return"https://"+this.configure.host},enumerable:true,configurable:true});Object.defineProperty(Request.prototype,"restBaseURL",{get:function(){return this.webAppBaseURL+"/api/v2"},enumerable:true,configurable:true});return Request}();exports.default=Request},{"./error":3,qs:9}],8:[function(require,module,exports){"use strict";var replace=String.prototype.replace;var percentTwenties=/%20/g;module.exports={default:"RFC3986",formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,"+")},RFC3986:function(value){return value}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},{}],9:[function(require,module,exports){"use strict";var stringify=require("./stringify");var parse=require("./parse");var formats=require("./formats");module.exports={formats:formats,parse:parse,stringify:stringify}},{"./formats":8,"./parse":10,"./stringify":11}],10:[function(require,module,exports){"use strict";var utils=require("./utils");var has=Object.prototype.hasOwnProperty;var defaults={allowDots:false,allowPrototypes:false,arrayLimit:20,decoder:utils.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:false,strictNullHandling:false};var parseValues=function parseQueryStringValues(str,options){var obj={};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);for(var i=0;i=0;--i){var obj;var root=chain[i];if(root==="[]"){obj=[];obj=obj.concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=leaf}else{obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while((segment=child.exec(key))!==null&&i0?prefix+joined:""}},{"./formats":8,"./utils":12}],12:[function(require,module,exports){"use strict";var has=Object.prototype.hasOwnProperty;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){var obj;while(queue.length){var item=queue.pop();obj=item.obj[item.prop];if(Array.isArray(obj)){var compacted=[];for(var j=0;j=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i0}).join("&")};OAuth2.prototype.getAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"authorization_code",code:options.code,client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,redirect_uri:options.redirectUri})};OAuth2.prototype.refreshAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"refresh_token",client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,refresh_token:options.refreshToken})};return OAuth2}();exports.default=OAuth2},{"./request":7}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ActivityType;(function(ActivityType){ActivityType[ActivityType["Undefined"]=-1]="Undefined";ActivityType[ActivityType["IssueCreated"]=1]="IssueCreated";ActivityType[ActivityType["IssueUpdated"]=2]="IssueUpdated";ActivityType[ActivityType["IssueCommented"]=3]="IssueCommented";ActivityType[ActivityType["IssueDeleted"]=4]="IssueDeleted";ActivityType[ActivityType["WikiCreated"]=5]="WikiCreated";ActivityType[ActivityType["WikiUpdated"]=6]="WikiUpdated";ActivityType[ActivityType["WikiDeleted"]=7]="WikiDeleted";ActivityType[ActivityType["FileAdded"]=8]="FileAdded";ActivityType[ActivityType["FileUpdated"]=9]="FileUpdated";ActivityType[ActivityType["FileDeleted"]=10]="FileDeleted";ActivityType[ActivityType["SvnCommitted"]=11]="SvnCommitted";ActivityType[ActivityType["GitPushed"]=12]="GitPushed";ActivityType[ActivityType["GitRepositoryCreated"]=13]="GitRepositoryCreated";ActivityType[ActivityType["IssueMultiUpdated"]=14]="IssueMultiUpdated";ActivityType[ActivityType["ProjectUserAdded"]=15]="ProjectUserAdded";ActivityType[ActivityType["ProjectUserRemoved"]=16]="ProjectUserRemoved";ActivityType[ActivityType["NotifyAdded"]=17]="NotifyAdded";ActivityType[ActivityType["PullRequestAdded"]=18]="PullRequestAdded";ActivityType[ActivityType["PullRequestUpdated"]=19]="PullRequestUpdated";ActivityType[ActivityType["PullRequestCommented"]=20]="PullRequestCommented";ActivityType[ActivityType["PullRequestMerged"]=21]="PullRequestMerged"})(ActivityType=exports.ActivityType||(exports.ActivityType={}));var User;(function(User){var RoleType;(function(RoleType){RoleType[RoleType["Admin"]=1]="Admin";RoleType[RoleType["User"]=2]="User";RoleType[RoleType["Reporter"]=3]="Reporter";RoleType[RoleType["Viewer"]=4]="Viewer";RoleType[RoleType["GuestReporter"]=5]="GuestReporter";RoleType[RoleType["GuestViewer"]=6]="GuestViewer"})(RoleType=User.RoleType||(User.RoleType={}))})(User=exports.User||(exports.User={}));var Project;(function(Project){var FieldType;(function(FieldType){FieldType[FieldType["Text"]=1]="Text";FieldType[FieldType["TextArea"]=2]="TextArea";FieldType[FieldType["Numeric"]=3]="Numeric";FieldType[FieldType["Date"]=4]="Date";FieldType[FieldType["SingleList"]=5]="SingleList";FieldType[FieldType["MultipleList"]=6]="MultipleList";FieldType[FieldType["CheckBox"]=7]="CheckBox";FieldType[FieldType["Radio"]=8]="Radio"})(FieldType=Project.FieldType||(Project.FieldType={}))})(Project=exports.Project||(exports.Project={}));var Issue;(function(Issue){var ParentChildType;(function(ParentChildType){ParentChildType[ParentChildType["All"]=0]="All";ParentChildType[ParentChildType["NotChild"]=1]="NotChild";ParentChildType[ParentChildType["Child"]=2]="Child";ParentChildType[ParentChildType["NotChildNotParent"]=3]="NotChildNotParent";ParentChildType[ParentChildType["Parent"]=4]="Parent"})(ParentChildType=Issue.ParentChildType||(Issue.ParentChildType={}))})(Issue=exports.Issue||(exports.Issue={}))},{}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Error=require("./error");var qs=require("qs");var Request=function(){function Request(configure){this.configure=configure}Request.prototype.get=function(path,params){return this.request({method:"GET",path:path,params:params}).then(this.parseJSON)};Request.prototype.post=function(path,params){return this.request({method:"POST",path:path,params:params}).then(this.parseJSON)};Request.prototype.put=function(path,params){return this.request({method:"PUT",path:path,params:params}).then(this.parseJSON)};Request.prototype.patch=function(path,params){return this.request({method:"PATCH",path:path,params:params}).then(this.parseJSON)};Request.prototype.delete=function(path,params){return this.request({method:"DELETE",path:path,params:params}).then(this.parseJSON)};Request.prototype.request=function(options){var method=options.method,path=options.path,_a=options.params,params=_a===void 0?{}:_a;var _b=this.configure,apiKey=_b.apiKey,accessToken=_b.accessToken,timeout=_b.timeout;var query=apiKey?{apiKey:apiKey}:{};var init={method:method,headers:{}};if(timeout){init["timeout"]=timeout}if(!apiKey&&accessToken){init.headers["Authorization"]="Bearer "+accessToken}if(typeof window!=="undefined"){init.mode="cors"}if(method!=="GET"){if(params instanceof FormData){init.body=params}else{init.headers["Content-type"]="application/x-www-form-urlencoded";init.body=this.toQueryString(params)}}else{Object.keys(params).forEach(function(key){return query[key]=params[key]})}var queryStr=this.toQueryString(query);var url=this.restBaseURL+"/"+path+(queryStr.length>0?"?"+queryStr:"");return fetch(url,init).then(this.checkStatus)};Request.prototype.checkStatus=function(response){return new Promise(function(resolve,reject){if(200<=response.status&&response.status<300){resolve(response)}else{response.json().then(function(data){if(response.status===401){reject(new Error.BacklogAuthError(response,data))}else{reject(new Error.BacklogApiError(response,data))}}).catch(function(err){return reject(new Error.UnexpectedError(response))})}})};Request.prototype.parseJSON=function(response){return response.json()};Request.prototype.toQueryString=function(params){return qs.stringify(params,{arrayFormat:"brackets"})};Object.defineProperty(Request.prototype,"webAppBaseURL",{get:function(){return"https://"+this.configure.host},enumerable:true,configurable:true});Object.defineProperty(Request.prototype,"restBaseURL",{get:function(){return this.webAppBaseURL+"/api/v2"},enumerable:true,configurable:true});return Request}();exports.default=Request},{"./error":3,qs:9}],8:[function(require,module,exports){"use strict";var replace=String.prototype.replace;var percentTwenties=/%20/g;module.exports={default:"RFC3986",formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,"+")},RFC3986:function(value){return value}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},{}],9:[function(require,module,exports){"use strict";var stringify=require("./stringify");var parse=require("./parse");var formats=require("./formats");module.exports={formats:formats,parse:parse,stringify:stringify}},{"./formats":8,"./parse":10,"./stringify":11}],10:[function(require,module,exports){"use strict";var utils=require("./utils");var has=Object.prototype.hasOwnProperty;var defaults={allowDots:false,allowPrototypes:false,arrayLimit:20,decoder:utils.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:false,strictNullHandling:false};var parseValues=function parseQueryStringValues(str,options){var obj={};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);for(var i=0;i=0;--i){var obj;var root=chain[i];if(root==="[]"){obj=[];obj=obj.concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=leaf}else{obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while((segment=child.exec(key))!==null&&i0?prefix+joined:""}},{"./formats":8,"./utils":12}],12:[function(require,module,exports){"use strict";var has=Object.prototype.hasOwnProperty;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){var obj;while(queue.length){var item=queue.pop();obj=item.obj[item.prop];if(Array.isArray(obj)){var compacted=[];for(var j=0;j=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i { + return this.get(`projects/${projectIdOrKey}/statuses`); + } + /** * 27: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-resolution-list/ */ @@ -326,6 +333,42 @@ export default class Backlog extends Request { return this.delete(`projects/${projectIdOrKey}/administrators`, params); } + /** + * https://developer.nulab.com/docs/backlog/api/2/add-status/ + */ + public postProjectStatus( + projectIdOrKey: string, params: Option.Project.PostStatusParams, + ): Promise { + return this.post(`projects/${projectIdOrKey}/statuses`, params); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/update-status/ + */ + public patchProjectStatus( + projectIdOrKey: string, id: number, params: Option.Project.PatchStatusParams + ): Promise { + return this.patch(`projects/${projectIdOrKey}/statuses/${id}`, params); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/delete-status/ + */ + public deleteProjectStatus( + projectIdOrKey: string, id: number, substituteStatusId: number + ): Promise { + return this.delete(`projects/${projectIdOrKey}/statuses/${id}`, { substituteStatusId }); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/update-order-of-status/ + */ + public patchProjectStatusOrder( + projectIdOrKey: string, statusId: number[] + ): Promise { + return this.patch(`projects/${projectIdOrKey}/statuses/updateDisplayOrder`, { statusId }); + } + /** * 42: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-type-list/ */ @@ -639,6 +682,13 @@ export default class Backlog extends Request { return this.get(`issues/${issueIdOrKey}/comments/${commentId}`); } + /** + * https://developer.nulab.com/docs/backlog/api/2/delete-comment/ + */ + public deleteIssueComment(issueIdOrKey: string, commentId: number): Promise { + return this.delete(`issues/${issueIdOrKey}/comments/${commentId}`); + } + /** * 79: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-comment/ */ @@ -687,6 +737,13 @@ export default class Backlog extends Request { return this.delete(`issues/${issueIdOrKey}/attachments/${attachmentId}`); } + /** + * https://developer.nulab.com/docs/backlog/api/2/get-issue-participant-list/ + */ + public getIssueParticipants(issueIdOrKey: string): Promise { + return this.get(`issues/${issueIdOrKey}/participants`); + } + /** * 85: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-linked-shared-files/ */ @@ -1092,6 +1149,68 @@ export default class Backlog extends Request { return this.get(`space/licence`); } + /** + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-teams/ + */ + public getTeams(params?: Option.Team.GetTeamsParams): Promise { + return this.get(`teams`, params); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/add-team/ + */ + public postTeam(members: number[]): Promise { + return this.post(`teams`, { members }); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/get-team/ + */ + public getTeam(teamId: number): Promise { + return this.get(`teams/${teamId}`); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/update-team/ + */ + public patchTeam(teamId: number, params: Option.Team.PatchTeamParams): Promise { + return this.patch(`teams/${teamId}`, params); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/delete-team/ + */ + public deleteTeam(teamId: number): Promise { + return this.delete(`teams/${teamId}`); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/get-team-icon/ + */ + public getTeamIcon(teamId: number): Promise { + return this.download(`teams/${teamId}/icon`); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/get-project-team-list/ + */ + public getProjectTeams(projectIdOrKey: string): Promise { + return this.get(`projects/${projectIdOrKey}/teams`); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/add-project-team/ + */ + public postProjectTeam(projectIdOrKey: string, teamId: number): Promise { + return this.post(`projects/${projectIdOrKey}/teams`, { teamId }); + } + + /** + * https://developer.nulab.com/docs/backlog/api/2/delete-project-team/ + */ + public deleteProjectTeam(projectIdOrKey: string, teamId: number): Promise { + return this.delete(`projects/${projectIdOrKey}/teams`, { teamId }); + } private download(path: string): Promise { return this.request({ method: 'GET', path }).then(this.parseFileData); diff --git a/src/option.ts b/src/option.ts index de8d7fd..acac728 100644 --- a/src/option.ts +++ b/src/option.ts @@ -132,6 +132,21 @@ } + 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"; @@ -327,6 +342,19 @@ 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 { From 65ff75aee8352573a775a1d026f5e638cc50f6d4 Mon Sep 17 00:00:00 2001 From: Makoto Motohashi Date: Wed, 30 Dec 2020 18:08:00 +0900 Subject: [PATCH 2/4] deprecation warning --- dist/backlog.js | 10 ++++++++++ dist/backlog.min.js | 2 +- src/backlog.ts | 12 +++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dist/backlog.js b/dist/backlog.js index 2c9f10e..9cade83 100644 --- a/dist/backlog.js +++ b/dist/backlog.js @@ -81,21 +81,27 @@ 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) { @@ -429,15 +435,19 @@ 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 () { diff --git a/dist/backlog.min.js b/dist/backlog.min.js index f52369c..ac8f3c1 100644 --- a/dist/backlog.min.js +++ b/dist/backlog.min.js @@ -1 +1 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Backlog=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0}).join("&")};OAuth2.prototype.getAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"authorization_code",code:options.code,client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,redirect_uri:options.redirectUri})};OAuth2.prototype.refreshAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"refresh_token",client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,refresh_token:options.refreshToken})};return OAuth2}();exports.default=OAuth2},{"./request":7}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ActivityType;(function(ActivityType){ActivityType[ActivityType["Undefined"]=-1]="Undefined";ActivityType[ActivityType["IssueCreated"]=1]="IssueCreated";ActivityType[ActivityType["IssueUpdated"]=2]="IssueUpdated";ActivityType[ActivityType["IssueCommented"]=3]="IssueCommented";ActivityType[ActivityType["IssueDeleted"]=4]="IssueDeleted";ActivityType[ActivityType["WikiCreated"]=5]="WikiCreated";ActivityType[ActivityType["WikiUpdated"]=6]="WikiUpdated";ActivityType[ActivityType["WikiDeleted"]=7]="WikiDeleted";ActivityType[ActivityType["FileAdded"]=8]="FileAdded";ActivityType[ActivityType["FileUpdated"]=9]="FileUpdated";ActivityType[ActivityType["FileDeleted"]=10]="FileDeleted";ActivityType[ActivityType["SvnCommitted"]=11]="SvnCommitted";ActivityType[ActivityType["GitPushed"]=12]="GitPushed";ActivityType[ActivityType["GitRepositoryCreated"]=13]="GitRepositoryCreated";ActivityType[ActivityType["IssueMultiUpdated"]=14]="IssueMultiUpdated";ActivityType[ActivityType["ProjectUserAdded"]=15]="ProjectUserAdded";ActivityType[ActivityType["ProjectUserRemoved"]=16]="ProjectUserRemoved";ActivityType[ActivityType["NotifyAdded"]=17]="NotifyAdded";ActivityType[ActivityType["PullRequestAdded"]=18]="PullRequestAdded";ActivityType[ActivityType["PullRequestUpdated"]=19]="PullRequestUpdated";ActivityType[ActivityType["PullRequestCommented"]=20]="PullRequestCommented";ActivityType[ActivityType["PullRequestMerged"]=21]="PullRequestMerged"})(ActivityType=exports.ActivityType||(exports.ActivityType={}));var User;(function(User){var RoleType;(function(RoleType){RoleType[RoleType["Admin"]=1]="Admin";RoleType[RoleType["User"]=2]="User";RoleType[RoleType["Reporter"]=3]="Reporter";RoleType[RoleType["Viewer"]=4]="Viewer";RoleType[RoleType["GuestReporter"]=5]="GuestReporter";RoleType[RoleType["GuestViewer"]=6]="GuestViewer"})(RoleType=User.RoleType||(User.RoleType={}))})(User=exports.User||(exports.User={}));var Project;(function(Project){var FieldType;(function(FieldType){FieldType[FieldType["Text"]=1]="Text";FieldType[FieldType["TextArea"]=2]="TextArea";FieldType[FieldType["Numeric"]=3]="Numeric";FieldType[FieldType["Date"]=4]="Date";FieldType[FieldType["SingleList"]=5]="SingleList";FieldType[FieldType["MultipleList"]=6]="MultipleList";FieldType[FieldType["CheckBox"]=7]="CheckBox";FieldType[FieldType["Radio"]=8]="Radio"})(FieldType=Project.FieldType||(Project.FieldType={}))})(Project=exports.Project||(exports.Project={}));var Issue;(function(Issue){var ParentChildType;(function(ParentChildType){ParentChildType[ParentChildType["All"]=0]="All";ParentChildType[ParentChildType["NotChild"]=1]="NotChild";ParentChildType[ParentChildType["Child"]=2]="Child";ParentChildType[ParentChildType["NotChildNotParent"]=3]="NotChildNotParent";ParentChildType[ParentChildType["Parent"]=4]="Parent"})(ParentChildType=Issue.ParentChildType||(Issue.ParentChildType={}))})(Issue=exports.Issue||(exports.Issue={}))},{}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Error=require("./error");var qs=require("qs");var Request=function(){function Request(configure){this.configure=configure}Request.prototype.get=function(path,params){return this.request({method:"GET",path:path,params:params}).then(this.parseJSON)};Request.prototype.post=function(path,params){return this.request({method:"POST",path:path,params:params}).then(this.parseJSON)};Request.prototype.put=function(path,params){return this.request({method:"PUT",path:path,params:params}).then(this.parseJSON)};Request.prototype.patch=function(path,params){return this.request({method:"PATCH",path:path,params:params}).then(this.parseJSON)};Request.prototype.delete=function(path,params){return this.request({method:"DELETE",path:path,params:params}).then(this.parseJSON)};Request.prototype.request=function(options){var method=options.method,path=options.path,_a=options.params,params=_a===void 0?{}:_a;var _b=this.configure,apiKey=_b.apiKey,accessToken=_b.accessToken,timeout=_b.timeout;var query=apiKey?{apiKey:apiKey}:{};var init={method:method,headers:{}};if(timeout){init["timeout"]=timeout}if(!apiKey&&accessToken){init.headers["Authorization"]="Bearer "+accessToken}if(typeof window!=="undefined"){init.mode="cors"}if(method!=="GET"){if(params instanceof FormData){init.body=params}else{init.headers["Content-type"]="application/x-www-form-urlencoded";init.body=this.toQueryString(params)}}else{Object.keys(params).forEach(function(key){return query[key]=params[key]})}var queryStr=this.toQueryString(query);var url=this.restBaseURL+"/"+path+(queryStr.length>0?"?"+queryStr:"");return fetch(url,init).then(this.checkStatus)};Request.prototype.checkStatus=function(response){return new Promise(function(resolve,reject){if(200<=response.status&&response.status<300){resolve(response)}else{response.json().then(function(data){if(response.status===401){reject(new Error.BacklogAuthError(response,data))}else{reject(new Error.BacklogApiError(response,data))}}).catch(function(err){return reject(new Error.UnexpectedError(response))})}})};Request.prototype.parseJSON=function(response){return response.json()};Request.prototype.toQueryString=function(params){return qs.stringify(params,{arrayFormat:"brackets"})};Object.defineProperty(Request.prototype,"webAppBaseURL",{get:function(){return"https://"+this.configure.host},enumerable:true,configurable:true});Object.defineProperty(Request.prototype,"restBaseURL",{get:function(){return this.webAppBaseURL+"/api/v2"},enumerable:true,configurable:true});return Request}();exports.default=Request},{"./error":3,qs:9}],8:[function(require,module,exports){"use strict";var replace=String.prototype.replace;var percentTwenties=/%20/g;module.exports={default:"RFC3986",formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,"+")},RFC3986:function(value){return value}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},{}],9:[function(require,module,exports){"use strict";var stringify=require("./stringify");var parse=require("./parse");var formats=require("./formats");module.exports={formats:formats,parse:parse,stringify:stringify}},{"./formats":8,"./parse":10,"./stringify":11}],10:[function(require,module,exports){"use strict";var utils=require("./utils");var has=Object.prototype.hasOwnProperty;var defaults={allowDots:false,allowPrototypes:false,arrayLimit:20,decoder:utils.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:false,strictNullHandling:false};var parseValues=function parseQueryStringValues(str,options){var obj={};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);for(var i=0;i=0;--i){var obj;var root=chain[i];if(root==="[]"){obj=[];obj=obj.concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=leaf}else{obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while((segment=child.exec(key))!==null&&i0?prefix+joined:""}},{"./formats":8,"./utils":12}],12:[function(require,module,exports){"use strict";var has=Object.prototype.hasOwnProperty;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){var obj;while(queue.length){var item=queue.pop();obj=item.obj[item.prop];if(Array.isArray(obj)){var compacted=[];for(var j=0;j=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i0}).join("&")};OAuth2.prototype.getAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"authorization_code",code:options.code,client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,redirect_uri:options.redirectUri})};OAuth2.prototype.refreshAccessToken=function(options){return new request_1.default({host:options.host,timeout:this.timeout}).post("oauth2/token",{grant_type:"refresh_token",client_id:this.credentials.clientId,client_secret:this.credentials.clientSecret,refresh_token:options.refreshToken})};return OAuth2}();exports.default=OAuth2},{"./request":7}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ActivityType;(function(ActivityType){ActivityType[ActivityType["Undefined"]=-1]="Undefined";ActivityType[ActivityType["IssueCreated"]=1]="IssueCreated";ActivityType[ActivityType["IssueUpdated"]=2]="IssueUpdated";ActivityType[ActivityType["IssueCommented"]=3]="IssueCommented";ActivityType[ActivityType["IssueDeleted"]=4]="IssueDeleted";ActivityType[ActivityType["WikiCreated"]=5]="WikiCreated";ActivityType[ActivityType["WikiUpdated"]=6]="WikiUpdated";ActivityType[ActivityType["WikiDeleted"]=7]="WikiDeleted";ActivityType[ActivityType["FileAdded"]=8]="FileAdded";ActivityType[ActivityType["FileUpdated"]=9]="FileUpdated";ActivityType[ActivityType["FileDeleted"]=10]="FileDeleted";ActivityType[ActivityType["SvnCommitted"]=11]="SvnCommitted";ActivityType[ActivityType["GitPushed"]=12]="GitPushed";ActivityType[ActivityType["GitRepositoryCreated"]=13]="GitRepositoryCreated";ActivityType[ActivityType["IssueMultiUpdated"]=14]="IssueMultiUpdated";ActivityType[ActivityType["ProjectUserAdded"]=15]="ProjectUserAdded";ActivityType[ActivityType["ProjectUserRemoved"]=16]="ProjectUserRemoved";ActivityType[ActivityType["NotifyAdded"]=17]="NotifyAdded";ActivityType[ActivityType["PullRequestAdded"]=18]="PullRequestAdded";ActivityType[ActivityType["PullRequestUpdated"]=19]="PullRequestUpdated";ActivityType[ActivityType["PullRequestCommented"]=20]="PullRequestCommented";ActivityType[ActivityType["PullRequestMerged"]=21]="PullRequestMerged"})(ActivityType=exports.ActivityType||(exports.ActivityType={}));var User;(function(User){var RoleType;(function(RoleType){RoleType[RoleType["Admin"]=1]="Admin";RoleType[RoleType["User"]=2]="User";RoleType[RoleType["Reporter"]=3]="Reporter";RoleType[RoleType["Viewer"]=4]="Viewer";RoleType[RoleType["GuestReporter"]=5]="GuestReporter";RoleType[RoleType["GuestViewer"]=6]="GuestViewer"})(RoleType=User.RoleType||(User.RoleType={}))})(User=exports.User||(exports.User={}));var Project;(function(Project){var FieldType;(function(FieldType){FieldType[FieldType["Text"]=1]="Text";FieldType[FieldType["TextArea"]=2]="TextArea";FieldType[FieldType["Numeric"]=3]="Numeric";FieldType[FieldType["Date"]=4]="Date";FieldType[FieldType["SingleList"]=5]="SingleList";FieldType[FieldType["MultipleList"]=6]="MultipleList";FieldType[FieldType["CheckBox"]=7]="CheckBox";FieldType[FieldType["Radio"]=8]="Radio"})(FieldType=Project.FieldType||(Project.FieldType={}))})(Project=exports.Project||(exports.Project={}));var Issue;(function(Issue){var ParentChildType;(function(ParentChildType){ParentChildType[ParentChildType["All"]=0]="All";ParentChildType[ParentChildType["NotChild"]=1]="NotChild";ParentChildType[ParentChildType["Child"]=2]="Child";ParentChildType[ParentChildType["NotChildNotParent"]=3]="NotChildNotParent";ParentChildType[ParentChildType["Parent"]=4]="Parent"})(ParentChildType=Issue.ParentChildType||(Issue.ParentChildType={}))})(Issue=exports.Issue||(exports.Issue={}))},{}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var Error=require("./error");var qs=require("qs");var Request=function(){function Request(configure){this.configure=configure}Request.prototype.get=function(path,params){return this.request({method:"GET",path:path,params:params}).then(this.parseJSON)};Request.prototype.post=function(path,params){return this.request({method:"POST",path:path,params:params}).then(this.parseJSON)};Request.prototype.put=function(path,params){return this.request({method:"PUT",path:path,params:params}).then(this.parseJSON)};Request.prototype.patch=function(path,params){return this.request({method:"PATCH",path:path,params:params}).then(this.parseJSON)};Request.prototype.delete=function(path,params){return this.request({method:"DELETE",path:path,params:params}).then(this.parseJSON)};Request.prototype.request=function(options){var method=options.method,path=options.path,_a=options.params,params=_a===void 0?{}:_a;var _b=this.configure,apiKey=_b.apiKey,accessToken=_b.accessToken,timeout=_b.timeout;var query=apiKey?{apiKey:apiKey}:{};var init={method:method,headers:{}};if(timeout){init["timeout"]=timeout}if(!apiKey&&accessToken){init.headers["Authorization"]="Bearer "+accessToken}if(typeof window!=="undefined"){init.mode="cors"}if(method!=="GET"){if(params instanceof FormData){init.body=params}else{init.headers["Content-type"]="application/x-www-form-urlencoded";init.body=this.toQueryString(params)}}else{Object.keys(params).forEach(function(key){return query[key]=params[key]})}var queryStr=this.toQueryString(query);var url=this.restBaseURL+"/"+path+(queryStr.length>0?"?"+queryStr:"");return fetch(url,init).then(this.checkStatus)};Request.prototype.checkStatus=function(response){return new Promise(function(resolve,reject){if(200<=response.status&&response.status<300){resolve(response)}else{response.json().then(function(data){if(response.status===401){reject(new Error.BacklogAuthError(response,data))}else{reject(new Error.BacklogApiError(response,data))}}).catch(function(err){return reject(new Error.UnexpectedError(response))})}})};Request.prototype.parseJSON=function(response){return response.json()};Request.prototype.toQueryString=function(params){return qs.stringify(params,{arrayFormat:"brackets"})};Object.defineProperty(Request.prototype,"webAppBaseURL",{get:function(){return"https://"+this.configure.host},enumerable:true,configurable:true});Object.defineProperty(Request.prototype,"restBaseURL",{get:function(){return this.webAppBaseURL+"/api/v2"},enumerable:true,configurable:true});return Request}();exports.default=Request},{"./error":3,qs:9}],8:[function(require,module,exports){"use strict";var replace=String.prototype.replace;var percentTwenties=/%20/g;module.exports={default:"RFC3986",formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,"+")},RFC3986:function(value){return value}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},{}],9:[function(require,module,exports){"use strict";var stringify=require("./stringify");var parse=require("./parse");var formats=require("./formats");module.exports={formats:formats,parse:parse,stringify:stringify}},{"./formats":8,"./parse":10,"./stringify":11}],10:[function(require,module,exports){"use strict";var utils=require("./utils");var has=Object.prototype.hasOwnProperty;var defaults={allowDots:false,allowPrototypes:false,arrayLimit:20,decoder:utils.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:false,strictNullHandling:false};var parseValues=function parseQueryStringValues(str,options){var obj={};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);for(var i=0;i=0;--i){var obj;var root=chain[i];if(root==="[]"){obj=[];obj=obj.concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=leaf}else{obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while((segment=child.exec(key))!==null&&i0?prefix+joined:""}},{"./formats":8,"./utils":12}],12:[function(require,module,exports){"use strict";var has=Object.prototype.hasOwnProperty;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){var obj;while(queue.length){var item=queue.pop();obj=item.obj[item.prop];if(Array.isArray(obj)){var compacted=[];for(var j=0;j=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i { + console.warn("Deprecated: Use getTeams instead."); return this.get('groups', params); } @@ -179,6 +180,7 @@ export default class Backlog extends Request { * 22: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-group/ */ public postGroups(params: Option.Group.PostGroupsParams): Promise { + console.warn("Deprecated: Use postTeam instead."); return this.post('groups', params); } @@ -186,6 +188,7 @@ export default class Backlog extends Request { * 23: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-group/ */ public getGroup(groupId: number): Promise { + console.warn("Deprecated: Use getTeam instead."); return this.get(`groups/${groupId}`); } @@ -195,6 +198,7 @@ export default class Backlog extends Request { public patchGroup( groupId: number, params: Option.Group.PatchGroupParams ): Promise { + console.warn("Deprecated: Use patchTeam instead."); return this.patch(`groups/${groupId}`, params); } @@ -202,6 +206,7 @@ export default class Backlog extends Request { * 25: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-group/ */ public deleteGroup(groupId: number): Promise { + console.warn("Deprecated: Use deleteTeam instead."); return this.delete(`groups/${groupId}`); } @@ -209,6 +214,7 @@ export default class Backlog extends Request { * 26: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-status-list/ */ public getStatuses(): Promise { + console.warn("Deprecated: Use getProjectStatuses instead."); return this.get('statuses'); } @@ -1118,6 +1124,7 @@ export default class Backlog extends Request { * 130: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-group-list */ public getProjectGroupList(projectIdOrKey: string|number) { + console.warn("Deprecated: Use getProjectTeams instead."); return this.get(`projects/${projectIdOrKey}/groups`) } @@ -1125,13 +1132,15 @@ export default class Backlog extends Request { * 131: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-project-group */ public postProjectGroup(projectIdOrKey: string|number, params: any) { + console.warn("Deprecated: Use postProjectTeam instead."); return this.post(`projects/${projectIdOrKey}/groups`, params); } - + /** * 132: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-project-group */ public deleteProjectGroup(projectIdOrKey: string|number) { + console.warn("Deprecated: Use deleteProjectTeam instead."); return this.delete(`projects/${projectIdOrKey}/groups`); } @@ -1139,6 +1148,7 @@ export default class Backlog extends Request { * 133: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-group-icon */ public getGroupIcon(groupId: string): Promise { + console.warn("Deprecated: Use getTeamIcon instead."); return this.download(`groups/${groupId}/icon`); } From 515994f220371d355ab5aae04356f798ef88ba70 Mon Sep 17 00:00:00 2001 From: Makoto Motohashi Date: Thu, 31 Dec 2020 16:09:49 +0900 Subject: [PATCH 3/4] re-format comments --- src/backlog.ts | 268 ++++++++++++++++++++++++------------------------- 1 file changed, 134 insertions(+), 134 deletions(-) diff --git a/src/backlog.ts b/src/backlog.ts index 865a5ce..da2671d 100644 --- a/src/backlog.ts +++ b/src/backlog.ts @@ -11,14 +11,14 @@ export default class Backlog extends Request { } /** - * 1: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space/ + * https://developer.nulab.com/docs/backlog/api/2/get-space/ */ public getSpace(): Promise { return this.get('space'); } /** - * 2: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-recent-updates/ + * https://developer.nulab.com/docs/backlog/api/2/get-recent-updates/ */ public getSpaceActivities( params: Option.Space.GetActivitiesParams @@ -27,21 +27,21 @@ export default class Backlog extends Request { } /** - * 3: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space-logo/ + * https://developer.nulab.com/docs/backlog/api/2/get-space-logo/ */ public getSpaceIcon(): Promise { return this.download('space/image'); } /** - * 4: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space-notification/ + * https://developer.nulab.com/docs/backlog/api/2/get-space-notification/ */ public getSpaceNotification(): Promise { return this.get('space/notification'); } /** - * 5: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-space-notification/ + * https://developer.nulab.com/docs/backlog/api/2/update-space-notification/ */ public putSpaceNotification( params: Option.Space.PutSpaceNotificationParams @@ -50,42 +50,42 @@ export default class Backlog extends Request { } /** - * 6: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space-disk-usage/ + * https://developer.nulab.com/docs/backlog/api/2/get-space-disk-usage/ */ public getSpaceDiskUsage(): Promise { return this.get('space/diskUsage'); } /** - * 7: https://developer.nulab-inc.com/ja/docs/backlog/api/2/post-attachment-file/ + * https://developer.nulab.com/docs/backlog/api/2/post-attachment-file/ */ public postSpaceAttachment(form: FormData) { return this.upload("space/attachment", form); } /** - * 8: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-user-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-user-list/ */ public getUsers(): Promise { return this.get(`users`); } /** - * 9: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-user/ + * https://developer.nulab.com/docs/backlog/api/2/get-user/ */ public getUser(userId: number): Promise { return this.get(`users/${userId}`); } /** - * 10: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-user/ + * https://developer.nulab.com/docs/backlog/api/2/add-user/ */ public postUser(params: Option.User.PostUserParams): Promise { return this.post(`users`, params); } /** - * 11: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-user/ + * https://developer.nulab.com/docs/backlog/api/2/update-user/ */ public patchUser( userId: number, params: Option.User.PatchUserParams @@ -94,28 +94,28 @@ export default class Backlog extends Request { } /** - * 12: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-user/ + * https://developer.nulab.com/docs/backlog/api/2/delete-user/ */ public deleteUser(userId: number): Promise { return this.delete(`users/${userId}`); } /** - * 13: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-own-user/ + * https://developer.nulab.com/docs/backlog/api/2/get-own-user/ */ public getMyself(): Promise { return this.get('users/myself'); } /** - * 14: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-user-icon/ + * https://developer.nulab.com/docs/backlog/api/2/get-user-icon/ */ public getUserIcon(userId: number): Promise { return this.download(`users/${userId}/icon`); } /** - * 15: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-user-recent-updates/ + * https://developer.nulab.com/docs/backlog/api/2/get-user-recent-updates/ */ public getUserActivities( userId: number, params: Option.User.GetUserActivitiesParams @@ -124,7 +124,7 @@ export default class Backlog extends Request { } /** - * 16: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-received-star-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-received-star-list/ */ public getUserStars( userId: number, params: Option.User.GetUserStarsParams @@ -133,7 +133,7 @@ export default class Backlog extends Request { } /** - * 17: https://developer.nulab-inc.com/ja/docs/backlog/api/2/count-user-received-stars/ + * https://developer.nulab.com/docs/backlog/api/2/count-user-received-stars/ */ public getUserStarsCount( userId: number, params: Option.User.GetUserStarsCountParams @@ -142,7 +142,7 @@ export default class Backlog extends Request { } /** - * 18: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-recently-viewed-issues/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-issues/ */ public getRecentlyViewedIssues( params: Option.User.GetRecentlyViewedParams @@ -151,7 +151,7 @@ export default class Backlog extends Request { } /** - * 19: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-recently-viewed-projects/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-projects/ */ public getRecentlyViewedProjects( params: Option.User.GetRecentlyViewedParams @@ -160,7 +160,7 @@ export default class Backlog extends Request { } /** - * 20: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-recently-viewed-wikis/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-wikis/ */ public getRecentlyViewedWikis( params: Option.User.GetRecentlyViewedParams @@ -169,7 +169,7 @@ export default class Backlog extends Request { } /** - * 21: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-groups/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-groups/ */ public getGroups(params: Option.Group.GetGroupsParams): Promise { console.warn("Deprecated: Use getTeams instead."); @@ -177,7 +177,7 @@ export default class Backlog extends Request { } /** - * 22: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-group/ + * https://developer.nulab.com/docs/backlog/api/2/add-group/ */ public postGroups(params: Option.Group.PostGroupsParams): Promise { console.warn("Deprecated: Use postTeam instead."); @@ -185,7 +185,7 @@ export default class Backlog extends Request { } /** - * 23: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-group/ + * https://developer.nulab.com/docs/backlog/api/2/get-group/ */ public getGroup(groupId: number): Promise { console.warn("Deprecated: Use getTeam instead."); @@ -193,7 +193,7 @@ export default class Backlog extends Request { } /** - * 24: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-group/ + * https://developer.nulab.com/docs/backlog/api/2/update-group/ */ public patchGroup( groupId: number, params: Option.Group.PatchGroupParams @@ -203,7 +203,7 @@ export default class Backlog extends Request { } /** - * 25: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-group/ + * https://developer.nulab.com/docs/backlog/api/2/delete-group/ */ public deleteGroup(groupId: number): Promise { console.warn("Deprecated: Use deleteTeam instead."); @@ -211,7 +211,7 @@ export default class Backlog extends Request { } /** - * 26: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-status-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-status-list/ */ public getStatuses(): Promise { console.warn("Deprecated: Use getProjectStatuses instead."); @@ -226,42 +226,42 @@ export default class Backlog extends Request { } /** - * 27: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-resolution-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-resolution-list/ */ public getResolutions(): Promise { return this.get('resolutions'); } /** - * 28: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-priority-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-priority-list/ */ public getPriorities(): Promise { return this.get('priorities'); } /** - * 29: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-project-list/ */ public getProjects(params?: Option.Project.GetProjectsParams): Promise { return this.get('projects', params); } /** - * 30: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-project/ + * https://developer.nulab.com/docs/backlog/api/2/add-project/ */ public postProject(params: Option.Project.PostProjectParams): Promise { return this.post('projects', params); } /** - * 31: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project/ + * https://developer.nulab.com/docs/backlog/api/2/get-project/ */ public getProject(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}`); } /** - * 32: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-project/ + * https://developer.nulab.com/docs/backlog/api/2/update-project/ */ public patchProject( projectIdOrKey: string, params: Option.Project.PatchProjectParams @@ -270,20 +270,20 @@ export default class Backlog extends Request { } /** - * 33: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-project/ + * https://developer.nulab.com/docs/backlog/api/2/delete-project/ */ public deleteProject(projectIdOrKey: string): Promise { return this.delete(`projects/${projectIdOrKey}`); } /** - * 34: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-icon/ + * https://developer.nulab.com/docs/backlog/api/2/get-project-icon/ */ public getProjectIcon(projectIdOrKey: string): Promise { return this.download(`projects/${projectIdOrKey}/image`); } /** - * 35: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-recent-updates/ + * https://developer.nulab.com/docs/backlog/api/2/get-project-recent-updates/ */ public getProjectActivities( projectIdOrKey: string, params: Option.Space.GetActivitiesParams @@ -292,21 +292,21 @@ export default class Backlog extends Request { } /** - * 36: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-project-user/ + * https://developer.nulab.com/docs/backlog/api/2/add-project-user/ */ public postProjectUser(projectIdOrKey: string|number, userId: string): Promise { return this.post(`projects/${projectIdOrKey}/users`, { userId }); } /** - * 37: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-user-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-project-user-list/ */ public getProjectUsers(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/users`); } /** - * 38: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-project-user/ + * https://developer.nulab.com/docs/backlog/api/2/delete-project-user/ */ public deleteProjectUsers( projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams @@ -315,7 +315,7 @@ export default class Backlog extends Request { } /** - * 39: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-project-administrator/ + * https://developer.nulab.com/docs/backlog/api/2/add-project-administrator/ */ public postProjectAdministrators( projectIdOrKey: string, params: Option.Project.PostProjectAdministrators @@ -324,14 +324,14 @@ export default class Backlog extends Request { } /** - * 40: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-project-administrators/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-project-administrators/ */ public getProjectAdministrators(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/administrators`); } /** - * 41: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-project-administrator/ + * https://developer.nulab.com/docs/backlog/api/2/delete-project-administrator/ */ public deleteProjectAdministrators( projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators @@ -376,14 +376,14 @@ export default class Backlog extends Request { } /** - * 42: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-type-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-issue-type-list/ */ public getIssueTypes(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/issueTypes`); } /** - * 43: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-issue-type/ + * https://developer.nulab.com/docs/backlog/api/2/add-issue-type/ */ public postIssueType( projectIdOrKey: string, params: Option.Project.PostIssueTypeParams @@ -392,7 +392,7 @@ export default class Backlog extends Request { } /** - * 44: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-issue-type/ + * https://developer.nulab.com/docs/backlog/api/2/update-issue-type/ */ public patchIssueType( projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams @@ -401,7 +401,7 @@ export default class Backlog extends Request { } /** - * 45: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-issue-type/ + * https://developer.nulab.com/docs/backlog/api/2/delete-issue-type/ */ public deleteIssueType( projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams @@ -410,14 +410,14 @@ export default class Backlog extends Request { } /** - * 46: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-category-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-category-list/ */ public getCategories(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/categories`); } /** - * 47: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-category/ + * https://developer.nulab.com/docs/backlog/api/2/add-category/ */ public postCategories( projectIdOrKey: string, params: Option.Project.PostCategoriesParams @@ -426,7 +426,7 @@ export default class Backlog extends Request { } /** - * 48: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-category/ + * https://developer.nulab.com/docs/backlog/api/2/update-category/ */ public patchCategories( projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams @@ -435,21 +435,21 @@ export default class Backlog extends Request { } /** - * 49: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-category/ + * https://developer.nulab.com/docs/backlog/api/2/delete-category/ */ public deleteCategories(projectIdOrKey: string, id: number): Promise { return this.delete(`projects/${projectIdOrKey}/categories/${id}`); } /** - * 50: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-version-milestone-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-version-milestone-list/ */ public getVersions(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/versions`); } /** - * 51: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-version-milestone/ + * https://developer.nulab.com/docs/backlog/api/2/add-version-milestone/ */ public postVersions( projectIdOrKey: string, params: Option.Project.PostVersionsParams @@ -458,7 +458,7 @@ export default class Backlog extends Request { } /** - * 52: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-version-milestone/ + * https://developer.nulab.com/docs/backlog/api/2/update-version-milestone/ */ public patchVersions( projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams @@ -467,21 +467,21 @@ export default class Backlog extends Request { } /** - * 53: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-version/ + * https://developer.nulab.com/docs/backlog/api/2/delete-version/ */ public deleteVersions(projectIdOrKey: string, id: number): Promise { return this.delete(`projects/${projectIdOrKey}/versions/${id}`); } /** - * 54: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-custom-field-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-custom-field-list/ */ public getCustomFields(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/customFields`); } /** - * 55: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-custom-field/ + * https://developer.nulab.com/docs/backlog/api/2/add-custom-field/ */ public postCustomField( projectIdOrKey: string, @@ -494,7 +494,7 @@ export default class Backlog extends Request { } /** - * 56: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-custom-field/ + * https://developer.nulab.com/docs/backlog/api/2/update-custom-field/ */ public patchCustomField( projectIdOrKey: string, @@ -508,14 +508,14 @@ export default class Backlog extends Request { } /** - * 57: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-custom-field/ + * https://developer.nulab.com/docs/backlog/api/2/delete-custom-field/ */ public deleteCustomField(projectIdOrKey: string, id: number): Promise { return this.delete(`projects/${projectIdOrKey}/customFields/${id}`); } /** - * 58: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-list-item-for-list-type-custom-field/ + * https://developer.nulab.com/docs/backlog/api/2/add-list-item-for-list-type-custom-field/ */ public postCustomFieldItem( projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams @@ -524,7 +524,7 @@ export default class Backlog extends Request { } /** - * 59: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-list-item-for-list-type-custom-field/ + * https://developer.nulab.com/docs/backlog/api/2/update-list-item-for-list-type-custom-field/ */ public patchCustomFieldItem( projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams @@ -533,7 +533,7 @@ export default class Backlog extends Request { } /** - * 60: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-list-item-for-list-type-custom-field/ + * https://developer.nulab.com/docs/backlog/api/2/delete-list-item-for-list-type-custom-field/ */ public deleteCustomFieldItem( projectIdOrKey: string, id: number, itemId: number @@ -542,7 +542,7 @@ export default class Backlog extends Request { } /** - * 61: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-shared-files/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-shared-files/ */ public getSharedFiles( projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams @@ -551,14 +551,14 @@ export default class Backlog extends Request { } /** - * 62: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-file/ + * https://developer.nulab.com/docs/backlog/api/2/get-file/ */ public getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise { return this.download(`projects/${projectIdOrKey}/files/${sharedFileId}`); } /** - * 63: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-disk-usage/ + * https://developer.nulab.com/docs/backlog/api/2/get-project-disk-usage/ */ public getProjectsDiskUsage( projectIdOrKey: string @@ -567,7 +567,7 @@ export default class Backlog extends Request { } /** - * 64: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-webhooks/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-webhooks/ */ public getWebhooks( projectIdOrKey: string @@ -576,7 +576,7 @@ export default class Backlog extends Request { } /** - * 65: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-webhook/ + * https://developer.nulab.com/docs/backlog/api/2/add-webhook/ */ public postWebhook( projectIdOrKey: string, params: Option.Project.PostWebhookParams @@ -585,7 +585,7 @@ export default class Backlog extends Request { } /** - * 66: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-webhook/ + * https://developer.nulab.com/docs/backlog/api/2/get-webhook/ */ public getWebhook( projectIdOrKey: string, webhookId: string @@ -594,7 +594,7 @@ export default class Backlog extends Request { } /** - * 67: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-webhook/ + * https://developer.nulab.com/docs/backlog/api/2/update-webhook/ */ public patchWebhook( projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams @@ -603,7 +603,7 @@ export default class Backlog extends Request { } /** - * 68: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-webhook/ + * https://developer.nulab.com/docs/backlog/api/2/delete-webhook/ */ public deleteWebhook( projectIdOrKey: string, webhookId: string @@ -612,28 +612,28 @@ export default class Backlog extends Request { } /** - * 69: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-issue-list/ */ public getIssues(params?: Option.Issue.GetIssuesParams): Promise { return this.get('issues', params); } /** - * 70: https://developer.nulab-inc.com/ja/docs/backlog/api/2/count-issue/ + * https://developer.nulab.com/docs/backlog/api/2/count-issue/ */ public getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise { return this.get('issues/count', params); } /** - * 71: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-issue/ + * https://developer.nulab.com/docs/backlog/api/2/add-issue/ */ public postIssue(params: Option.Issue.PostIssueParams): Promise { return this.post('issues', params); } /** - * 73: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-issue/ + * https://developer.nulab.com/docs/backlog/api/2/update-issue/ */ public patchIssue( issueIdOrKey: string, params: Option.Issue.PatchIssueParams @@ -642,7 +642,7 @@ export default class Backlog extends Request { } /** - * 72: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue/ + * https://developer.nulab.com/docs/backlog/api/2/get-issue/ */ public getIssue(issueIdOrKey: string): Promise { return this.get(`issues/${issueIdOrKey}`); @@ -650,14 +650,14 @@ export default class Backlog extends Request { /** - * 74: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-issue/ + * https://developer.nulab.com/docs/backlog/api/2/delete-issue/ */ public deleteIssuesCount(issueIdOrKey: string): Promise { return this.delete(`issues/${issueIdOrKey}`); } /** - * 75: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comment-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-comment-list/ */ public getIssueComments( issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams @@ -666,7 +666,7 @@ export default class Backlog extends Request { } /** - * 76: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-comment/ + * https://developer.nulab.com/docs/backlog/api/2/add-comment/ */ public postIssueComments( issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams @@ -675,14 +675,14 @@ export default class Backlog extends Request { } /** - * 77: https://developer.nulab-inc.com/ja/docs/backlog/api/2/count-comment/ + * https://developer.nulab.com/docs/backlog/api/2/count-comment/ */ public getIssueCommentsCount(issueIdOrKey: string): Promise { return this.get(`issues/${issueIdOrKey}/comments/count`); } /** - * 78: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comment/ + * https://developer.nulab.com/docs/backlog/api/2/get-comment/ */ public getIssueComment(issueIdOrKey: string, commentId: number): Promise { return this.get(`issues/${issueIdOrKey}/comments/${commentId}`); @@ -696,7 +696,7 @@ export default class Backlog extends Request { } /** - * 79: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-comment/ + * https://developer.nulab.com/docs/backlog/api/2/update-comment/ */ public patchIssueComment( issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams @@ -705,7 +705,7 @@ export default class Backlog extends Request { } /** - * 80: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-comment-notifications/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-comment-notifications/ */ public getIssueCommentNotifications( issueIdOrKey: string, commentId: number @@ -714,7 +714,7 @@ export default class Backlog extends Request { } /** - * 81: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-comment-notification/ + * https://developer.nulab.com/docs/backlog/api/2/add-comment-notification/ */ public postIssueCommentNotifications( issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications @@ -723,21 +723,21 @@ export default class Backlog extends Request { } /** - * 82: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-issue-attachments/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-issue-attachments/ */ public getIssueAttachments(issueIdOrKey: string): Promise { return this.get(`issues/${issueIdOrKey}/attachments`); } /** - * 83: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-attachment/ + * https://developer.nulab.com/docs/backlog/api/2/get-issue-attachment/ */ public getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise { return this.download(`issues/${issueIdOrKey}/attachments/${attachmentId}`); } /** - * 84: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-issue-attachment/ + * https://developer.nulab.com/docs/backlog/api/2/delete-issue-attachment/ */ public deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise { return this.delete(`issues/${issueIdOrKey}/attachments/${attachmentId}`); @@ -751,14 +751,14 @@ export default class Backlog extends Request { } /** - * 85: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-linked-shared-files/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-linked-shared-files/ */ public getIssueSharedFiles(issueIdOrKey: string): Promise { return this.get(`issues/${issueIdOrKey}/sharedFiles`); } /** - * 86: https://developer.nulab-inc.com/ja/docs/backlog/api/2/link-shared-files-to-issue/ + * https://developer.nulab.com/docs/backlog/api/2/link-shared-files-to-issue/ */ public linkIssueSharedFiles( issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams @@ -767,49 +767,49 @@ export default class Backlog extends Request { } /** - * 87: https://developer.nulab-inc.com/ja/docs/backlog/api/2/remove-link-to-shared-file-from-issue/ + * https://developer.nulab.com/docs/backlog/api/2/remove-link-to-shared-file-from-issue/ */ public unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise { return this.delete(`issues/${issueIdOrKey}/sharedFiles/${id}`); } /** - * 88: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-list/ */ public getWikis(params: Option.Wiki.GetWikiParams): Promise { return this.get(`wikis`, params); } /** - * 89: https://developer.nulab-inc.com/ja/docs/backlog/api/2/count-wiki-page/ + * https://developer.nulab.com/docs/backlog/api/2/count-wiki-page/ */ public getWikisCount(projectIdOrKey: number): Promise { return this.get(`wikis/count`, { projectIdOrKey }); } /** - * 90: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-tag-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-tag-list/ */ public getWikisTags(projectIdOrKey: number): Promise { return this.get(`wikis/tags`, { projectIdOrKey }); } /** - * 91: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-wiki-page/ + * https://developer.nulab.com/docs/backlog/api/2/add-wiki-page/ */ public postWiki(params: Option.Wiki.PostWikiParams): Promise { return this.post(`wikis`, params); } /** - * 92: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page/ + * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page/ */ public getWiki(wikiId: number): Promise { return this.get(`wikis/${wikiId}`); } /** - * 93: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-wiki-page/ + * https://developer.nulab.com/docs/backlog/api/2/update-wiki-page/ */ public patchWiki( wikiId: number, params: Option.Wiki.PatchWikiParams @@ -818,63 +818,63 @@ export default class Backlog extends Request { } /** - * 94: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-wiki-page/ + * https://developer.nulab.com/docs/backlog/api/2/delete-wiki-page/ */ public deleteWiki(wikiId: number, mailNotify: boolean): Promise { return this.delete(`wikis/${wikiId}`, { mailNotify }); } /** - * 95: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-wiki-attachments/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-wiki-attachments/ */ public getWikisAttachments(wikiId: number): Promise { return this.get(`wikis/${wikiId}/attachments`); } /** - * 96: https://developer.nulab-inc.com/ja/docs/backlog/api/2/attach-file-to-wiki/ + * https://developer.nulab.com/docs/backlog/api/2/attach-file-to-wiki/ */ public postWikisAttachments(wikiId: number, attachmentId: number[]): Promise { return this.post(`wikis/${wikiId}/attachments`, { attachmentId }); } /** - * 97: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-attachment/ + * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-attachment/ */ public getWikiAttachment(wikiId: number, attachmentId: number): Promise { return this.download(`wikis/${wikiId}/attachments/${attachmentId}`); } /** - * 98: https://developer.nulab-inc.com/ja/docs/backlog/api/2/remove-wiki-attachment/ + * https://developer.nulab.com/docs/backlog/api/2/remove-wiki-attachment/ */ public deleteWikisAttachments(wikiId: number, attachmentId: number): Promise { return this.delete(`wikis/${wikiId}/attachments/${attachmentId}`); } /** - * 99: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-shared-files-on-wiki/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-shared-files-on-wiki/ */ public getWikisSharedFiles(wikiId: number): Promise { return this.get(`wikis/${wikiId}/sharedFiles`); } /** - * 100: https://developer.nulab-inc.com/ja/docs/backlog/api/2/link-shared-files-to-wiki/ + * https://developer.nulab.com/docs/backlog/api/2/link-shared-files-to-wiki/ */ public linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise { return this.post(`wikis/${wikiId}/sharedFiles`, { fileId }); } /** - * 101: https://developer.nulab-inc.com/ja/docs/backlog/api/2/remove-link-to-shared-file-from-wiki/ + * https://developer.nulab.com/docs/backlog/api/2/remove-link-to-shared-file-from-wiki/ */ public unlinkWikisSharedFiles(wikiId: number, id: number): Promise { return this.delete(`wikis/${wikiId}/sharedFiles/${id}`); } /** - * 102: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-history/ + * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-history/ */ public getWikisHistory( wikiId: number, params: Option.Wiki.GetWikisHistoryParams @@ -883,21 +883,21 @@ export default class Backlog extends Request { } /** - * 103: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-star/ + * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-star/ */ public getWikisStars(wikiId: number): Promise { return this.get(`wikis/${wikiId}/stars`); } /** - * 104: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-star/ + * https://developer.nulab.com/docs/backlog/api/2/add-star/ */ public postStar(params: Option.Project.PostStarParams): Promise { return this.post('stars', params); } /** - * 105: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-notification/ + * https://developer.nulab.com/docs/backlog/api/2/get-notification/ */ public getNotifications( params: Option.Notification.GetNotificationsParams @@ -906,7 +906,7 @@ export default class Backlog extends Request { } /** - * 106: https://developer.nulab-inc.com/ja/docs/backlog/api/2/count-notification/ + * https://developer.nulab.com/docs/backlog/api/2/count-notification/ */ public getNotificationsCount( params: Option.Notification.GetNotificationsCountParams @@ -915,28 +915,28 @@ export default class Backlog extends Request { } /** - * 107: https://developer.nulab-inc.com/ja/docs/backlog/api/2/reset-unread-notification-count/ + * https://developer.nulab.com/docs/backlog/api/2/reset-unread-notification-count/ */ public resetNotificationsMarkAsRead(): Promise { return this.post('notifications/markAsRead'); } /** - * 108: https://developer.nulab-inc.com/ja/docs/backlog/api/2/read-notification/ + * https://developer.nulab.com/docs/backlog/api/2/read-notification/ */ public markAsReadNotification(id: number): Promise { return this.post(`notifications/${id}/markAsRead`); } /** - * 109: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-git-repositories/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-git-repositories/ */ public getGitRepositories(projectIdOrKey: string): Promise { return this.get(`projects/${projectIdOrKey}/git/repositories`); } /** - * 110: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-git-repository/ + * https://developer.nulab.com/docs/backlog/api/2/get-git-repository/ */ public getGitRepository( projectIdOrKey: string, repoIdOrName: string @@ -945,7 +945,7 @@ export default class Backlog extends Request { } /** - * 111: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-pull-request-list/ + * https://developer.nulab.com/docs/backlog/api/2/get-pull-request-list/ */ public getPullRequests( projectIdOrKey: string, @@ -956,7 +956,7 @@ export default class Backlog extends Request { } /** - * 112: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-number-of-pull-requests/ + * https://developer.nulab.com/docs/backlog/api/2/get-number-of-pull-requests/ */ public getPullRequestsCount( projectIdOrKey: string, @@ -967,7 +967,7 @@ export default class Backlog extends Request { } /** - * 113: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-pull-request/ + * https://developer.nulab.com/docs/backlog/api/2/add-pull-request/ */ public postPullRequest( projectIdOrKey: string, @@ -978,7 +978,7 @@ export default class Backlog extends Request { } /** - * 114: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-pull-request/ + * https://developer.nulab.com/docs/backlog/api/2/get-pull-request/ */ public getPullRequest( projectIdOrKey: string, repoIdOrName: string, number: number @@ -987,7 +987,7 @@ export default class Backlog extends Request { } /** - * 115: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-pull-request/ + * https://developer.nulab.com/docs/backlog/api/2/update-pull-request/ */ public patchPullRequest( projectIdOrKey: string, @@ -999,7 +999,7 @@ export default class Backlog extends Request { } /** - * 116: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-pull-request-comment/ + * https://developer.nulab.com/docs/backlog/api/2/get-pull-request-comment/ */ public getPullRequestComments( projectIdOrKey: string, @@ -1011,7 +1011,7 @@ export default class Backlog extends Request { } /** - * 117: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-pull-request-comment/ + * https://developer.nulab.com/docs/backlog/api/2/add-pull-request-comment/ */ public postPullRequestComments( projectIdOrKey: string, @@ -1023,7 +1023,7 @@ export default class Backlog extends Request { } /** - * 118: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-number-of-pull-request-comments/ + * https://developer.nulab.com/docs/backlog/api/2/get-number-of-pull-request-comments/ */ public getPullRequestCommentsCount( projectIdOrKey: string, repoIdOrName: string, number: number @@ -1032,7 +1032,7 @@ export default class Backlog extends Request { } /** - * 119: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-pull-request-comment-information/ + * https://developer.nulab.com/docs/backlog/api/2/update-pull-request-comment-information/ */ public patchPullRequestComments( projectIdOrKey: string, @@ -1045,7 +1045,7 @@ export default class Backlog extends Request { } /** - * 120: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-list-of-pull-request-attachment/ + * https://developer.nulab.com/docs/backlog/api/2/get-list-of-pull-request-attachment/ */ public getPullRequestAttachments( projectIdOrKey: string, repoIdOrName: string, number: number @@ -1054,7 +1054,7 @@ export default class Backlog extends Request { } /** - * 121: https://developer.nulab-inc.com/ja/docs/backlog/api/2/download-pull-request-attachment/ + * https://developer.nulab.com/docs/backlog/api/2/download-pull-request-attachment/ */ public getPullRequestAttachment( projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number @@ -1063,7 +1063,7 @@ export default class Backlog extends Request { } /** - * 122: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-pull-request-attachments/ + * https://developer.nulab.com/docs/backlog/api/2/delete-pull-request-attachments/ */ public deletePullRequestAttachment( projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number @@ -1072,56 +1072,56 @@ export default class Backlog extends Request { } /** - * 123: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-watching-list + * https://developer.nulab.com/docs/backlog/api/2/get-watching-list */ public getWatchingListItems(userId: number): Promise { return this.get(`users/${userId}/watchings`); } /** - * 124: https://developer.nulab-inc.com/ja/docs/backlog/api/2/count-watching + * https://developer.nulab.com/docs/backlog/api/2/count-watching */ public getWatchingListCount(userId: number): Promise { return this.get(`users/${userId}/watchings/count`); } /** - * 125: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-watching + * https://developer.nulab.com/docs/backlog/api/2/get-watching */ public getWatchingListItem(watchId: number): Promise { return this.get(`watchings/${watchId}`); } /** - * 126: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-watching + * https://developer.nulab.com/docs/backlog/api/2/add-watching */ public postWatchingListItem(params: any) { return this.post(`watchings`, params); } /** - * 127: https://developer.nulab-inc.com/ja/docs/backlog/api/2/update-watching + * https://developer.nulab.com/docs/backlog/api/2/update-watching */ public patchWatchingListItem(watchId: number, note: string): Promise { return this.patch(`watchings/${watchId}`, { note }); } /** - * 128: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-watching + * https://developer.nulab.com/docs/backlog/api/2/delete-watching */ public deletehWatchingListItem(watchId: number) { return this.delete(`watchings/${watchId}`); } /** - * 129: https://developer.nulab-inc.com/ja/docs/backlog/api/2/mark-watching-as-read + * https://developer.nulab.com/docs/backlog/api/2/mark-watching-as-read */ public resetWatchingListItemAsRead(watchId: number): Promise { return this.post(`watchings/${watchId}/markAsRead`); } /** - * 130: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-group-list + * https://developer.nulab.com/docs/backlog/api/2/get-project-group-list */ public getProjectGroupList(projectIdOrKey: string|number) { console.warn("Deprecated: Use getProjectTeams instead."); @@ -1129,7 +1129,7 @@ export default class Backlog extends Request { } /** - * 131: https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-project-group + * https://developer.nulab.com/docs/backlog/api/2/add-project-group */ public postProjectGroup(projectIdOrKey: string|number, params: any) { console.warn("Deprecated: Use postProjectTeam instead."); @@ -1137,7 +1137,7 @@ export default class Backlog extends Request { } /** - * 132: https://developer.nulab-inc.com/ja/docs/backlog/api/2/delete-project-group + * https://developer.nulab.com/docs/backlog/api/2/delete-project-group */ public deleteProjectGroup(projectIdOrKey: string|number) { console.warn("Deprecated: Use deleteProjectTeam instead."); @@ -1145,7 +1145,7 @@ export default class Backlog extends Request { } /** - * 133: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-group-icon + * https://developer.nulab.com/docs/backlog/api/2/get-group-icon */ public getGroupIcon(groupId: string): Promise { console.warn("Deprecated: Use getTeamIcon instead."); @@ -1153,7 +1153,7 @@ export default class Backlog extends Request { } /** - * 134: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-licence + * https://developer.nulab.com/docs/backlog/api/2/get-licence */ public getLicence(): Promise { return this.get(`space/licence`); From 7e299710bef002f3c7d4c14ace539d5542b174ad Mon Sep 17 00:00:00 2001 From: Makoto Motohashi Date: Thu, 7 Jan 2021 17:41:37 +0900 Subject: [PATCH 4/4] add declarations --- dist/backlog.d.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dist/backlog.d.ts b/dist/backlog.d.ts index 8f89452..6a06144 100644 --- a/dist/backlog.d.ts +++ b/dist/backlog.d.ts @@ -63,6 +63,7 @@ declare module 'backlog-js' { patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise; deleteGroup(groupId: number): Promise; getStatuses(): Promise; + getProjectStatuses(projectIdOrKey: string): Promise; getResolutions(): Promise; getPriorities(): Promise; getProjects(params?: Option.Project.GetProjectsParams): Promise; @@ -78,6 +79,10 @@ declare module 'backlog-js' { postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise; getProjectAdministrators(projectIdOrKey: string): Promise; deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise; + postProjectStatus(projectIdOrKey: string, params: Option.Project.PostStatusParams): Promise; + patchProjectStatus(projectIdOrKey: string, id: number, params: Option.Project.PatchStatusParams): Promise; + deleteProjectStatus(projectIdOrKey: string, id: number, substituteStatusId: number): Promise; + patchProjectStatusOrder(projectIdOrKey: string, statusId: number[]): Promise; getIssueTypes(projectIdOrKey: string): Promise; postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise; patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise; @@ -115,12 +120,14 @@ declare module 'backlog-js' { postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise; getIssueCommentsCount(issueIdOrKey: string): Promise; getIssueComment(issueIdOrKey: string, commentId: number): Promise; + deleteIssueComment(issueIdOrKey: string, commentId: number): Promise; patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise; getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise; postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise; getIssueAttachments(issueIdOrKey: string): Promise; getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise; deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise; + getIssueParticipants(issueIdOrKey: string): Promise; getIssueSharedFiles(issueIdOrKey: string): Promise; linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise; unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise; @@ -171,6 +178,15 @@ declare module 'backlog-js' { deleteProjectGroup(projectIdOrKey: string|number); getGroupIcon(groupId: string): Promise; getLicence(): Promise; + getTeams(params?: Option.Team.GetTeamsParams): Promise; + postTeam(members: number[]): Promise; + getTeam(teamId: number): Promise; + patchTeam(teamId: number, params: Option.Team.PatchTeamParams): Promise; + deleteTeam(teamId: number): Promise; + getTeamIcon(teamId: number): Promise; + getProjectTeams(projectIdOrKey: string): Promise; + postProjectTeam(projectIdOrKey: string, teamId: number): Promise; + deleteProjectTeam(projectIdOrKey: string, teamId: number): Promise; private download; private upload; private parseFileData; @@ -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 { @@ -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 {