From 633353e312caa472401951e7fd2ea2a4b822878b Mon Sep 17 00:00:00 2001 From: toshimaru Date: Wed, 26 Aug 2020 13:48:55 +0900 Subject: [PATCH 1/5] Bump typescript to v2.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e164aa1..dd8b20a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "nock": "^8.0.0", "power-assert": "^1.4.1", "qs": "^6.2.1", - "typescript": "^1.8.10", + "typescript": "^2.9.2", "uglify-js": "^2.6.2" }, "keywords": [ From dbb1a1de4de609ba922a98ffcac61850f7849016 Mon Sep 17 00:00:00 2001 From: toshimaru Date: Wed, 26 Aug 2020 13:49:32 +0900 Subject: [PATCH 2/5] Use `@types/isomorphic-fetch` instead of typings --- package.json | 1 + typings.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd8b20a..30bc8f2 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "author": "vvatanabe", "license": "MIT", "devDependencies": { + "@types/isomorphic-fetch": "0.0.35", "browserify": "^13.0.1", "coveralls": "^2.11.9", "dotenv": "^2.0.0", diff --git a/typings.json b/typings.json index bdd0a19..c9b86c0 100644 --- a/typings.json +++ b/typings.json @@ -2,7 +2,6 @@ "globalDependencies": { "dotenv": "registry:dt/dotenv#2.0.0+20160327131627", "empower": "registry:dt/empower#0.0.0+20160317120654", - "isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160524142046", "mocha": "registry:dt/mocha#2.2.5+20160317120654", "nock": "registry:dt/nock#0.54.0+20160613160405", "node": "registry:dt/node#6.0.0+20160613154055", From 8a73fe5349f743bde214fe79f4afc85d38fab0be Mon Sep 17 00:00:00 2001 From: toshimaru Date: Wed, 26 Aug 2020 13:50:01 +0900 Subject: [PATCH 3/5] Use Response instead of IResponse --- src/backlog.ts | 4 ++-- src/error.ts | 12 ++++++------ src/request.ts | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/backlog.ts b/src/backlog.ts index a154e70..f68a597 100644 --- a/src/backlog.ts +++ b/src/backlog.ts @@ -643,11 +643,11 @@ export default class Backlog extends Request { return this.request({ method: 'GET', path }).then(this.parseFileData); } - private upload(path: string, params: FormData): Promise { + private upload(path: string, params: FormData): Promise { return this.request({ method: 'POST', path, params }).then(this.parseJSON); } - private parseFileData(response: IResponse): Promise { + private parseFileData(response: Response): Promise { return new Promise((resolve, reject) => { if (typeof window !== 'undefined') { resolve({ diff --git a/src/error.ts b/src/error.ts index ba5d229..275c842 100644 --- a/src/error.ts +++ b/src/error.ts @@ -4,10 +4,10 @@ export class BacklogError extends global.Error { private _url: string; private _status: number; private _body: { errors: BacklogErrorMessage[] }; - private _response: IResponse; + private _response: Response; constructor( name: BacklogErrorNameType, - response: IResponse, + response: Response, body?: { errors: BacklogErrorMessage[] } ) { super(response.statusText); @@ -29,14 +29,14 @@ export class BacklogError extends global.Error { get body(): { errors: BacklogErrorMessage[] } { return this._body; } - get response(): IResponse { + get response(): Response { return this._response; } } export class BacklogApiError extends BacklogError { constructor( - response: IResponse, + response: Response, body?: { errors: BacklogErrorMessage[] } ) { super('BacklogApiError', response, body); @@ -45,7 +45,7 @@ export class BacklogApiError extends BacklogError { export class BacklogAuthError extends BacklogError { constructor( - response: IResponse, + response: Response, body?: { errors: BacklogErrorMessage[] } ) { super('BacklogAuthError', response, body); @@ -54,7 +54,7 @@ export class BacklogAuthError extends BacklogError { export class UnexpectedError extends BacklogError { constructor( - response: IResponse + response: Response ) { super('UnexpectedError', response); } diff --git a/src/request.ts b/src/request.ts index 70dd7de..8f69db5 100644 --- a/src/request.ts +++ b/src/request.ts @@ -30,7 +30,7 @@ export default class Request { method: string, path: string, params?: Params | FormData - }): Promise { + }): Promise { const { method, path, params = {} } = options; const { apiKey, accessToken, timeout } = this.configure; const query: Params = apiKey ? { apiKey: apiKey } : {}; @@ -59,7 +59,7 @@ export default class Request { return fetch(url, init).then(this.checkStatus); } - public checkStatus(response: IResponse): Promise { + public checkStatus(response: Response): Promise { return new Promise((resolve, reject) => { if (200 <= response.status && response.status < 300) { resolve(response); @@ -75,7 +75,7 @@ export default class Request { }); } - public parseJSON(response: IResponse): Promise { + public parseJSON(response: Response): Promise { return response.json(); } From d61a6542e5c24e734c87f4de5e57426ffe0c9a9a Mon Sep 17 00:00:00 2001 From: toshimaru Date: Thu, 27 Aug 2020 09:49:30 +0900 Subject: [PATCH 4/5] npm run build --- dist/backlog.js | 97 ++++++++++++++++++++++++++------------------- dist/backlog.min.js | 2 +- 2 files changed, 57 insertions(+), 42 deletions(-) diff --git a/dist/backlog.js b/dist/backlog.js index 7c3cae1..19441b9 100644 --- a/dist/backlog.js +++ b/dist/backlog.js @@ -1,15 +1,21 @@ (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;i 0 ? "?" + qs : ''); + var url = this.restBaseURL + "/" + path + (qs.length > 0 ? "?" + qs : ''); return fetch(url, init).then(this.checkStatus); }; Request.prototype.checkStatus = function (response) { @@ -719,7 +735,6 @@ var Request = (function () { }); return Request; }()); -Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Request; },{"./error":3}]},{},[4])(4) diff --git a/dist/backlog.min.js b/dist/backlog.min.js index 95628f5..5cf721f 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}();Object.defineProperty(exports,"__esModule",{value:true});exports.default=OAuth2},{"./request":7}],6:[function(require,module,exports){"use strict";(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"})(exports.ActivityType||(exports.ActivityType={}));var ActivityType=exports.ActivityType;var User;(function(User){(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"})(User.RoleType||(User.RoleType={}));var RoleType=User.RoleType})(User=exports.User||(exports.User={}));var Project;(function(Project){(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"})(Project.FieldType||(Project.FieldType={}));var FieldType=Project.FieldType})(Project=exports.Project||(exports.Project={}));var Issue;(function(Issue){(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"})(Issue.ParentChildType||(Issue.ParentChildType={}));var ParentChildType=Issue.ParentChildType})(Issue=exports.Issue||(exports.Issue={}))},{}],7:[function(require,module,exports){"use strict";var Error=require("./error");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 qs=this.toQueryString(query);var url=this.restBaseURL+"/"+path+(qs.length>0?"?"+qs:"");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 Object.keys(params).reduce(function(result,key){var value=params[key];if(!value){return result}if(Array.isArray(value)){value.forEach(function(v){return result.push(key+"[]="+v)})}else{result.push(key+"="+value)}return result},[]).join("&")};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}();Object.defineProperty(exports,"__esModule",{value:true});exports.default=Request},{"./error":3}]},{},[4])(4)}); \ No newline at end of file +(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 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 qs=this.toQueryString(query);var url=this.restBaseURL+"/"+path+(qs.length>0?"?"+qs:"");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 Object.keys(params).reduce(function(result,key){var value=params[key];if(!value){return result}if(Array.isArray(value)){value.forEach(function(v){return result.push(key+"[]="+v)})}else{result.push(key+"="+value)}return result},[]).join("&")};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}]},{},[4])(4)}); \ No newline at end of file From eeb1c38b47a31651f7b2862709d34aad8a80d246 Mon Sep 17 00:00:00 2001 From: toshimaru Date: Thu, 27 Aug 2020 10:09:29 +0900 Subject: [PATCH 5/5] Update dist/backlog.d.ts --- dist/backlog.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/backlog.d.ts b/dist/backlog.d.ts index aa3942a..2c0adf9 100644 --- a/dist/backlog.d.ts +++ b/dist/backlog.d.ts @@ -17,9 +17,9 @@ declare module 'backlog-js' { method: string; path: string; params?: Params | FormData; - }): Promise; - checkStatus(response: IResponse): Promise; - parseJSON(response: IResponse): Promise; + }): Promise; + checkStatus(response: Response): Promise; + parseJSON(response: Response): Promise; private toFormData(params); private toQueryString(params); webAppBaseURL: string; @@ -43,7 +43,7 @@ declare module 'backlog-js' { putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise; getSpaceDiskUsage(): Promise; getSpaceIcon(): Promise; - postSpaceAttachment(form: FormData): Promise; + postSpaceAttachment(form: FormData): Promise; getUsers(): Promise; getUser(userId: number): Promise; postUser(params: Option.User.PostUserParams): Promise; @@ -158,9 +158,9 @@ declare module 'backlog-js' { getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise; getWikiAttachment(wikiId: number, attachmentId: number): Promise; getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise; - private download(path); - private upload(path, params); - private parseFileData(response); + private download; + private upload; + private parseFileData; } export class OAuth2 { @@ -650,7 +650,7 @@ declare module 'backlog-js' { private _status; private _body; private _response; - constructor(name: BacklogErrorNameType, response: IResponse, body?: { + constructor(name: BacklogErrorNameType, response: Response, body?: { errors: BacklogErrorMessage[]; }); name: BacklogErrorNameType; @@ -659,20 +659,20 @@ declare module 'backlog-js' { body: { errors: BacklogErrorMessage[]; }; - response: IResponse; + response: Response; } export class BacklogApiError extends BacklogError { - constructor(response: IResponse, body?: { + constructor(response: Response, body?: { errors: BacklogErrorMessage[]; }); } export class BacklogAuthError extends BacklogError { - constructor(response: IResponse, body?: { + constructor(response: Response, body?: { errors: BacklogErrorMessage[]; }); } export class UnexpectedError extends BacklogError { - constructor(response: IResponse); + constructor(response: Response); } export interface BacklogErrorMessage { message: string;