gatsby-source-notion-churnotion 1.0.45 → 1.0.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -142,7 +142,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
142
142
  }
143
143
  const bookId = page.properties?.book?.relation?.[0]?.id || null;
144
144
  const markdownContent = await connector_1.n2m.pageToMarkdown(page.id);
145
- const imageNode = await (0, imageProcessor_1.processBlocks)(markdownContent, actions, getCache, createNodeId, reporter, createParentChildLink);
145
+ const imageNode = await (0, imageProcessor_1.processBlocks)(markdownContent, actions, getCache, createNodeId, reporter);
146
146
  const gatsbyImageData = {
147
147
  childImageSharp: {
148
148
  gatsbyImageData: imageNode
@@ -1,3 +1,3 @@
1
1
  import { Actions, GatsbyCache, Reporter } from "gatsby";
2
2
  import { MdBlock } from "notion-to-md/build/types";
3
- export declare const processBlocks: (blocks: MdBlock[], actions: Actions, getCache: (this: void, id: string) => GatsbyCache, createNodeId: (this: void, input: string) => string, reporter: Reporter, createParentChildLink: any) => Promise<string | null>;
3
+ export declare const processBlocks: (blocks: MdBlock[], actions: Actions, getCache: (this: void, id: string) => GatsbyCache, createNodeId: (this: void, input: string) => string, reporter: Reporter) => Promise<string | null>;
@@ -2,22 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processBlocks = void 0;
4
4
  const gatsby_source_filesystem_1 = require("gatsby-source-filesystem");
5
- const processBlocks = async (blocks, actions, getCache, createNodeId, reporter, createParentChildLink) => {
5
+ const processBlocks = async (blocks, actions, getCache, createNodeId, reporter) => {
6
6
  const { createNode } = actions;
7
7
  let thumbnail = null;
8
8
  for (const block of blocks) {
9
- const blockNodeId = createNodeId(`${block.blockId}-MdBlock`);
10
- const blockNode = {
11
- ...block,
12
- id: blockNodeId,
13
- parent: null,
14
- children: [],
15
- internal: {
16
- type: "MdBlock",
17
- contentDigest: createNodeId(JSON.stringify(block)),
18
- },
19
- };
20
- createNode(blockNode);
21
9
  if (block.type === `image` &&
22
10
  typeof block.parent === `string` &&
23
11
  block.parent.includes(`http`)) {
@@ -28,16 +16,12 @@ const processBlocks = async (blocks, actions, getCache, createNodeId, reporter,
28
16
  try {
29
17
  const fileNode = await (0, gatsby_source_filesystem_1.createRemoteFileNode)({
30
18
  url: imageUrl,
31
- parentNodeId: blockNodeId,
19
+ parentNodeId: block.blockId,
32
20
  getCache,
33
21
  createNode,
34
22
  createNodeId,
35
23
  });
36
24
  if (fileNode) {
37
- createParentChildLink({
38
- parent: blockNode,
39
- child: fileNode,
40
- });
41
25
  block.parent = fileNode.id;
42
26
  if (!thumbnail)
43
27
  thumbnail = fileNode.id;
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.45",
4
+ "version": "1.0.46",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",