mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 05:18:34 +03:00
29 lines
794 B
JavaScript
29 lines
794 B
JavaScript
import Joi from 'joi'
|
|
|
|
const eventSchema = Joi.object().keys({
|
|
id: Joi.string().required(),
|
|
description: Joi.string().allow('').required(),
|
|
date: Joi.string().allow(''),
|
|
time: Joi.string().allow(''),
|
|
time_precision: Joi.string().allow(''),
|
|
location: Joi.string().allow(''),
|
|
latitude: Joi.string().allow(''),
|
|
longitude: Joi.string().allow(''),
|
|
type: Joi.string().allow(''),
|
|
category: Joi.string().required(),
|
|
narratives: Joi.array(),
|
|
sources: Joi.array(),
|
|
tags: Joi.array().allow(''),
|
|
comments: Joi.string().allow(''),
|
|
timestamp: Joi.string(),
|
|
time_display: Joi.string().allow(''),
|
|
|
|
// nested
|
|
narrative___stepStyles: Joi.array()
|
|
})
|
|
.and('latitude', 'longitude')
|
|
.and('date', 'time', 'timestamp')
|
|
.or('timestamp', 'latitude')
|
|
|
|
export default eventSchema
|