gatsby-source-notion-churnotion 1.0.47 → 1.0.48
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/util/imageProcessor.js +18 -20
- package/package.json +1 -1
@@ -11,28 +11,26 @@ const processBlocks = async (blocks, actions, getCache, createNodeId, reporter)
|
|
11
11
|
let thumbnail = null;
|
12
12
|
for (const block of blocks) {
|
13
13
|
if (isImageBlock(block) && block?.image?.file?.url) {
|
14
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
if (
|
27
|
-
|
28
|
-
|
29
|
-
reporter.info(`[SUCCESS] Image processed: ${fileNode.id}`);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
catch (error) {
|
33
|
-
reporter.warn(`[WARNING] Failed to download image: ${imageUrl}`);
|
14
|
+
const imageUrl = block.image.file.url;
|
15
|
+
reporter.info(`[Image] got image > ${imageUrl}`);
|
16
|
+
try {
|
17
|
+
const fileNode = await (0, gatsby_source_filesystem_1.createRemoteFileNode)({
|
18
|
+
url: imageUrl,
|
19
|
+
parentNodeId: block.id,
|
20
|
+
getCache,
|
21
|
+
createNode,
|
22
|
+
createNodeId,
|
23
|
+
});
|
24
|
+
if (fileNode) {
|
25
|
+
block.image.file.url = fileNode.id;
|
26
|
+
if (!thumbnail)
|
27
|
+
thumbnail = fileNode.id;
|
28
|
+
reporter.info(`[SUCCESS] Image processed: ${fileNode.id}`);
|
34
29
|
}
|
35
30
|
}
|
31
|
+
catch (error) {
|
32
|
+
reporter.warn(`[WARNING] Failed to download image: ${imageUrl}`);
|
33
|
+
}
|
36
34
|
}
|
37
35
|
}
|
38
36
|
return thumbnail;
|
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.48",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|