File tree Expand file tree Collapse file tree 5 files changed +41
-2
lines changed
Expand file tree Collapse file tree 5 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 11# @julianjark/notion-client
22
3+ ## 0.9.0
4+
5+ ### Minor Changes
6+
7+ - fetch all entries from notion database
8+
39## 0.8.0
410
511### Minor Changes
Original file line number Diff line number Diff line change 11{
22 "name" : " @julianjark/notion-client" ,
3- "version" : " 0.8 .0" ,
3+ "version" : " 0.9 .0" ,
44 "description" : " Helper client library Notion API" ,
55 "author" : " Julian Jark" ,
66 "license" : " ISC" ,
Original file line number Diff line number Diff line change @@ -46,8 +46,30 @@ export const getDatabasePages =
4646 database_id : databaseId ,
4747 sorts,
4848 filter,
49+ page_size : 100 ,
4950 } ) ;
5051
52+ const results : Awaited <
53+ ReturnType < typeof notion . databases . query >
54+ > [ "results" ] = [ ] ;
55+
56+ let cursor : string | undefined ;
57+ const shouldContinue = true ;
58+ while ( shouldContinue ) {
59+ const response = await notion . databases . query ( {
60+ database_id : databaseId ,
61+ sorts,
62+ filter,
63+ page_size : 100 ,
64+ start_cursor : cursor ,
65+ } ) ;
66+ results . push ( ...results ) ;
67+ if ( ! response . next_cursor ) {
68+ break ;
69+ }
70+ cursor = response . next_cursor ;
71+ }
72+
5173 return response . results . filter ( isPageObjectResponse ) ;
5274 } ;
5375
Original file line number Diff line number Diff line change 11# @julianjark/notion-cms
22
3+ ## 0.12.0
4+
5+ ### Minor Changes
6+
7+ - fetch all entries from notion database
8+
9+ ### Patch Changes
10+
11+ - Updated dependencies
12+ - @julianjark/notion-client @0.9.0
13+
314## 0.11.1
415
516### Patch Changes
Original file line number Diff line number Diff line change 11{
22 "name" : " @julianjark/notion-cms" ,
3- "version" : " 0.11.1 " ,
3+ "version" : " 0.12.0 " ,
44 "description" : " CMS abstraction for Notion" ,
55 "author" : " Julian Jark" ,
66 "license" : " ISC" ,
You can’t perform that action at this time.
0 commit comments