mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 07:27:47 +01:00
run typesync
This commit is contained in:
33
backend/package-lock.json
generated
33
backend/package-lock.json
generated
@@ -38,7 +38,9 @@
|
||||
"@types/concurrently": "^6.4.0",
|
||||
"@types/deasync": "^0.1.2",
|
||||
"@types/eslint": "^8.44.1",
|
||||
"@types/eslint-config-prettier": "^6.11.0",
|
||||
"@types/eslint-plugin-prettier": "^3.1.0",
|
||||
"@types/hasha": "^3.0.1",
|
||||
"@types/jsonwebtoken": "^9.0.2",
|
||||
"@types/koa": "^2.13.7",
|
||||
"@types/koa__cors": "^4.0.0",
|
||||
@@ -434,6 +436,12 @@
|
||||
"@types/json-schema": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/eslint-config-prettier": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
|
||||
"integrity": "sha512-UBuZMZVog9c9jXvArbYtWH570sRWNaU6kEnUAHsHb/+zAufzPT4I+gMkUR2dVPWlqiceoRU1thjUVdGrAWVpCA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/eslint-plugin-prettier": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz",
|
||||
@@ -481,6 +489,16 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/hasha": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/hasha/-/hasha-3.0.1.tgz",
|
||||
"integrity": "sha512-BcVM5IwNV9HqEWCYa/ldX3xipzyfSsrC4+JVeA4nuLjRATdMhgAg1oH6eUDTl0lhvjSJYuLiVVTJxHZh4GAqig==",
|
||||
"deprecated": "This is a stub types definition. hasha provides its own type definitions, so you do not need this installed.",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"hasha": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/http-assert": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
|
||||
@@ -7660,6 +7678,12 @@
|
||||
"@types/json-schema": "*"
|
||||
}
|
||||
},
|
||||
"@types/eslint-config-prettier": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
|
||||
"integrity": "sha512-UBuZMZVog9c9jXvArbYtWH570sRWNaU6kEnUAHsHb/+zAufzPT4I+gMkUR2dVPWlqiceoRU1thjUVdGrAWVpCA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/eslint-plugin-prettier": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz",
|
||||
@@ -7707,6 +7731,15 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/hasha": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/hasha/-/hasha-3.0.1.tgz",
|
||||
"integrity": "sha512-BcVM5IwNV9HqEWCYa/ldX3xipzyfSsrC4+JVeA4nuLjRATdMhgAg1oH6eUDTl0lhvjSJYuLiVVTJxHZh4GAqig==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hasha": "*"
|
||||
}
|
||||
},
|
||||
"@types/http-assert": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
|
||||
|
||||
@@ -43,15 +43,17 @@
|
||||
"@types/concurrently": "^6.4.0",
|
||||
"@types/deasync": "^0.1.2",
|
||||
"@types/eslint": "^8.44.1",
|
||||
"@types/eslint-config-prettier": "^6.11.0",
|
||||
"@types/eslint-plugin-prettier": "^3.1.0",
|
||||
"@types/hasha": "^3.0.1",
|
||||
"@types/jsonwebtoken": "^9.0.2",
|
||||
"@types/koa": "^2.13.7",
|
||||
"@types/koa__cors": "^4.0.0",
|
||||
"@types/koa__router": "^12.0.0",
|
||||
"@types/koa-logger": "^3.1.2",
|
||||
"@types/koa-send": "^4.1.3",
|
||||
"@types/koa-sslify": "^4.0.3",
|
||||
"@types/koa-static": "^4.0.2",
|
||||
"@types/koa__cors": "^4.0.0",
|
||||
"@types/koa__router": "^12.0.0",
|
||||
"@types/mime-types": "^2.1.1",
|
||||
"@types/mocha": "^10.0.1",
|
||||
"@types/mysql": "^2.15.21",
|
||||
|
||||
@@ -10,7 +10,11 @@ import {
|
||||
IPhotosByIDGetRespBody,
|
||||
IPhotosDeleteRespBody,
|
||||
IPhotosDeleteBody,
|
||||
IAPIResponse, IPhotosListPagination } from "~/shared/types";
|
||||
IPhotosGetShowTokenByID,
|
||||
IPhotoShowToken,
|
||||
IAPIResponse,
|
||||
IPhotosListPagination,
|
||||
} from "~/shared/types";
|
||||
import send = require("koa-send");
|
||||
import { getHash, getSize } from "~util";
|
||||
import * as jwt from "jsonwebtoken";
|
||||
@@ -323,8 +327,6 @@ photosRouter.get("/photos/showByID/:id", async (ctx) => {
|
||||
await send(ctx, await photo.getReadyPath("original"));
|
||||
});
|
||||
|
||||
export type IPhotoShowToken = string;
|
||||
export type IPhotosGetShowTokenByID = IAPIResponse<IPhotoShowToken>;
|
||||
photosRouter.get("/photos/getShowByIDToken/:id", async (ctx) => {
|
||||
if (!ctx.state.user) {
|
||||
ctx.throw(401);
|
||||
|
||||
74
frontend/package-lock.json
generated
74
frontend/package-lock.json
generated
@@ -52,6 +52,7 @@
|
||||
"devDependencies": {
|
||||
"@types/enzyme": "^3.10.13",
|
||||
"@types/eslint": "^8.44.1",
|
||||
"@types/eslint-config-prettier": "^6.11.0",
|
||||
"@types/eslint-plugin-prettier": "^3.1.0",
|
||||
"@types/jest": "^29.5.3",
|
||||
"@types/pluralize": "^0.0.30",
|
||||
@@ -61,8 +62,8 @@
|
||||
"@types/react-redux": "^7.1.25",
|
||||
"@types/react-router": "^5.1.20",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@types/spark-md5": "^3.0.2",
|
||||
"parcel-resolver-ts-base-url": "^1.3.1"
|
||||
"@types/redux-devtools-extension": "^2.13.2",
|
||||
"@types/spark-md5": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
@@ -3298,6 +3299,12 @@
|
||||
"@types/json-schema": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/eslint-config-prettier": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
|
||||
"integrity": "sha512-UBuZMZVog9c9jXvArbYtWH570sRWNaU6kEnUAHsHb/+zAufzPT4I+gMkUR2dVPWlqiceoRU1thjUVdGrAWVpCA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/eslint-plugin-prettier": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz",
|
||||
@@ -3459,6 +3466,16 @@
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/redux-devtools-extension": {
|
||||
"version": "2.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/redux-devtools-extension/-/redux-devtools-extension-2.13.2.tgz",
|
||||
"integrity": "sha512-pN9V4wx+IW12Rf0FZl6nkvAsa+Uqa6C/mOeYai8cT3RDDVsOY+DoFt58ZeBrSLMXMgPgI4n6MDRrkET+DvkI1g==",
|
||||
"deprecated": "This is a stub types definition for redux-devtools-extension (https://github.com/zalmoxisus/redux-devtools-extension). redux-devtools-extension provides its own type definitions, so you don't need @types/redux-devtools-extension installed!",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"redux-devtools-extension": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz",
|
||||
@@ -8079,12 +8096,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/jsonc-parser": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jsx-ast-utils": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz",
|
||||
@@ -9053,23 +9064,6 @@
|
||||
"url": "https://opencollective.com/parcel"
|
||||
}
|
||||
},
|
||||
"node_modules/parcel-resolver-ts-base-url": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/parcel-resolver-ts-base-url/-/parcel-resolver-ts-base-url-1.3.1.tgz",
|
||||
"integrity": "sha512-/GfSk1P6oW7uXtViKlqGtH406kQ17Cu+bKHVTdbuIh8t8hICsJrYRqeDDx1dJWsiMAKvtXzXT0TBWLkdusS8PQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"jsonc-parser": "^3.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12",
|
||||
"parcel": "^2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@parcel/plugin": "^2.0.0",
|
||||
"parcel": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
@@ -13605,6 +13599,12 @@
|
||||
"@types/json-schema": "*"
|
||||
}
|
||||
},
|
||||
"@types/eslint-config-prettier": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
|
||||
"integrity": "sha512-UBuZMZVog9c9jXvArbYtWH570sRWNaU6kEnUAHsHb/+zAufzPT4I+gMkUR2dVPWlqiceoRU1thjUVdGrAWVpCA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/eslint-plugin-prettier": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz",
|
||||
@@ -13766,6 +13766,15 @@
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"@types/redux-devtools-extension": {
|
||||
"version": "2.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/redux-devtools-extension/-/redux-devtools-extension-2.13.2.tgz",
|
||||
"integrity": "sha512-pN9V4wx+IW12Rf0FZl6nkvAsa+Uqa6C/mOeYai8cT3RDDVsOY+DoFt58ZeBrSLMXMgPgI4n6MDRrkET+DvkI1g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"redux-devtools-extension": "*"
|
||||
}
|
||||
},
|
||||
"@types/scheduler": {
|
||||
"version": "0.16.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz",
|
||||
@@ -17000,12 +17009,6 @@
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="
|
||||
},
|
||||
"jsonc-parser": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||
"dev": true
|
||||
},
|
||||
"jsx-ast-utils": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz",
|
||||
@@ -17670,15 +17673,6 @@
|
||||
"get-port": "^4.2.0"
|
||||
}
|
||||
},
|
||||
"parcel-resolver-ts-base-url": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/parcel-resolver-ts-base-url/-/parcel-resolver-ts-base-url-1.3.1.tgz",
|
||||
"integrity": "sha512-/GfSk1P6oW7uXtViKlqGtH406kQ17Cu+bKHVTdbuIh8t8hICsJrYRqeDDx1dJWsiMAKvtXzXT0TBWLkdusS8PQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jsonc-parser": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"devDependencies": {
|
||||
"@types/enzyme": "^3.10.13",
|
||||
"@types/eslint": "^8.44.1",
|
||||
"@types/eslint-config-prettier": "^6.11.0",
|
||||
"@types/eslint-plugin-prettier": "^3.1.0",
|
||||
"@types/jest": "^29.5.3",
|
||||
"@types/pluralize": "^0.0.30",
|
||||
@@ -65,6 +66,7 @@
|
||||
"@types/react-redux": "^7.1.25",
|
||||
"@types/react-router": "^5.1.20",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@types/redux-devtools-extension": "^2.13.2",
|
||||
"@types/spark-md5": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,12 +105,6 @@ function computeSize(f: File) {
|
||||
});
|
||||
}
|
||||
|
||||
// Shouldn't be used anymore
|
||||
function* startSpinner() {
|
||||
yield delay(300);
|
||||
yield put(photosStartFetchingSpinner());
|
||||
}
|
||||
|
||||
function* photosLoad() {
|
||||
const state = yield select();
|
||||
try {
|
||||
|
||||
@@ -26,6 +26,28 @@ export interface IPhotoReqJSON extends IPhotoJSON {
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
export type IPhotoShowToken = string;
|
||||
export type IPhotosGetShowTokenByID = IAPIResponse<IPhotoShowToken>;
|
||||
|
||||
export interface IPhotosNewPostBody {
|
||||
hash: string | undefined;
|
||||
size: string | undefined;
|
||||
format: string | undefined;
|
||||
}
|
||||
|
||||
export interface IPhotosDeleteBody {
|
||||
photos: IPhotoReqJSON[];
|
||||
}
|
||||
|
||||
export const IPhotosListPagination = 50;
|
||||
|
||||
export type IPhotosNewRespBody = IAPIResponse<IPhotoReqJSON>;
|
||||
export type IPhotosUploadRespBody = IAPIResponse<IPhotoReqJSON>;
|
||||
export type IPhotosListRespBody = IAPIResponse<IPhotoReqJSON[]>;
|
||||
export type IPhotosByIDGetRespBody = IAPIResponse<IPhotoReqJSON>;
|
||||
export type IPhotoByIDDeleteRespBody = IAPIResponse<boolean>;
|
||||
export type IPhotosDeleteRespBody = IAPIResponse<boolean>;
|
||||
|
||||
export interface IUserJSON {
|
||||
id: number;
|
||||
username: string;
|
||||
@@ -40,35 +62,24 @@ export interface IUserJWT extends IUserJSON {
|
||||
export interface IUserAuthJSON extends IUserJSON {
|
||||
jwt: string;
|
||||
}
|
||||
export interface IPhotosNewPostBody {
|
||||
hash: string | undefined;
|
||||
size: string | undefined;
|
||||
format: string | undefined;
|
||||
}
|
||||
export type IPhotosNewRespBody = IAPIResponse<IPhotoReqJSON>;
|
||||
export type IPhotosUploadRespBody = IAPIResponse<IPhotoReqJSON>;
|
||||
export type IPhotosListRespBody = IAPIResponse<IPhotoReqJSON[]>;
|
||||
export type IPhotosByIDGetRespBody = IAPIResponse<IPhotoReqJSON>;
|
||||
export type IPhotoByIDDeleteRespBody = IAPIResponse<boolean>;
|
||||
export type IPhotosDeleteRespBody = IAPIResponse<boolean>;
|
||||
export type IUserGetRespBody = IAPIResponse<IUserAuthJSON>;
|
||||
export type IUserLoginRespBody = IAPIResponse<IUserAuthJSON>;
|
||||
|
||||
export interface IUserSignupBody {
|
||||
username: string | undefined;
|
||||
password: string | undefined;
|
||||
email: string | undefined;
|
||||
}
|
||||
|
||||
export type IUserSignupRespBody = IAPIResponse<IUserAuthJSON>;
|
||||
|
||||
export type IUserGetRespBody = IAPIResponse<IUserAuthJSON>;
|
||||
export type IUserLoginRespBody = IAPIResponse<IUserAuthJSON>;
|
||||
|
||||
export interface IUserEditBody {
|
||||
password: string | undefined;
|
||||
}
|
||||
|
||||
export type IUserEditRespBody = IAPIResponse<IUserAuthJSON>;
|
||||
export interface IUserLoginBody {
|
||||
username: string | undefined;
|
||||
password: string | undefined;
|
||||
}
|
||||
export interface IPhotosDeleteBody {
|
||||
photos: IPhotoReqJSON[];
|
||||
}
|
||||
|
||||
export const IPhotosListPagination = 50;
|
||||
|
||||
Reference in New Issue
Block a user