1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/services/addon-schema.ts

19 lines
668 B
TypeScript
Raw Normal View History

import joi from 'joi';
import { nameType } from '../routes/util';
export const addonSchema = joi
.object()
.keys({
provider: nameType,
enabled: joi.bool().default(true),
description: joi.string().allow(null).allow('').optional(),
parameters: joi
.object()
.pattern(joi.string(), [joi.string(), joi.number(), joi.boolean()])
.optional(),
events: joi.array().optional().items(joi.string()),
projects: joi.array().optional().items(joi.string()),
environments: joi.array().optional().items(joi.string()),
})
.options({ allowUnknown: false, stripUnknown: true });