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

v2.0.0 #18

Merged
merged 28 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a4fdf54
feat: add getMe api
Feb 8, 2022
ef893c2
feat: add list, create, update, delete notes and history APIs
Feb 9, 2022
3c0a7fd
refactor: set endpoint url and accesstoken as instance variables
Feb 10, 2022
3cb69c1
feat: handle axios response error in interceptor
Feb 11, 2022
4cf20b5
fix: internal server error handler typing
Feb 11, 2022
226a9a7
refactor: remove useless packages and files
Feb 14, 2022
ec4cc4b
refactor: set end point URL's default value
Feb 18, 2022
7a5949e
feat: add linter
Feb 18, 2022
3fbb770
add operators and keywords spacing linter
Feb 18, 2022
fe80a68
refactor: change arrow function of inner class method into regular fu…
Feb 18, 2022
dccab72
fix: add default class for API client
Feb 22, 2022
f6ed726
refactor: change interface to type style and add typing on api function
Feb 23, 2022
bfd2bf1
fix: turn on eol rule from linter
Feb 23, 2022
0575d75
fix: bump tslib and hackmd client version
Feb 23, 2022
91ec982
fix: add EOL
Feb 23, 2022
9f464a4
Update version to 2.0.0-pre1
Feb 23, 2022
40638b3
Merge pull request #16 from hackmdio/feature/sc-2187-v1-api-client-re…
Yukaii Feb 24, 2022
1502895
chore: update description, License and author in package.json
Yukaii Feb 25, 2022
c92b9d7
docs: update README
Yukaii Feb 25, 2022
ffda997
Merge pull request #17 from hackmdio/docs/README
Yukaii Feb 25, 2022
e31b1eb
style: ignore eslintrc to eslint itself
Yukaii Feb 25, 2022
1253b4f
docs: add v2 update note
Yukaii Mar 1, 2022
09356fa
chore: bump version to 2.0.0-pre.0
Yukaii Mar 1, 2022
84a55ad
chore: move typescript eslint to dev deps
Yukaii Mar 1, 2022
22622b4
chore: bump to 2.0.0-pre.1
Yukaii Mar 1, 2022
860caba
chore: remove path dep
Yukaii Mar 1, 2022
e114194
chore: bump version 2.0.0-pre.2
Yukaii Mar 1, 2022
5f9cdb1
2.0.0
Yukaii Mar 2, 2022
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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# HackMD API Clients

This repository contains a set of packages for interacting with the [HackMD API](https://hackmd.io/).

## Node.JS

See [README](./nodejs)
Expand Down
26 changes: 26 additions & 0 deletions nodejs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path')

module.exports = {
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"no-trailing-spaces": ["warn", { "skipBlankLines": false }],
"semi": ["warn", "never"],
"@typescript-eslint/no-non-null-assertion": "off",
"keyword-spacing": ["warn", {"before": true, "after": true}],
"space-infix-ops": "warn",
"space-before-function-paren": "warn",
"eol-last": ["error", "always"]
},
"parserOptions": {
"project": [
path.resolve(__dirname, "tsconfig.json")
]
},
"ignorePatterns": [
".eslintrc.js"
],
}
34 changes: 32 additions & 2 deletions nodejs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
# HackMD Node.js API Client

![npm](https://img.shields.io/npm/v/@hackmd/api)

## About

This is a Node.js client for the [HackMD API](https://hackmd.io/).

You can sign up for an account at [hackmd.io](https://hackmd.io/), and then create access tokens for your projects by following the [HackMD API documentation](https://hackmd.io/@hackmd-api/developer-portal).

For bugs and feature requests, please open an issue or pull request on [GitHub](https://github.com/hackmdio/api-client).

## **v2.0.0 Update Note**

`v2.0.0` is a completely rewrite and is incompatible with `v1.x.x`. But the best of all, it does not require Node.JS runtime anymore, which means you can use it in a browser. We recommend you to upgrade to `v2.0.0` if you are using the old one.

## Installation

```bash
npm install @hackmd/api --save
```

## Usage
## Example

```javascript
import HackMDAPI from '@hackmd/api'

const client = new HackMDAPI('YOUR_ACCESS_TOKEN' /* required */, 'https://api.hackmd.io/v1' /* optional */)

client.getMe().then(me => {
console.log(me.email)
})
```

## API

See the [code](./src/index.ts) and [typings](./src/type.ts). The API client is written in TypeScript, so you can get auto-completion and type checking in any TypeScript Language Server powered editor or IDE.

## License

TODO
MIT
Loading