nosible 0.1.5 → 0.2.6
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/index.cjs +21 -2
- package/dist/index.cjs.map +9 -9
- package/dist/index.js +21 -2
- package/dist/index.js.map +9 -9
- package/package.json +5 -3
- package/src/api/index.ts +4 -0
- package/src/client.test.ts +6 -6
- package/src/index.ts +88 -1
- package/src/search/analyze.ts +3 -3
- package/src/search/result.ts +47 -48
- package/src/search/resultSet.ts +1 -2
- package/src/search/search.ts +1 -1
- package/src/search/searchSet.ts +2 -2
- package/src/utils/llm.ts +2 -2
- package/src/search/resultSet.types.ts +0 -3
package/dist/index.cjs
CHANGED
|
@@ -42,8 +42,14 @@ var __export = (target, all) => {
|
|
|
42
42
|
// src/index.ts
|
|
43
43
|
var exports_src = {};
|
|
44
44
|
__export(exports_src, {
|
|
45
|
+
WebPageData: () => WebPageData,
|
|
46
|
+
TopicTrend: () => TopicTrend,
|
|
47
|
+
SearchSet: () => SearchSet,
|
|
45
48
|
Search: () => Search,
|
|
46
|
-
|
|
49
|
+
ResultSet: () => ResultSet,
|
|
50
|
+
Result: () => Result,
|
|
51
|
+
NosibleClient: () => NosibleClient,
|
|
52
|
+
AnalyzeBy: () => AnalyzeBy
|
|
47
53
|
});
|
|
48
54
|
module.exports = __toCommonJS(exports_src);
|
|
49
55
|
|
|
@@ -568,6 +574,9 @@ var callNosibleApi = async ({
|
|
|
568
574
|
body,
|
|
569
575
|
apiKey
|
|
570
576
|
}) => {
|
|
577
|
+
const now = Date.now();
|
|
578
|
+
console.debug("Body: ", JSON.stringify(body, null, 2));
|
|
579
|
+
console.time(`Request-${endpoint}(${now})`);
|
|
571
580
|
const response = await fetch(`${baseUrl}/${endpoint}`, {
|
|
572
581
|
method: "POST",
|
|
573
582
|
headers: {
|
|
@@ -577,6 +586,7 @@ var callNosibleApi = async ({
|
|
|
577
586
|
},
|
|
578
587
|
body: JSON.stringify(body)
|
|
579
588
|
});
|
|
589
|
+
console.timeEnd(`Request-${endpoint}(${now})`);
|
|
580
590
|
if (!response.ok) {
|
|
581
591
|
console.error("Status: " + response.status);
|
|
582
592
|
if (response.status === 401) {
|
|
@@ -1268,6 +1278,15 @@ var import_lunr = __toESM(require("lunr"));
|
|
|
1268
1278
|
|
|
1269
1279
|
// src/search/analyze.ts
|
|
1270
1280
|
var import_simple_statistics = require("simple-statistics");
|
|
1281
|
+
var AnalyzeBy;
|
|
1282
|
+
((AnalyzeBy2) => {
|
|
1283
|
+
AnalyzeBy2[AnalyzeBy2["netloc"] = 0] = "netloc";
|
|
1284
|
+
AnalyzeBy2[AnalyzeBy2["published"] = 1] = "published";
|
|
1285
|
+
AnalyzeBy2[AnalyzeBy2["visited"] = 2] = "visited";
|
|
1286
|
+
AnalyzeBy2[AnalyzeBy2["author"] = 3] = "author";
|
|
1287
|
+
AnalyzeBy2[AnalyzeBy2["language"] = 4] = "language";
|
|
1288
|
+
AnalyzeBy2[AnalyzeBy2["similarity"] = 5] = "similarity";
|
|
1289
|
+
})(AnalyzeBy ||= {});
|
|
1271
1290
|
var analyzeResults = (results, by) => {
|
|
1272
1291
|
switch (by) {
|
|
1273
1292
|
case 0 /* netloc */:
|
|
@@ -1838,4 +1857,4 @@ class NosibleClient {
|
|
|
1838
1857
|
}
|
|
1839
1858
|
}
|
|
1840
1859
|
|
|
1841
|
-
//# debugId=
|
|
1860
|
+
//# debugId=2A981BDEE1C9373964756E2164756E21
|