non-breaking updates

This commit is contained in:
2022-02-16 17:18:52 +00:00
committed by Stepan Usatiuk
parent d376b2df13
commit e1096f6e28
7 changed files with 31678 additions and 8561 deletions

View File

@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/no-var-requires */
const { pathsToModuleNameMapper } = require("ts-jest/utils"); const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig"); const { compilerOptions } = require("./tsconfig");
module.exports = { module.exports = {

30543
frontend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,58 +13,61 @@
} }
}, },
"dependencies": { "dependencies": {
"@blueprintjs/core": "^3.47.0", "@blueprintjs/core": "^3.53.0",
"@typescript-eslint/eslint-plugin": "^4.28.5", "@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^4.28.5", "@typescript-eslint/parser": "^5.12.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0",
"autoprefixer": "^9", "autoprefixer": "^9",
"enzyme": "^3.11.0", "enzyme": "^3.11.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0", "eslint": "^8.9.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0", "eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-html": "^6.1.2", "eslint-plugin-html": "^6.2.0",
"eslint-plugin-import": "^2.23.4", "eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^24.4.0", "eslint-plugin-jest": "^26.1.1",
"eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.24.0", "eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.3.0",
"jest": "^27.0.6", "flush-promises": "^1.0.2",
"parcel": "^1.12.4", "jest": "^27.5.1",
"parcel": "1.12.3",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
"postcss": "^8.3.6", "postcss": "^8.4.6",
"prettier": "^2.3.2", "prettier": "^2.5.1",
"prettier-eslint": "^13.0.0", "prettier-eslint": "^13.0.0",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-redux": "^7.2.4", "react-redux": "^7.2.6",
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-spring": "^8", "react-spring": "^8",
"redux": "^4.1.0", "redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9", "redux-devtools-extension": "^2.13.9",
"redux-persist": "^6.0.0", "redux-persist": "^6.0.0",
"redux-saga": "^1.1.3", "redux-saga": "^1.1.3",
"sass": "^1.37.0", "sass": "^1.49.7",
"spark-md5": "^3.0.1", "spark-md5": "^3.0.2",
"ts-jest": "^27.0.4", "ts-jest": "^27.1.3",
"typescript": "^4.3.5", "typescript": "^4.5.5"
"flush-promises": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@parcel/config-default": "^2.3.1",
"@parcel/transformer-sass": "^2.3.1",
"@parcel/transformer-typescript-tsc": "^2.3.1",
"@types/autoprefixer": "^9.7.2", "@types/autoprefixer": "^9.7.2",
"@types/enzyme": "^3.10.9", "@types/enzyme": "^3.10.11",
"@types/eslint": "^7.28.0", "@types/eslint": "^8.4.1",
"@types/eslint-plugin-prettier": "^3.1.0", "@types/eslint-plugin-prettier": "^3.1.0",
"@types/jest": "^26.0.24", "@types/jest": "^27.4.0",
"@types/pluralize": "^0.0.29", "@types/pluralize": "^0.0.29",
"@types/prettier": "^2.3.2", "@types/prettier": "^2.4.4",
"@types/react": "^17.0.15", "@types/react": "^17.0.39",
"@types/react-dom": "^17.0.9", "@types/react-dom": "^17.0.11",
"@types/react-redux": "^7.1.18", "@types/react-redux": "^7.1.22",
"@types/react-router": "^5.1.16", "@types/react-router": "^5.1.18",
"@types/react-router-dom": "^5.1.8", "@types/react-router-dom": "^5.3.3",
"@types/sass": "^1.16.1", "@types/sass": "^1.43.1",
"@types/spark-md5": "^3.0.2" "@types/spark-md5": "^3.0.2"
} }
} }

9603
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -23,65 +23,65 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@koa/cors": "^3.1.0", "@koa/cors": "^3.1.0",
"@koa/router": "^10.1.0", "@koa/router": "^10.1.1",
"@typescript-eslint/eslint-plugin": "^4.28.5", "@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^4.28.5", "@typescript-eslint/parser": "^5.12.0",
"bcrypt": "^5.0.1", "bcrypt": "^5.0.1",
"chai": "^4.3.4", "chai": "^4.3.6",
"class-validator": "^0.13.1", "class-validator": "^0.13.2",
"concurrently": "^6.2.0", "concurrently": "^7.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"deasync": "^0.1.21", "deasync": "^0.1.24",
"eslint": "^7.32.0", "eslint": "^8.9.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0", "eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.23.4", "eslint-plugin-import": "^2.25.4",
"eslint-plugin-mocha": "^9.0.0", "eslint-plugin-mocha": "^10.0.3",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^4.0.0",
"exifreader": "^3.16.0", "exifreader": "^4.2.0",
"hasha": "^5.2.2", "hasha": "^5.2.2",
"husky": "^7.0.1", "husky": "^7.0.4",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"koa": "^2.13.1", "koa": "^2.13.4",
"koa-body": "^4.2.0", "koa-body": "^4.2.0",
"koa-jwt": "^4.0.1", "koa-jwt": "^4.0.3",
"koa-logger": "^3.2.1", "koa-logger": "^3.2.1",
"koa-send": "^5.0.1", "koa-send": "^5.0.1",
"koa-sslify": "^5.0.0", "koa-sslify": "^5.0.0",
"koa-static": "^5.0.0", "koa-static": "^5.0.0",
"mime-types": "^2.1.32", "mime-types": "^2.1.34",
"mocha": "^9.0.3", "mocha": "^9.2.0",
"mysql": "^2.18.1", "mysql": "^2.18.1",
"prettier": "^2.3.2", "prettier": "^2.5.1",
"prettier-eslint": "^13.0.0", "prettier-eslint": "^13.0.0",
"sharp": "^0.28.3", "sharp": "^0.30.1",
"supertest": "^6.1.4", "supertest": "^6.2.2",
"ts-node": "^10.1.0", "ts-node": "^10.5.0",
"ts-node-dev": "^1.1.8", "ts-node-dev": "^1.1.8",
"tsconfig-paths": "^3.10.1", "tsconfig-paths": "^3.12.0",
"typeorm": "^0.2.36", "typeorm": "^0.2.41",
"typescript": "^4.3.5" "typescript": "^4.5.5"
}, },
"devDependencies": { "devDependencies": {
"@types/bcrypt": "^5.0.0", "@types/bcrypt": "^5.0.0",
"@types/chai": "^4.2.21", "@types/chai": "^4.3.0",
"@types/concurrently": "^6.2.1", "@types/concurrently": "^6.4.0",
"@types/deasync": "^0.1.1", "@types/deasync": "^0.1.2",
"@types/eslint": "^7.28.0", "@types/eslint": "^8.4.1",
"@types/eslint-plugin-prettier": "^3.1.0", "@types/eslint-plugin-prettier": "^3.1.0",
"@types/jsonwebtoken": "^8.5.4", "@types/jsonwebtoken": "^8.5.8",
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa-logger": "^3.1.1", "@types/koa-logger": "^3.1.2",
"@types/koa-send": "^4.1.3", "@types/koa-send": "^4.1.3",
"@types/koa-sslify": "^4.0.2", "@types/koa-sslify": "^4.0.3",
"@types/koa-static": "^4.0.2", "@types/koa-static": "^4.0.2",
"@types/koa__cors": "^3.0.3", "@types/koa__cors": "^3.1.1",
"@types/koa__router": "^8.0.7", "@types/koa__router": "^8.0.11",
"@types/mime-types": "^2.1.0", "@types/mime-types": "^2.1.1",
"@types/mocha": "^9.0.0", "@types/mocha": "^9.1.0",
"@types/mysql": "^2.15.19", "@types/mysql": "^2.15.21",
"@types/prettier": "^2.3.2", "@types/prettier": "^2.4.4",
"@types/sharp": "^0.28.5", "@types/sharp": "^0.29.5",
"@types/supertest": "^2.0.11" "@types/supertest": "^2.0.11"
}, },
"husky": { "husky": {

View File

@@ -51,6 +51,9 @@ app.use(async (ctx, next) => {
await Promise.all( await Promise.all(
filesVals.map(async (f) => { filesVals.map(async (f) => {
try { try {
if (Array.isArray(f)) {
throw "more than one file uploaded";
}
await fs.promises.unlink(f.path); await fs.promises.unlink(f.path);
} catch (e) { } catch (e) {
if (e.code !== "ENOENT") { if (e.code !== "ENOENT") {

View File

@@ -105,6 +105,9 @@ photosRouter.post("/photos/upload/:id", async (ctx) => {
return; return;
} }
const file = Object.values(files)[0]; const file = Object.values(files)[0];
if (Array.isArray(file)) {
throw "more than one file uploaded";
}
const photoHash = await getHash(file.path); const photoHash = await getHash(file.path);
const photoSize = await getSize(file.path); const photoSize = await getSize(file.path);