diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 878b26e..4521dd4 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hackmd/api", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hackmd/api", - "version": "2.0.0", + "version": "2.1.0", "license": "MIT", "dependencies": { "axios": "^0.25.0", diff --git a/nodejs/package.json b/nodejs/package.json index 41777b6..bfcf203 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@hackmd/api", - "version": "2.0.0", + "version": "2.1.0", "description": "HackMD Node.js API Client", "main": "dist/index.js", "declaration": "./dist/index.d.ts", diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index debf1c8..421767c 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -82,6 +82,10 @@ export default class API { await this.axios.patch(`notes/${noteId}`, { content }) } + async updateNote (noteId: string, options: Pick): Promise { + return await this.axios.patch(`notes/${noteId}`, options) + } + async deleteNote (noteId: string): Promise { await this.axios.delete(`notes/${noteId}`) } @@ -105,6 +109,10 @@ export default class API { await this.axios.patch(`teams/${teamPath}/notes/${noteId}`, { content }) } + async updateTeamNote (teamPath: string, noteId: string, options: Pick): Promise { + return await this.axios.patch(`teams/${teamPath}/notes/${noteId}`, options) + } + async deleteTeamNote (teamPath: string, noteId: string): Promise { await this.axios.delete(`teams/${teamPath}/notes/${noteId}`) }