gatsby-source-notion-churnotion 1.1.1 → 1.1.3

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.
@@ -66,7 +66,7 @@ const createSchemaCustomization = ({ actions }) => {
66
66
  }
67
67
 
68
68
  type ${constants_1.NODE_TYPE.RelatedPost} implements Node {
69
- posts: [${constants_1.NODE_TYPE.RelatedPost}]
69
+ posts: [${constants_1.NODE_TYPE.Post}] @link(by: "id", from: "posts")
70
70
  }
71
71
  `);
72
72
  };
@@ -81,13 +81,11 @@ const onPostBootstrap = async ({ actions, getNode, getNodesByType, createNodeId,
81
81
  }
82
82
  else {
83
83
  const ssd = await getSpaceSeparatedDoc(await getTextFromRawText(doc.text));
84
- reporter.info(`[TEST3] ${ssd}`);
85
84
  tfidf.addDocument(ssd);
86
85
  await cache.set(key, ssd);
87
86
  }
88
87
  }
89
88
  });
90
- //
91
89
  const doc_terms = docs.map((_, i) => tfidf.listTerms(i)
92
90
  .map((x) => ({ ...x, tfidf: x.tf * x.idf }))
93
91
  .sort((x, y) => y.tfidf - x.tfidf));
@@ -101,7 +99,6 @@ const onPostBootstrap = async ({ actions, getNode, getNodesByType, createNodeId,
101
99
  });
102
100
  });
103
101
  const bow_vectors = new Map();
104
- reporter.info(`[DEBUG] BOW Vectors: ${JSON.stringify([...bow_vectors.entries()])}`);
105
102
  docs.forEach((x, i) => {
106
103
  if (bow_vectors === null)
107
104
  return;
@@ -109,12 +106,10 @@ const onPostBootstrap = async ({ actions, getNode, getNodesByType, createNodeId,
109
106
  .map((x) => tfidf_map_for_each_doc[i].get(x))
110
107
  .map((x) => (x === undefined ? 0 : x)));
111
108
  });
112
- reporter.info(`[related-posts] bow vectors generated, dimention: ${all_keywords.size}`);
113
109
  nodes.forEach((node) => {
114
110
  const related_nodes = getRelatedPosts(node.id, bow_vectors)
115
111
  .slice(1)
116
112
  .map((id) => getNode(id));
117
- reporter.info(`[DEBUG] Related posts for node ${node.id}: ${JSON.stringify(related_nodes)}`);
118
113
  const digest = `${node.id} - ${constants_1.NODE_TYPE.RelatedPost}`;
119
114
  actions.createNode({
120
115
  id: createNodeId(digest),
@@ -31,18 +31,15 @@ const processMetadata = async (blocks, actions, createNodeId, reporter, cache) =
31
31
  const href = text.href;
32
32
  if (href) {
33
33
  try {
34
- reporter.info(`[INFO] Processing metadata for URL: ${href}`);
35
34
  const cacheKey = `metadata-${crypto_1.default
36
35
  .createHash("md5")
37
36
  .update(href)
38
37
  .digest("hex")}`;
39
38
  const cachedMetadata = await cache.get(cacheKey);
40
39
  if (cachedMetadata) {
41
- reporter.info(`[INFO] Using cached metadata for URL: ${href}`);
42
40
  text.href = cachedMetadata.nodeId;
43
41
  continue;
44
42
  }
45
- reporter.info(`[INFO] Fetching metadata for URL: ${href}`);
46
43
  const response = await fetch(href, {
47
44
  headers: { "User-Agent": "Mozilla/5.0" },
48
45
  });
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.1.1",
4
+ "version": "1.1.3",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",