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
Christopher Kolstad e3c9eaae3a
feat: support filtering on project and environment fields for events (#1801)
* feat: support filtering on project and environment fields for events

Co-authored-by: Nuno Góis <github@nunogois.com>
2022-07-12 12:13:25 +00:00

19 lines
668 B
TypeScript

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 });