import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
import { isValidRSSFeed } from '../../helpers/custom-validators/feeds'
import { exists, isIdOrUUIDValid, isIdValid, toCompleteUUID } from '../../helpers/custom-validators/misc'
-import { logger } from '../../helpers/logger'
import {
areValidationErrors,
checkCanSeeVideo,
.custom(isValidRSSFeed).withMessage('Should have a valid format (rss, atom, json)'),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking feeds format parameters', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
return next()
.optional(),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking feeds parameters', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
if (req.query.accountId && !await doesAccountIdExist(req.query.accountId, res)) return
.custom(exists),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking subscription feeds parameters', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
if (!await doesAccountIdExist(req.query.accountId, res)) return
.custom(isIdOrUUIDValid),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking feeds parameters', { parameters: req.query })
-
if (areValidationErrors(req, res)) return
if (req.query.videoId && (req.query.videoChannelId || req.query.videoChannelName)) {