deploy should be working again

This commit is contained in:
adueck 2022-11-09 14:45:31 +05:00
parent 19d2946741
commit 97180d0576
6 changed files with 5 additions and 22 deletions

View File

@ -18,7 +18,6 @@
"crypto": "^1.0.1",
"ejs": "^3.1.6",
"express-session": "^1.17.2",
"froebel": "^0.22.0",
"lokijs": "^1.5.12",
"nano": "^9.0.3",
"node-fetch": "^2.6.7",
@ -1081,11 +1080,6 @@
"node": ">= 0.6"
}
},
"node_modules/froebel": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/froebel/-/froebel-0.22.0.tgz",
"integrity": "sha512-BF0Qm4qq860UAr57wfgFqoy1Df+5VyuenDC/ZTJEcIqwsSBBTrsP0bFEhuIMNOB/+JYcfIpDG+lHFC595Eqonw=="
},
"node_modules/fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
@ -3564,11 +3558,6 @@
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"dev": true
},
"froebel": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/froebel/-/froebel-0.22.0.tgz",
"integrity": "sha512-BF0Qm4qq860UAr57wfgFqoy1Df+5VyuenDC/ZTJEcIqwsSBBTrsP0bFEhuIMNOB/+JYcfIpDG+lHFC595Eqonw=="
},
"fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",

View File

@ -20,7 +20,6 @@
"crypto": "^1.0.1",
"ejs": "^3.1.6",
"express-session": "^1.17.2",
"froebel": "^0.22.0",
"lokijs": "^1.5.12",
"nano": "^9.0.3",
"node-fetch": "^2.6.7",

View File

@ -8,6 +8,7 @@ import {
Types as T,
typePredicates as tp,
entryOfFull,
standardizePashto,
} from "@lingdocs/inflect"
export let collection: Collection<any> | undefined = undefined;
@ -64,10 +65,11 @@ export async function getEntries(ids: (number | string)[]): Promise<{
if (!collection) {
throw new Error("dictionary not initialized");
}
const idsP = ids.map(x => typeof x === "number" ? x : standardizePashto(x))
const results: (T.DictionaryEntry | T.VerbEntry)[] = collection.find({
"$or": [
{ "ts": { "$in": ids }},
{ "p": { "$in": ids }},
{ "ts": { "$in": idsP }},
{ "p": { "$in": idsP }},
],
}).map(x => {
const { $loki, meta, ...entry } = x;

View File

@ -4,7 +4,6 @@ import {
getEntries,
updateDictionary,
} from "../lib/dictionary";
import { unary } from "froebel";
const dictionaryRouter = express.Router();
@ -18,7 +17,6 @@ dictionaryRouter.post("/entries", async (req, res, next) => {
return res.send({ ok: false, message: "dictionary not ready" });
}
const ids = req.body.ids as (number | string)[];
console.log({ ids });
if (!Array.isArray(ids)) {
return res.status(400).send({ ok: false, error: "invalid query" });
}

View File

@ -2,5 +2,5 @@ POST https://account.lingdocs.com/dictionary/entries HTTP/1.1
content-type: application/json
{
"ids": ["ليدل", 1527815306]
"ids": ["لیدل", 1527815306]
}

View File

@ -755,11 +755,6 @@
"resolved" "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz"
"version" "0.5.2"
"froebel@^0.22.0":
"integrity" "sha512-BF0Qm4qq860UAr57wfgFqoy1Df+5VyuenDC/ZTJEcIqwsSBBTrsP0bFEhuIMNOB/+JYcfIpDG+lHFC595Eqonw=="
"resolved" "https://registry.npmjs.org/froebel/-/froebel-0.22.0.tgz"
"version" "0.22.0"
"fs-extra@^8.0.1":
"integrity" "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g=="
"resolved" "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz"