run typesync

This commit is contained in:
2023-07-29 22:25:53 +02:00
parent 614ac4c802
commit c114a72619
7 changed files with 107 additions and 69 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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);