Skip to content

Commit

Permalink
docs: add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
younho9 committed Nov 20, 2021
1 parent 9b9cfb4 commit 6282501
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License Copyright (c) 2021 Younho Choo

Permission is hereby granted, free of
charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice
(including the next paragraph) shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# @narkdown/client

> Get unlimited response of Notion API
[![Version: v0.3.1](https://img.shields.io/badge/Version-v0.3.1-green)](https://github.com/narkdown/client/releases/tag/v0.3.1)
[![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)

## Why?

This is an extension of the [`@notionhq/client`](https://github.com/makenotion/notion-sdk-js) to obtain total results for the [Paginated endpoints](https://developers.notion.com/reference/pagination#paginated-endpoints) of the Notion API.

The goal is to obtain a total results using the same interface as the Notion API.

## Install

```
$ npm install @narkdown/client
```

## Usage

```javascript
const {NarkdownClient} = require('@narkdown/client');

// Initializing a client
const narkdown = new NarkdownClient({
auth: process.env.NOTION_TOKEN,
});
```

## API

> It extends [@notionhq/client](https://github.com/makenotion/notion-sdk-js)
>
> See the complete list of endpoints in the [Notion API reference](https://developers.notion.com/reference)
### `unlimited.databases.queryAll`

> Unlimited version of [Query a database](https://developers.notion.com/reference/post-database-query)
```javascript
const {NarkdownClient} = require('@narkdown/client');

const narkdown = new NarkdownClient({auth: process.env.NOTION_API_KEY});

(async () => {
const databaseId = '897e5a76-ae52-4b48-9fdf-e71f5945d1af';
const response = await narkdown.unlimited.databases.queryAll({
database_id: databaseId,
filter: {
or: [
{
property: 'In stock',
checkbox: {
equals: true,
},
},
{
property: 'Cost of next trip',
number: {
greater_than_or_equal_to: 2,
},
},
],
},
sorts: [
{
property: 'Last ordered',
direction: 'ascending',
},
],
});
console.log(response);
})();
```

## Related

- [makenotion/notion-sdk-js](https://github.com/makenotion/notion-sdk-js)

## License

[MIT](LICENSE)

0 comments on commit 6282501

Please sign in to comment.