Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.2.0 #23

Merged
merged 4 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hackmd/api",
"version": "2.1.0",
"version": "2.2.0",
"description": "HackMD Node.js API Client",
"main": "dist/index.js",
"declaration": "./dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class API {
await this.axios.patch<AxiosResponse>(`notes/${noteId}`, { content })
}

async updateNote (noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission'>): Promise<AxiosResponse> {
async updateNote (noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission' | 'permalink'>): Promise<AxiosResponse> {
return await this.axios.patch<AxiosResponse>(`notes/${noteId}`, options)
}

Expand All @@ -109,7 +109,7 @@ export default class API {
await this.axios.patch<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`, { content })
}

async updateTeamNote (teamPath: string, noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission'>): Promise<AxiosResponse> {
async updateTeamNote (teamPath: string, noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission' | 'permalink'>): Promise<AxiosResponse> {
return await this.axios.patch<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`, options)
}

Expand Down
5 changes: 3 additions & 2 deletions nodejs/src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export type CreateNoteOptions = {
content?: string
readPermission?: NotePermissionRole,
writePermission?: NotePermissionRole,
commentPermission?: CommentPermissionType
commentPermission?: CommentPermissionType,
permalink?: string
}

export type Team = {
Expand Down Expand Up @@ -74,10 +75,10 @@ export type Note = {
teamPath: string | null
permalink: string | null
shortId: string
publishLink: string

readPermission: NotePermissionRole
writePermission: NotePermissionRole

}

export type SingleNote = Note & {
Expand Down