gatsby-source-notion-churnotion 1.0.66 → 1.0.67

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.onPluginInit = void 0;
4
4
  const onPluginInit = ({ reporter }) => {
5
- reporter.info(`Churnotion plugin loaded...`);
5
+ reporter.info(`Churnotion plugin loaded`);
6
6
  };
7
7
  exports.onPluginInit = onPluginInit;
@@ -40,6 +40,8 @@ const isTextContentBlock = (block) => {
40
40
  "quote",
41
41
  "bulleted_list_item",
42
42
  "numbered_list_item",
43
+ "callout",
44
+ "code",
43
45
  ].includes(block.type);
44
46
  };
45
47
  const extractPlainText = (block) => {
@@ -0,0 +1,2 @@
1
+ import { GatsbyNode } from "gatsby";
2
+ export declare const onPostBootstrap: GatsbyNode[`onPostBootstrap`];
@@ -1 +1,34 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.onPostBootstrap = void 0;
7
+ const crypto_1 = __importDefault(require("crypto"));
8
+ const natural_1 = require("natural");
9
+ const constants_1 = require("../constants");
10
+ const md5 = (str) => {
11
+ const md5 = crypto_1.default.createHash("md5");
12
+ return md5.update(str, "binary").digest("hex");
13
+ };
14
+ const getSpaceSeparatedDoc = async (doc) => { };
15
+ const onPostBootstrap = async ({ actions, getNode, getNodesByType, createNodeId, reporter, cache, }) => {
16
+ const nodes = getNodesByType(constants_1.NODE_TYPE.Post);
17
+ const docs = nodes.map((node) => ({
18
+ id: node.id,
19
+ text: node.rawText,
20
+ }));
21
+ const tfidf = new natural_1.TfIdf();
22
+ docs.map(async (doc) => {
23
+ if (doc.text) {
24
+ const key = `${md5(doc.text)}-doc`;
25
+ const cached_ssd = await cache.get(key);
26
+ if (cached_ssd !== undefined) {
27
+ tfidf.addDocument(cached_ssd);
28
+ }
29
+ else {
30
+ }
31
+ }
32
+ });
33
+ };
34
+ exports.onPostBootstrap = onPostBootstrap;
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.66",
4
+ "version": "1.0.67",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",
@@ -40,6 +40,7 @@
40
40
  "gatsby-source-filesystem": "^5.14.0",
41
41
  "gatsby-transformer-json": "^5.14.0",
42
42
  "gatsby-transformer-sharp": "^5.14.0",
43
+ "kiwi-nlp": "^0.20.3",
43
44
  "metascraper": "^5.45.25",
44
45
  "metascraper-description": "^5.45.25",
45
46
  "metascraper-image": "^5.45.27",