gatsby-source-notion-churnotion 1.0.16 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api/getPages.js +4 -3
- package/package.json +1 -1
package/dist/api/getPages.js
CHANGED
@@ -11,13 +11,13 @@ const imageProcessor_1 = require("../util/imageProcessor");
|
|
11
11
|
const slugify_1 = require("../util/slugify");
|
12
12
|
const connector_1 = require("./connector");
|
13
13
|
const getPages = async ({ databaseId, reporter, getCache, actions, createNode, createNodeId, createParentChildLink, getNode, }) => {
|
14
|
-
let hasMore = true;
|
15
14
|
/**
|
16
15
|
* 데이터베이스 내에 페이지들을 읽어서 재귀적으로 추가하는 서브 메서드드
|
17
16
|
* @param databaseId 데이터베이스 아이디
|
18
17
|
* @param parentCategoryId 부모 데이터베이스 아이디
|
19
18
|
*/
|
20
19
|
const processDatabase = async (databaseId, parentCategoryId = null, categoryPath = [], tagMap = {}, categoryUrl = ``) => {
|
20
|
+
let hasMore = true;
|
21
21
|
try {
|
22
22
|
while (hasMore) {
|
23
23
|
const databaseUrl = `databases/${databaseId}/query`;
|
@@ -53,7 +53,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
|
|
53
53
|
.update(JSON.stringify(categoryJsonData))
|
54
54
|
.digest(`hex`),
|
55
55
|
},
|
56
|
-
url: `${constants_1.COMMON_URI}
|
56
|
+
url: `${constants_1.COMMON_URI}/${categoryUrl}`,
|
57
57
|
};
|
58
58
|
createNode(categoryNode);
|
59
59
|
if (parentCategoryId && categoryNode) {
|
@@ -80,7 +80,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
|
|
80
80
|
.createHash(`md5`)
|
81
81
|
.update(JSON.stringify(title))
|
82
82
|
.digest(`hex`));
|
83
|
-
if (!title) {
|
83
|
+
if (!page.properties?.[`이름`]?.title?.[0]?.plain_text) {
|
84
84
|
reporter.warn(`[WARNING] Category without a title detected: ${page.id}`);
|
85
85
|
}
|
86
86
|
const nodeId = createNodeId(`${page.id}-page`);
|
@@ -197,6 +197,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
|
|
197
197
|
}
|
198
198
|
catch (error) {
|
199
199
|
reporter.error(`[ERROR] fetching page`);
|
200
|
+
hasMore = false;
|
200
201
|
}
|
201
202
|
};
|
202
203
|
await processDatabase(databaseId);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "gatsby-source-notion-churnotion",
|
3
3
|
"description": "Gatsby plugin that can connect with One Notion Database RECURSIVELY using official API",
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.18",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|