From ae317b7a7406c6bb6f54f720c614eba8b9f32d2a Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Mon, 22 Aug 2022 14:01:48 +0800 Subject: [PATCH 1/3] feat: support permalink in create/update note --- nodejs/src/index.ts | 4 ++-- nodejs/src/type.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index 421767c..5715e55 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -82,7 +82,7 @@ export default class API { await this.axios.patch(`notes/${noteId}`, { content }) } - async updateNote (noteId: string, options: Pick): Promise { + async updateNote (noteId: string, options: Pick): Promise { return await this.axios.patch(`notes/${noteId}`, options) } @@ -109,7 +109,7 @@ export default class API { await this.axios.patch(`teams/${teamPath}/notes/${noteId}`, { content }) } - async updateTeamNote (teamPath: string, noteId: string, options: Pick): Promise { + async updateTeamNote (teamPath: string, noteId: string, options: Pick): Promise { return await this.axios.patch(`teams/${teamPath}/notes/${noteId}`, options) } diff --git a/nodejs/src/type.ts b/nodejs/src/type.ts index 8d148be..e4d1c49 100644 --- a/nodejs/src/type.ts +++ b/nodejs/src/type.ts @@ -23,7 +23,8 @@ export type CreateNoteOptions = { content?: string readPermission?: NotePermissionRole, writePermission?: NotePermissionRole, - commentPermission?: CommentPermissionType + commentPermission?: CommentPermissionType, + permalink?: string } export type Team = { From d48356d3845404d5a98618ac35eaa4629ace793d Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Mon, 22 Aug 2022 14:02:04 +0800 Subject: [PATCH 2/3] feat: add publishLink field to note model --- nodejs/src/type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/src/type.ts b/nodejs/src/type.ts index e4d1c49..766b292 100644 --- a/nodejs/src/type.ts +++ b/nodejs/src/type.ts @@ -75,10 +75,10 @@ export type Note = { teamPath: string | null permalink: string | null shortId: string + publishLink: string readPermission: NotePermissionRole writePermission: NotePermissionRole - } export type SingleNote = Note & { From 9c682e6958dbcef9231faf0fb0f5d7340811f1a8 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Mon, 22 Aug 2022 14:05:30 +0800 Subject: [PATCH 3/3] chore: bump package.json version to 2.2.0 --- nodejs/package-lock.json | 4 ++-- nodejs/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 4521dd4..558eaaa 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hackmd/api", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hackmd/api", - "version": "2.1.0", + "version": "2.2.0", "license": "MIT", "dependencies": { "axios": "^0.25.0", diff --git a/nodejs/package.json b/nodejs/package.json index bfcf203..946c850 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -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",