2022-04-25 14:17:59 +02:00
|
|
|
import { createSchemaObject, CreateSchemaType } from '../types';
|
|
|
|
|
2022-05-04 15:16:18 +02:00
|
|
|
const schema = {
|
2022-04-25 14:17:59 +02:00
|
|
|
type: 'object',
|
2022-04-29 08:09:27 +02:00
|
|
|
additionalProperties: false,
|
2022-04-25 14:17:59 +02:00
|
|
|
required: ['contextName', 'operator'],
|
|
|
|
properties: {
|
|
|
|
contextName: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
operator: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2022-05-04 15:16:18 +02:00
|
|
|
caseInsensitive: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
|
|
|
inverted: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
2022-04-25 14:17:59 +02:00
|
|
|
values: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
},
|
2022-05-04 15:16:18 +02:00
|
|
|
value: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type ConstraintSchema = CreateSchemaType<typeof schema>;
|
|
|
|
|
|
|
|
export const constraintSchema = createSchemaObject(schema);
|