2022-02-11 21:55:50 -05:00
|
|
|
const Joi = require('joi')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
id: Joi.string()
|
|
|
|
.regex(/^[A-Za-z0-9]+\.[a-z]{2}$/)
|
|
|
|
.required(),
|
|
|
|
name: Joi.string()
|
|
|
|
.regex(/^[\sa-zA-Z\u00C0-\u00FF0-9-!:&.+'/»#%°$@?()]+$/)
|
|
|
|
.required(),
|
|
|
|
network: Joi.string().allow(null),
|
|
|
|
country: Joi.string()
|
|
|
|
.regex(/^[A-Z]{2}$/)
|
|
|
|
.required(),
|
|
|
|
subdivision: Joi.string()
|
|
|
|
.regex(/^[A-Z]{2}-[A-Z0-9]{1,3}$/)
|
|
|
|
.allow(null),
|
2022-02-16 16:03:39 -05:00
|
|
|
city: Joi.string()
|
|
|
|
.regex(/^[\sa-zA-Z\u00C0-\u00FF0-9'-]+$/)
|
|
|
|
.allow(null),
|
2022-02-11 21:55:50 -05:00
|
|
|
broadcast_area: Joi.array().items(
|
2022-02-18 22:18:41 -05:00
|
|
|
Joi.string()
|
|
|
|
.regex(/^(s\/[A-Z]{2}-[A-Z0-9]{1,3}|c\/[A-Z]{2}|r\/[A-Z0-9]{3,7})$/)
|
|
|
|
.required()
|
|
|
|
),
|
|
|
|
languages: Joi.array().items(
|
|
|
|
Joi.string()
|
|
|
|
.regex(/^[a-z]{3}$/)
|
|
|
|
.required()
|
2022-02-11 21:55:50 -05:00
|
|
|
),
|
|
|
|
categories: Joi.array().items(Joi.string().regex(/^[a-z]+$/)),
|
2022-02-16 14:58:26 -05:00
|
|
|
is_nsfw: Joi.boolean().strict().required(),
|
2022-02-19 11:10:21 -05:00
|
|
|
logo: Joi.string()
|
|
|
|
.uri({
|
|
|
|
scheme: ['https']
|
|
|
|
})
|
|
|
|
.allow(null)
|
2022-02-11 21:55:50 -05:00
|
|
|
}
|