Skip to content

Commit 706e9b3

Browse files
authored
Merge pull request #10 from jonathangomz/v1.2.0
* Implement new endpoints * Update page: https://developers.notion.com/reference/patch-page#archive-delete-a-page * Create database: https://developers.notion.com/reference/create-a-database * Add `Page` support for responses * Add more colors for Text * Add list of endpoints implemented on package * Improve coverage
2 parents af3d8e4 + 63b2de1 commit 706e9b3

23 files changed

Lines changed: 975 additions & 88 deletions

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Changelog
22
## v0.0.1-prealpha1
33
> Release date: 20/May/2021
4-
54
* First version
65
* Add `page` requests parameters models
76
* Add notion api endpoints: `pages`
@@ -105,4 +104,14 @@
105104
* Remove `add(Text text)` function
106105
* Remove `texts` getter for `Paragraph`
107106
* Remove named parameters for `Children` class
108-
* Update documentation
107+
* Update documentation
108+
109+
## v1.2.0:
110+
> Release date: 27/Jul/2021
111+
* Implement new endpoints
112+
* Update page: https://developers.notion.com/reference/patch-page#archive-delete-a-page
113+
* Create database: https://developers.notion.com/reference/create-a-database
114+
* Add `Page` support for responses
115+
* Add more colors for Text
116+
* Add list of endpoints implemented on package
117+
* Improve coverage

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,38 @@ Notion API client for dart.
55

66
See the [ROADMAP](ROADMAP.md) file to see what is coming next.
77

8+
- [API implemented](#api-implemented)
89
- [Usage](#usage)
910
- [`NotionClient` class](#notionclient-class)
1011
- [Individual classes](#individual-classes)
1112
- [A few examples](#a-few-examples)
1213
- [Append blocks children](#append-blocks-children)
1314
- [Create a page](#create-a-page)
15+
- [Errors](#errors)
16+
- [Create page with chidren](#create-page-with-chidren)
1417
- [Contributions](#contributions)
1518
- [Rules](#rules)
1619
- [Tests](#tests)
1720
- [Example:](#example)
1821
- [Next release](#next-release)
22+
- [v1.2.1:](#v121)
23+
24+
# API implemented
25+
| Endpoint | Avaliable | Notes
26+
|:------------------------|:----------:|:-
27+
| Retrieve a database ||
28+
| Query a database | 🏗 | Working on it
29+
| List databases ||
30+
| Create a database | ✅ | Workin on more properties
31+
| Retrieve a page ||
32+
| Create a page | ✅ | Workin on more properties
33+
| Update a page | ✅ | Workin on more properties
34+
| Retrieve block children ||
35+
| Append block children ||
36+
| Retrieve a user | |
37+
| List all users | |
38+
| Search | |
39+
1940

2041
# Usage
2142
**Important**: The methods return a `NotionResponse`. You can find how to use it in its [documentation][1].
@@ -41,7 +62,10 @@ databases.fetchAll();
4162
```
4263

4364
## A few examples
44-
_To see more examples [go here](https://github.com/jonathangomz/notion_api/blob/main/example/example.md)._
65+
A page created and filled using only this package: \
66+
https://jonathangomz.notion.site/notion_api-example-0893dd2cb38a413d90165cb810b3c019
67+
68+
_To see code to create the page above or see more examples [go here](https://github.com/jonathangomz/notion_api/blob/main/example/example.md)._
4569

4670
### Append blocks children
4771
```dart
@@ -78,6 +102,19 @@ Page page = Page(
78102
notion.pages.create(page);
79103
```
80104

105+
# Errors
106+
Some errors that I have encounter and still don't know how to solve because are errors that also occur on Postman are:
107+
## Create page with chidren
108+
When the parent is a page the error is:
109+
```json
110+
"body failed validation: body.properties.title.type should be an array, instead was `\"array\"`."
111+
```
112+
But when the parent is a database then the error is:
113+
```json
114+
"body failed validation: body.parent.page_id should be defined, instead was `undefined`."
115+
```
116+
You can create the page first and then add the children as shown in the examples.
117+
81118
# Contributions
82119
Please help, I don't even know if what I'm doing is right.
83120

@@ -110,6 +147,26 @@ TEST_BLOCK_HEADING_ID=c8hac4bb32af48889228bf483d938e34
110147
```
111148

112149
# Next release
113-
I don't know yet. If you have suggestions feel free to create an Issue or to create a PR with the feature.
150+
## v1.2.1:
151+
> Release date: 02/Aug/2021
152+
* Add constructors with only single text content with default style for:
153+
* `Paragraph.text('some text here...')`
154+
* `ToDo.text('some text here...', checked: true)`
155+
* `Heading.text('some text here...', type: 2)`
156+
* `BulletedListItem.text('some text here...')`
157+
* `NumberedListItem.text('some text here...')`
158+
* `Toggle.text('some text here...', children: [])`
159+
* Add more constructors for `Heading` class:
160+
* `one`: Heading with type 1 by default.
161+
* `two`: Heading with type 2 by default.
162+
* `three`: Heading with type 3 by default.
163+
* Add more constructors for `Text` class:
164+
* `code`: Text with code style by default.
165+
* `italic`: Text with italic style by default.
166+
* `bold`: Text with bold style by default.
167+
* [**Opt**] `list`: List of words separated by comma (by default).
168+
* Example: `Text.list()` will receive a list of Text and will be concatenated separated with comma by default. **It may be unnecessary**. Can help to make the code more readable.
169+
* [**Opt**] `sep`: Text separator.
170+
* Example: `Text.sep()`, by default, will insert " " in a list of `Text` instances, but it will be able to do more things that I don't know yet, hehe. **It may be unnecessary**. Can help to make the code more readable.
114171

115172
[1]:https://pub.dev/documentation/notion_api/1.0.0-beta1/responses_notion_response/NotionResponse-class.html

ROADMAP.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,48 @@
11
# Roadmap
22

33
## More coming soon...
4-
I don't know yet. If you have suggestions feel free to create an Issue or to create a PR with the feature.
4+
If you have suggestions feel free to create an Issue or to create a PR with the feature.
5+
6+
## v1.3.0
7+
> Release date: 06/Aug/2021
8+
* Maybe fix errors creating page with children. I don't know if is an error with Notion API.
9+
* Add query a database endpoint:
10+
* https://developers.notion.com/reference/post-database-query
11+
* Add more properties for pages and databases:
12+
* Page properties: https://developers.notion.com/reference/page#page-property-value
13+
* Database properties: https://developers.notion.com/reference/database#database-property
14+
15+
## v1.2.1:
16+
> Release date: 02/Aug/2021
17+
* Add constructors with only single text content with default style for:
18+
* `Paragraph.text('some text here...')`
19+
* `ToDo.text('some text here...', checked: true)`
20+
* `Heading.text('some text here...', type: 2)`
21+
* `BulletedListItem.text('some text here...')`
22+
* `NumberedListItem.text('some text here...')`
23+
* `Toggle.text('some text here...', children: [])`
24+
* Add more constructors for `Heading` class:
25+
* `one`: Heading with type 1 by default.
26+
* `two`: Heading with type 2 by default.
27+
* `three`: Heading with type 3 by default.
28+
* Add more constructors for `Text` class:
29+
* `code`: Text with code style by default.
30+
* `italic`: Text with italic style by default.
31+
* `bold`: Text with bold style by default.
32+
* [**Opt**] `list`: List of words separated by comma (by default).
33+
* Example: `Text.list()` will receive a list of Text and will be concatenated separated with comma by default. **It may be unnecessary**. Can help to make the code more readable.
34+
* [**Opt**] `sep`: Text separator.
35+
* Example: `Text.sep()`, by default, will insert " " in a list of `Text` instances, but it will be able to do more things that I don't know yet, hehe. **It may be unnecessary**. Can help to make the code more readable.
36+
37+
## v1.2.0: ✅
38+
> Release date: 27/Jul/2021
39+
* Implement new endpoints
40+
* Update page: https://developers.notion.com/reference/patch-page#archive-delete-a-page
41+
* Create database: https://developers.notion.com/reference/create-a-database
42+
* Add `Page` support for responses
43+
* Add more colors for Text
44+
* Add list of endpoints implemented on package
45+
* Improve coverage
546

647
## v1.1.0: ✅
748
> Release date: 10/Jul/2021

0 commit comments

Comments
 (0)