gatsby-source-notion-churnotion 1.0.55 → 1.0.57

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,7 +52,16 @@ exports.fetchPostWithRetry = fetchPostWithRetry;
52
52
  const fetchGetWithRetry = async (url, options = {}, tryCount = 0, maxRetries = 5) => {
53
53
  try {
54
54
  const response = await connector_1.instance.get(url);
55
- // Return data if the request was successful
55
+ const results = response.data.results;
56
+ for (const block of results) {
57
+ if (block.has_children) {
58
+ block.children = [];
59
+ const pageUrl = `blocks/${block.id}/children?page_size=100`;
60
+ const childData = await (0, exports.fetchGetWithRetry)(pageUrl, options, 0, maxRetries);
61
+ const childResults = childData.data.results;
62
+ block.children.push(childResults);
63
+ }
64
+ }
56
65
  return response.data;
57
66
  }
58
67
  catch (error) {
@@ -13,7 +13,9 @@ const processTableOfContents = async (blocks, actions, getCache, createNodeId, r
13
13
  block.type === "heading_3")) {
14
14
  const plainText = block[block.type]?.rich_text[0]?.plain_text || "";
15
15
  const hash = `link-${plainText
16
- .replace(/[^a-zA-Z0-9-_]/g, "-")
16
+ .replace(/[^a-zA-Z0-9가-힣\s-_]/g, "")
17
+ .trim()
18
+ .replace(/\s+/g, "-")
17
19
  .toLowerCase()}`;
18
20
  block.hash = hash;
19
21
  tableOfContents.push({
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.55",
4
+ "version": "1.0.57",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",