gatsby-source-notion-churnotion 1.0.68 → 1.0.70

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,46 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
39
  exports.onPostBootstrap = void 0;
7
40
  const crypto_1 = __importDefault(require("crypto"));
8
- const kiwi_nlp_1 = require("kiwi-nlp");
9
41
  const natural_1 = require("natural");
10
42
  const constants_1 = require("./constants");
11
- const computeCosineSimilarity = require("compute-cosine-similarity");
43
+ const compute_cosine_similarity_1 = __importDefault(require("compute-cosine-similarity"));
12
44
  const vector_similarity_memo = new Map();
13
45
  const md5 = (str) => {
14
46
  const md5 = crypto_1.default.createHash("md5");
@@ -26,7 +58,7 @@ const getMemorizedVectorSimilarity = (v1, v2) => {
26
58
  const calcVectorSimilarity = (v1, v2) => {
27
59
  if (v1.length !== v2.length)
28
60
  throw new Error("Both vector's size must be equal");
29
- return computeCosineSimilarity(v1, v2);
61
+ return (0, compute_cosine_similarity_1.default)(v1, v2) || 0;
30
62
  };
31
63
  const getRelatedPosts = (id, bow_vectors) => {
32
64
  const vector = bow_vectors.get(id);
@@ -60,7 +92,8 @@ const getSpaceSeparatedDoc = async (doc, kiwi) => {
60
92
  return kiwi.tokenize(doc).map((tokenInfo) => tokenInfo.str);
61
93
  };
62
94
  const onPostBootstrap = async ({ actions, getNode, getNodesByType, createNodeId, reporter, cache, }) => {
63
- const builder = await kiwi_nlp_1.KiwiBuilder.create("/dist/kiwi-wasm.wasm");
95
+ const { KiwiBuilder } = await Promise.resolve().then(() => __importStar(require("kiwi-nlp")));
96
+ const builder = await KiwiBuilder.create("/dist/kiwi-wasm.wasm");
64
97
  const kiwi = await builder.build({
65
98
  modelFiles: {
66
99
  "combiningRule.txt": "/dist/model/combiningRule.txt",
package/package.json CHANGED
@@ -1,9 +1,10 @@
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.68",
4
+ "version": "1.0.70",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
+ "type": "module",
7
8
  "main": "./dist/gatsby-node.js",
8
9
  "files": [
9
10
  "./dist/*",