This commit is contained in:
parent
de7abbffa2
commit
a976b60f20
File diff suppressed because it is too large
Load Diff
|
@ -1,37 +1,37 @@
|
||||||
{
|
{
|
||||||
"name": "functions",
|
"name": "functions",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"serve": "npm run build && firebase emulators:start --only functions",
|
"serve": "npm run build && firebase emulators:start --only functions",
|
||||||
"shell": "npm run build && firebase functions:shell",
|
"shell": "npm run build && firebase functions:shell",
|
||||||
"start": "npm run shell",
|
"start": "npm run shell",
|
||||||
"deploy": "firebase deploy --only functions",
|
"deploy": "firebase deploy --only functions",
|
||||||
"logs": "firebase functions:log"
|
"logs": "firebase functions:log"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "16"
|
"node": "16"
|
||||||
},
|
},
|
||||||
"main": "lib/functions/src/index.js",
|
"main": "lib/functions/src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google-cloud/storage": "^5.8.1",
|
"@google-cloud/storage": "^5.8.1",
|
||||||
"@lingdocs/inflect": "5.1.2",
|
"@lingdocs/inflect": "5.1.3",
|
||||||
"@types/cors": "^2.8.10",
|
"@types/cors": "^2.8.10",
|
||||||
"@types/google-spreadsheet": "^3.0.2",
|
"@types/google-spreadsheet": "^3.0.2",
|
||||||
"@types/react": "^18.0.21",
|
"@types/react": "^18.0.21",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"firebase-admin": "^9.2.0",
|
"firebase-admin": "^9.2.0",
|
||||||
"firebase-functions": "^3.24.1",
|
"firebase-functions": "^3.24.1",
|
||||||
"google-spreadsheet": "^3.1.15",
|
"google-spreadsheet": "^3.1.15",
|
||||||
"nano": "^9.0.3",
|
"nano": "^9.0.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"react": "^17.0.1",
|
"react": "^17.0.1",
|
||||||
"react-bootstrap": "^1.5.1",
|
"react-bootstrap": "^1.5.1",
|
||||||
"react-dom": "^17.0.1"
|
"react-dom": "^17.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.20",
|
"@types/jest": "^26.0.20",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"firebase-functions-test": "^0.2.0",
|
"firebase-functions-test": "^0.2.0",
|
||||||
"typescript": "^4.6.3"
|
"typescript": "^4.6.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,16 @@ async function getRawEntries(): Promise<T.DictionaryEntry[]> {
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): T.DictionaryEntry[] {
|
function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): T.DictionaryEntry[] {
|
||||||
const entries: T.DictionaryEntry[] = rows.map((row): T.DictionaryEntry => {
|
const entries: T.DictionaryEntry[] = [];
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
const row = rows[i];
|
||||||
|
const nextRow = rows[i+1] || undefined;
|
||||||
|
if (row.ts === nextRow?.ts) {
|
||||||
|
// this looks like a duplicate entry made by the sheets api
|
||||||
|
// delete it and keep going
|
||||||
|
deleteRow(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const e: T.DictionaryEntry = {
|
const e: T.DictionaryEntry = {
|
||||||
i: 1,
|
i: 1,
|
||||||
ts: parseInt(row.ts),
|
ts: parseInt(row.ts),
|
||||||
|
@ -121,8 +130,8 @@ function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): T.Di
|
||||||
dictionaryEntryBooleanFields.forEach((field: T.DictionaryEntryBooleanField) => {
|
dictionaryEntryBooleanFields.forEach((field: T.DictionaryEntryBooleanField) => {
|
||||||
if (row[field]) e[field] = true;
|
if (row[field]) e[field] = true;
|
||||||
});
|
});
|
||||||
return standardizeEntry(e);
|
entries.push(standardizeEntry(e));
|
||||||
});
|
}
|
||||||
// add alphabetical index
|
// add alphabetical index
|
||||||
entries.sort((a, b) => a.p.localeCompare(b.p, "ps"));
|
entries.sort((a, b) => a.p.localeCompare(b.p, "ps"));
|
||||||
const entriesLength = entries.length;
|
const entriesLength = entries.length;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.15.2",
|
"@fortawesome/fontawesome-free": "^5.15.2",
|
||||||
"@lingdocs/ps-react": "5.1.2",
|
"@lingdocs/ps-react": "5.1.3",
|
||||||
"@testing-library/jest-dom": "^5.11.4",
|
"@testing-library/jest-dom": "^5.11.4",
|
||||||
"@testing-library/react": "^11.1.0",
|
"@testing-library/react": "^11.1.0",
|
||||||
"@testing-library/user-event": "^12.1.10",
|
"@testing-library/user-event": "^12.1.10",
|
||||||
|
|
|
@ -2349,10 +2349,10 @@
|
||||||
"@jridgewell/resolve-uri" "^3.0.3"
|
"@jridgewell/resolve-uri" "^3.0.3"
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.10"
|
"@jridgewell/sourcemap-codec" "^1.4.10"
|
||||||
|
|
||||||
"@lingdocs/ps-react@5.1.2":
|
"@lingdocs/ps-react@5.1.3":
|
||||||
version "5.1.2"
|
version "5.1.3"
|
||||||
resolved "https://npm.lingdocs.com/@lingdocs%2fps-react/-/ps-react-5.1.2.tgz#16f318208e46010b069ba06ffec88b3c85c398be"
|
resolved "https://npm.lingdocs.com/@lingdocs%2fps-react/-/ps-react-5.1.3.tgz#84a6e4eef606cdd73f818d2c5f5ebabd5c989ffe"
|
||||||
integrity sha512-Nyq/ACZej0BcV/3ePIH0CJRoCq/Ekw7gFHp8JFPBMUzYQcgLOB+Ad64CqsTNnljGzOQNEGsDQPz1+upO3Lux+g==
|
integrity sha512-qLlTLr56zSWd5xWgVk/2EynSWwsTwOu1/9tfkIbzWGDzo8xPXONqhDdpNpK7xhyj4RrUZqwtflym4FOjrdNa1g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@formkit/auto-animate" "^1.0.0-beta.3"
|
"@formkit/auto-animate" "^1.0.0-beta.3"
|
||||||
classnames "^2.2.6"
|
classnames "^2.2.6"
|
||||||
|
|
Loading…
Reference in New Issue