1 import * as express from 'express'
2 import { body } from 'express-validator/check'
3 import { logger } from '../../../helpers'
4 import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub'
5 import { areValidationErrors } from '../utils'
7 const activityPubValidator = [
8 body('').custom((value, { req }) => isRootActivityValid(req.body)),
10 (req: express.Request, res: express.Response, next: express.NextFunction) => {
11 logger.debug('Checking activity pub parameters')
13 if (areValidationErrors(req, res)) return
19 // ---------------------------------------------------------------------------