Skip to content

Commit f1625aa

Browse files
authored
Merge pull request #21 from hackmdio:develop
2.1.0
2 parents 20a65d3 + 23ba43c commit f1625aa

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

nodejs/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hackmd/api",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "HackMD Node.js API Client",
55
"main": "dist/index.js",
66
"declaration": "./dist/index.d.ts",

nodejs/src/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export default class API {
8282
await this.axios.patch<AxiosResponse>(`notes/${noteId}`, { content })
8383
}
8484

85+
async updateNote (noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission'>): Promise<AxiosResponse> {
86+
return await this.axios.patch<AxiosResponse>(`notes/${noteId}`, options)
87+
}
88+
8589
async deleteNote (noteId: string): Promise<DeleteUserNote> {
8690
await this.axios.delete<AxiosResponse>(`notes/${noteId}`)
8791
}
@@ -105,6 +109,10 @@ export default class API {
105109
await this.axios.patch<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`, { content })
106110
}
107111

112+
async updateTeamNote (teamPath: string, noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission'>): Promise<AxiosResponse> {
113+
return await this.axios.patch<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`, options)
114+
}
115+
108116
async deleteTeamNote (teamPath: string, noteId: string): Promise<DeleteTeamNote> {
109117
await this.axios.delete<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`)
110118
}

0 commit comments

Comments
 (0)