Upgrade dependencies

This commit is contained in:
Chocobozzz 2020-05-28 11:37:47 +02:00
parent e8a13222b9
commit 1e516a8eeb
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
8 changed files with 690 additions and 687 deletions

View File

@ -30,42 +30,41 @@
"express-validator": "^6.1.1", "express-validator": "^6.1.1",
"js-yaml": "^3.12.1", "js-yaml": "^3.12.1",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"mkdirp": "^0.5.1", "mkdirp": "^1.0.4",
"morgan": "^1.9.1", "morgan": "^1.9.1",
"multer": "^1.4.1", "multer": "^1.4.1",
"pg": "^7.8.0", "pg": "^8.2.1",
"pino": "^5.11.1", "pino": "^6.3.0",
"pino-pretty": "^3.2.0", "pino-pretty": "^4.0.0",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"request": "^2.88.0", "request": "^2.88.0",
"retry": "^0.12.0", "retry": "^0.12.0",
"sequelize": "5.10.0", "sequelize": "5.21.11",
"sequelize-typescript": "^1.0.0-beta.3", "sequelize-typescript": "^1.0.0-beta.3",
"source-map-support": "^0.5.10" "source-map-support": "^0.5.10"
}, },
"devDependencies": { "devDependencies": {
"@types/async": "^3.0.0", "@types/async": "^3.0.0",
"@types/body-parser": "^1.16.3", "@types/body-parser": "^1.16.3",
"@types/config": "^0.0.34", "@types/config": "^0.0.36",
"@types/express": "^4.16.1", "@types/express": "^4.16.1",
"@types/lodash": "^4.14.149", "@types/lodash": "^4.14.149",
"@types/mkdirp": "^0.5.1", "@types/mkdirp": "^1.0.0",
"@types/morgan": "^1.7.32", "@types/morgan": "^1.7.32",
"@types/multer": "^1.3.3", "@types/multer": "^1.3.3",
"@types/node": "^10.12.23", "@types/node": "^14.0.5",
"@types/pino": "^5.8.4", "@types/pino": "^6.0.1",
"@types/request": "^2.48.1", "@types/request": "^2.48.1",
"@types/sequelize": "^4.27.35", "@types/sequelize": "^4.27.35",
"@types/validator": "^10.9.0", "@types/validator": "^13.0.0",
"@typescript-eslint/eslint-plugin": "^2.19.2", "@typescript-eslint/eslint-plugin": "^3.0.2",
"@typescript-eslint/parser": "^2.19.2", "@typescript-eslint/parser": "^3.0.2",
"eslint": "^6.8.0", "eslint": "^7.1.0",
"eslint-config-standard-with-typescript": "^13.0.0", "eslint-config-standard-with-typescript": "^18.0.2",
"eslint-plugin-import": "^2.20.1", "eslint-plugin-import": "^2.20.1",
"eslint-plugin-node": "^11.0.0", "eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1", "eslint-plugin-standard": "^4.0.1",
"tslint-config-standard": "^8.0.1",
"typescript": "^3.7.5" "typescript": "^3.7.5"
} }
} }

View File

@ -1,11 +1,12 @@
import * as express from 'express' import * as express from 'express'
import { paginationValidator } from '../../middlewares/validators/pagination' import { ChannelsSearchQuery } from 'server/types/channel-search.model'
import { setDefaultPagination } from '../../middlewares/pagination'
import { asyncMiddleware } from '../../middlewares/async'
import { channelsSearchSortValidator } from '../../middlewares/validators/sort'
import { videoChannelsSearchValidator } from '../../middlewares/validators/search'
import { setDefaultSearchSort } from '../../middlewares/sort'
import { formatChannelForAPI, queryChannels } from '../../lib/elastic-search-channels' import { formatChannelForAPI, queryChannels } from '../../lib/elastic-search-channels'
import { asyncMiddleware } from '../../middlewares/async'
import { setDefaultPagination } from '../../middlewares/pagination'
import { setDefaultSearchSort } from '../../middlewares/sort'
import { paginationValidator } from '../../middlewares/validators/pagination'
import { videoChannelsSearchValidator } from '../../middlewares/validators/search'
import { channelsSearchSortValidator } from '../../middlewares/validators/sort'
const searchChannelsRouter = express.Router() const searchChannelsRouter = express.Router()
@ -25,10 +26,11 @@ export { searchChannelsRouter }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
async function searchChannels (req: express.Request, res: express.Response) { async function searchChannels (req: express.Request, res: express.Response) {
const resultList = await queryChannels(req.query) const query = req.query as ChannelsSearchQuery
const resultList = await queryChannels(query)
return res.json({ return res.json({
total: resultList.total, total: resultList.total,
data: resultList.data.map(v => formatChannelForAPI(v, req.query.fromHost)) data: resultList.data.map(v => formatChannelForAPI(v, query.fromHost))
}) })
} }

View File

@ -30,6 +30,6 @@ async function searchVideos (req: express.Request, res: express.Response) {
return res.json({ return res.json({
total: resultList.total, total: resultList.total,
data: resultList.data.map(v => formatVideoForAPI(v, req.query.fromHost)) data: resultList.data.map(v => formatVideoForAPI(v, req.query.fromHost as string))
}) })
} }

View File

@ -1,4 +1,4 @@
import * as validator from 'validator' import validator from 'validator'
import { sep } from 'path' import { sep } from 'path'
function exists (value: any) { function exists (value: any) {

View File

@ -1,8 +1,8 @@
import { isArray } from './misc' import { isArray } from './misc'
import { isInt } from 'validator' import validator from 'validator'
function isNumberArray (value: any) { function isNumberArray (value: any) {
return isArray(value) && value.every(v => isInt('' + v)) return isArray(value) && value.every(v => validator.isInt('' + v))
} }
function isStringArray (value: any) { function isStringArray (value: any) {

View File

@ -2,4 +2,4 @@ import {
VideoChannelsSearchQuery as PeerTubeChannelsSearchQuery VideoChannelsSearchQuery as PeerTubeChannelsSearchQuery
} from '../../PeerTube/shared/models/search/video-channels-search-query.model' } from '../../PeerTube/shared/models/search/video-channels-search-query.model'
export type ChannelsSearchQuery = PeerTubeChannelsSearchQuery export type ChannelsSearchQuery = PeerTubeChannelsSearchQuery & { fromHost?: string }

7
server/typings/express.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
import "express";
declare module "express" {
export interface Request {
query: any
}
}

1313
yarn.lock

File diff suppressed because it is too large Load Diff