gatsby-source-notion-churnotion 1.0.77 → 1.0.79
Sign up to get free protection for your applications and to get access to all the features.
package/dist/api/getBooks.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
import { IGetBooksParams } from "../types";
|
2
|
-
export declare const getBooks: ({ bookDatabaseId, reporter, createNode, createNodeId, getNode, cache, }: IGetBooksParams) => Promise<void>;
|
2
|
+
export declare const getBooks: ({ bookDatabaseId, reporter, getCache, createNode, createNodeId, getNode, cache, }: IGetBooksParams) => Promise<void>;
|
package/dist/api/getBooks.js
CHANGED
@@ -7,7 +7,8 @@ exports.getBooks = void 0;
|
|
7
7
|
const crypto_1 = __importDefault(require("crypto"));
|
8
8
|
const constants_1 = require("../constants");
|
9
9
|
const fetchData_1 = require("../util/fetchData");
|
10
|
-
const
|
10
|
+
const gatsby_source_filesystem_1 = require("gatsby-source-filesystem");
|
11
|
+
const getBooks = async ({ bookDatabaseId, reporter, getCache, createNode, createNodeId, getNode, cache, }) => {
|
11
12
|
const databaseUrl = `databases/${bookDatabaseId}/query`;
|
12
13
|
const cacheKey = `booksDatabase-${bookDatabaseId}`;
|
13
14
|
let result = await cache.get(cacheKey);
|
@@ -33,6 +34,14 @@ const getBooks = async ({ bookDatabaseId, reporter, createNode, createNodeId, ge
|
|
33
34
|
if (categoryId) {
|
34
35
|
book_category = createNodeId(`${categoryId}-category`);
|
35
36
|
}
|
37
|
+
const bookImage = page.properties?.bookImage?.files?.[0]?.file.url;
|
38
|
+
const bookImageNode = await (0, gatsby_source_filesystem_1.createRemoteFileNode)({
|
39
|
+
url: bookImage,
|
40
|
+
parentNodeId: page.id,
|
41
|
+
getCache,
|
42
|
+
createNode,
|
43
|
+
createNodeId,
|
44
|
+
});
|
36
45
|
const bookNode = {
|
37
46
|
id: nodeId,
|
38
47
|
book_name: page.properties?.[`이름`]?.title?.[0]?.plain_text || `Unnamed`,
|
@@ -50,6 +59,7 @@ const getBooks = async ({ bookDatabaseId, reporter, createNode, createNodeId, ge
|
|
50
59
|
update_date: page.last_edited_time,
|
51
60
|
url: `${constants_1.COMMON_URI}/${constants_1.BOOK_URI}/${slug}`,
|
52
61
|
book_category: book_category,
|
62
|
+
book_image: bookImageNode,
|
53
63
|
};
|
54
64
|
reporter.info(`[DEBUG] Book ${bookNode.book_name} has book_category: ${bookNode.book_category}`);
|
55
65
|
createNode(bookNode);
|
@@ -53,6 +53,7 @@ const createSchemaCustomization = ({ actions }) => {
|
|
53
53
|
children: [${constants_1.NODE_TYPE.Post}] @link(by: "book", from: "id")
|
54
54
|
url: String!
|
55
55
|
book_category: ${constants_1.NODE_TYPE.Category} @link(by: "id")
|
56
|
+
book_image: File @link(by: "id", from: "book_image")
|
56
57
|
}
|
57
58
|
|
58
59
|
type ${constants_1.NODE_TYPE.Metadata} implements Node {
|
package/dist/source-nodes.js
CHANGED
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.79",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|