1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00
unleash.unleash/src/lib/services/project-schema.ts

23 lines
824 B
TypeScript
Raw Normal View History

2021-09-14 20:36:40 +02:00
import joi from 'joi';
import { nameType } from '../routes/util';
2021-09-14 20:36:40 +02:00
export const projectSchema = joi
.object()
.keys({
id: nameType,
name: joi.string().required(),
description: joi.string().allow(null).allow('').optional(),
mode: joi
.string()
.valid('open', 'protected', 'private')
.default('open'),
defaultStickiness: joi.string().default('default'),
featureLimit: joi.number().allow(null).optional(),
featureNaming: joi.object().keys({
pattern: joi.string().allow(null).allow('').optional(),
example: joi.string().allow(null).allow('').optional(),
description: joi.string().allow(null).allow('').optional(),
}),
})
.options({ allowUnknown: false, stripUnknown: true });