gatsby-source-notion-churnotion 1.0.66 → 1.0.67
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.
package/dist/onPluginInit.js
CHANGED
@@ -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;
|
package/dist/util/processor.js
CHANGED
package/dist/util/relatedPost.js
CHANGED
@@ -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.
|
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",
|