Skip to content

List note #11

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

Merged
merged 3 commits into from
Jul 27, 2021
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
2 changes: 1 addition & 1 deletion 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": "1.1.1",
"version": "1.2.0",
"description": "HackMD/CodiMD Node.js API Client",
"main": "dist/index.js",
"declaration": "./dist/index.d.ts",
Expand Down
19 changes: 19 additions & 0 deletions nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,25 @@ class API {
throw new Error('Create note failed')
}
}

async listNotes () {
// https://hackmd.io/api/overview?v=1627369059523
if (this.enterprise) {
const response = await this.fetch(url.resolve(this.serverUrl, 'api/overview'), this.defaultFetchOptions)

return response.json()
} else {
throw new Error('Not support')
}
}

async listTeamNotes (teamPath: string) {
if (this.enterprise) {
return this.fetch(url.resolve(this.serverUrl, `api/overview/team/${teamPath}`), this.defaultFetchOptions).then(res => res.json())
} else {
throw new Error('Not support')
}
}

private async exportRes(noteId: string, type: ExportType) {
let res: Response
Expand Down
329 changes: 0 additions & 329 deletions nodejs/yarn.lock

This file was deleted.