Skip to content

Commit 12f6126

Browse files
committed
Add list api
1 parent 1f31f3f commit 12f6126

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

nodejs/src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,25 @@ class API {
156156
throw new Error('Create note failed')
157157
}
158158
}
159+
160+
async listNotes () {
161+
// https://hackmd.io/api/overview?v=1627369059523
162+
if (this.enterprise) {
163+
const response = await this.fetch(url.resolve(this.serverUrl, 'api/overview'), this.defaultFetchOptions)
164+
165+
return response.json()
166+
} else {
167+
throw new Error('Not support')
168+
}
169+
}
170+
171+
async listTeamNotes (teamPath: string) {
172+
if (this.enterprise) {
173+
return this.fetch(url.resolve(this.serverUrl, `api/overview/team/${teamPath}`), this.defaultFetchOptions).then(res => res.json())
174+
} else {
175+
throw new Error('Not support')
176+
}
177+
}
159178

160179
private async exportRes(noteId: string, type: ExportType) {
161180
let res: Response

0 commit comments

Comments
 (0)