gatsby-source-notion-churnotion 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        package/dist/api/getBooks.js
    CHANGED
    
    | 
         @@ -34,6 +34,7 @@ const getBooks = async ({ bookDatabaseId, reporter, createNode, createNodeId, }) 
     | 
|
| 
       34 
34 
     | 
    
         
             
                        create_date: page.created_time,
         
     | 
| 
       35 
35 
     | 
    
         
             
                        update_date: page.last_edited_time,
         
     | 
| 
       36 
36 
     | 
    
         
             
                        url: `${constants_1.COMMON_URI}/${constants_1.BOOK_URI}/${slug}`,
         
     | 
| 
      
 37 
     | 
    
         
            +
                        book_category: page.properties?.category?.relation?.[0]?.id || `Etc`,
         
     | 
| 
       37 
38 
     | 
    
         
             
                    };
         
     | 
| 
       38 
39 
     | 
    
         
             
                    createNode(bookNode);
         
     | 
| 
       39 
40 
     | 
    
         
             
                }
         
     | 
    
        package/dist/api/getPages.js
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c 
     | 
|
| 
       16 
16 
     | 
    
         
             
                 * @param databaseId 데이터베이스 아이디
         
     | 
| 
       17 
17 
     | 
    
         
             
                 * @param parentCategoryId 부모 데이터베이스 아이디
         
     | 
| 
       18 
18 
     | 
    
         
             
                 */
         
     | 
| 
       19 
     | 
    
         
            -
                const processDatabase = async (databaseId, parentCategoryId = null, categoryPath = [], tagMap = {},  
     | 
| 
      
 19 
     | 
    
         
            +
                const processDatabase = async (databaseId, parentCategoryId = null, categoryPath = [], tagMap = {}, parentCategoryUrl = ``) => {
         
     | 
| 
       20 
20 
     | 
    
         
             
                    let hasMore = true;
         
     | 
| 
       21 
21 
     | 
    
         
             
                    try {
         
     | 
| 
       22 
22 
     | 
    
         
             
                        while (hasMore) {
         
     | 
| 
         @@ -39,7 +39,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c 
     | 
|
| 
       39 
39 
     | 
    
         
             
                                        reporter.warn(`[WARNING] Category without a title detected: ${categoryJsonData.id}`);
         
     | 
| 
       40 
40 
     | 
    
         
             
                                    }
         
     | 
| 
       41 
41 
     | 
    
         
             
                                    const nodeId = createNodeId(`${categoryJsonData.id}-category`);
         
     | 
| 
       42 
     | 
    
         
            -
                                    categoryUrl  
     | 
| 
      
 42 
     | 
    
         
            +
                                    const categoryUrl = `${parentCategoryUrl}/${slug}`;
         
     | 
| 
       43 
43 
     | 
    
         
             
                                    const categoryNode = {
         
     | 
| 
       44 
44 
     | 
    
         
             
                                        id: nodeId,
         
     | 
| 
       45 
45 
     | 
    
         
             
                                        category_name: title,
         
     | 
| 
         @@ -156,7 +156,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c 
     | 
|
| 
       156 
156 
     | 
    
         
             
                                        },
         
     | 
| 
       157 
157 
     | 
    
         
             
                                        tags: tagIds,
         
     | 
| 
       158 
158 
     | 
    
         
             
                                        parent: null,
         
     | 
| 
       159 
     | 
    
         
            -
                                        url: `${constants_1.COMMON_URI}/${constants_1.POST_URI}${ 
     | 
| 
      
 159 
     | 
    
         
            +
                                        url: `${constants_1.COMMON_URI}/${constants_1.POST_URI}${parentCategoryUrl}/${slug}`,
         
     | 
| 
       160 
160 
     | 
    
         
             
                                        thumbnail: imageNode,
         
     | 
| 
       161 
161 
     | 
    
         
             
                                    };
         
     | 
| 
       162 
162 
     | 
    
         
             
                                    await createNode(postNode);
         
     | 
| 
         @@ -38,8 +38,9 @@ const createSchemaCustomization = ({ actions }) => { 
     | 
|
| 
       38 
38 
     | 
    
         
             
                        category_name: String!
         
     | 
| 
       39 
39 
     | 
    
         
             
                        slug: String!
         
     | 
| 
       40 
40 
     | 
    
         
             
                        children: [${constants_1.NODE_TYPE.Category}!]! @link(by: "parent")
         
     | 
| 
       41 
     | 
    
         
            -
                        churnotions: [${constants_1.NODE_TYPE.Post}] @link(by: " 
     | 
| 
      
 41 
     | 
    
         
            +
                        churnotions: [${constants_1.NODE_TYPE.Post}] @link(by: "category", from: "id")
         
     | 
| 
       42 
42 
     | 
    
         
             
                        url: String!
         
     | 
| 
      
 43 
     | 
    
         
            +
                        books: [${constants_1.NODE_TYPE.Book}] @link(by: "book", from: "id")
         
     | 
| 
       43 
44 
     | 
    
         
             
                    }
         
     | 
| 
       44 
45 
     | 
    
         | 
| 
       45 
46 
     | 
    
         
             
                    type ${constants_1.NODE_TYPE.Book} implements Node {
         
     | 
| 
         @@ -49,6 +50,7 @@ const createSchemaCustomization = ({ actions }) => { 
     | 
|
| 
       49 
50 
     | 
    
         
             
                        update_date: Date! @dateformat
         
     | 
| 
       50 
51 
     | 
    
         
             
                        children: [${constants_1.NODE_TYPE.Post}] @link(by: "book", from: "id")
         
     | 
| 
       51 
52 
     | 
    
         
             
                        url: String!
         
     | 
| 
      
 53 
     | 
    
         
            +
                        book_category: ${constants_1.NODE_TYPE.Category} @link(by: "id")
         
     | 
| 
       52 
54 
     | 
    
         
             
                    }
         
     | 
| 
       53 
55 
     | 
    
         
             
                `);
         
     | 
| 
       54 
56 
     | 
    
         
             
            };
         
     | 
    
        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.28",
         
     | 
| 
       5 
5 
     | 
    
         
             
              "skipLibCheck": true,
         
     | 
| 
       6 
6 
     | 
    
         
             
              "license": "0BSD",
         
     | 
| 
       7 
7 
     | 
    
         
             
              "main": "./dist/gatsby-node.js",
         
     | 
| 
         @@ -36,10 +36,10 @@ 
     | 
|
| 
       36 
36 
     | 
    
         
             
                "@notionhq/client": "^2.2.15",
         
     | 
| 
       37 
37 
     | 
    
         
             
                "@types/node": "^22.10.2",
         
     | 
| 
       38 
38 
     | 
    
         
             
                "axios": "^1.7.9",
         
     | 
| 
      
 39 
     | 
    
         
            +
                "gatsby-plugin-sharp": "^5.14.0",
         
     | 
| 
       39 
40 
     | 
    
         
             
                "gatsby-source-filesystem": "^5.14.0",
         
     | 
| 
       40 
41 
     | 
    
         
             
                "gatsby-transformer-json": "^5.14.0",
         
     | 
| 
       41 
42 
     | 
    
         
             
                "gatsby-transformer-sharp": "^5.14.0",
         
     | 
| 
       42 
     | 
    
         
            -
                "gatsby-plugin-sharp": "^5.14.0",
         
     | 
| 
       43 
43 
     | 
    
         
             
                "node-fetch": "^3.3.2",
         
     | 
| 
       44 
44 
     | 
    
         
             
                "notion-to-md": "^3.1.1",
         
     | 
| 
       45 
45 
     | 
    
         
             
                "typescript": "^5.7.2"
         
     | 
| 
         @@ -51,5 +51,6 @@ 
     | 
|
| 
       51 
51 
     | 
    
         
             
                "gatsby": "^5.14.0",
         
     | 
| 
       52 
52 
     | 
    
         
             
                "react": "^18.0.0",
         
     | 
| 
       53 
53 
     | 
    
         
             
                "react-dom": "^18.0.0"
         
     | 
| 
       54 
     | 
    
         
            -
              }
         
     | 
| 
      
 54 
     | 
    
         
            +
              },
         
     | 
| 
      
 55 
     | 
    
         
            +
              "packageManager": "yarn@4.5.3+sha512.3003a14012e2987072d244c720506549c1aab73ee728208f1b2580a9fd67b92d61ba6b08fe93f6dce68fd771e3af1e59a0afa28dd242dd0940d73b95fedd4e90"
         
     | 
| 
       55 
56 
     | 
    
         
             
            }
         
     |