2022-04-25 14:17:59 +02:00
|
|
|
import { createSchemaObject, CreateSchemaType } from '../types';
|
2022-05-04 15:16:18 +02:00
|
|
|
import { constraintSchema } from './constraint-schema';
|
|
|
|
import { parametersSchema } from './parameters-schema';
|
2022-04-25 14:17:59 +02:00
|
|
|
|
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: ['id', 'name', 'constraints', 'parameters'],
|
|
|
|
properties: {
|
|
|
|
id: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
constraints: {
|
|
|
|
type: 'array',
|
2022-05-04 15:16:18 +02:00
|
|
|
items: constraintSchema,
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
2022-05-04 15:16:18 +02:00
|
|
|
parameters: parametersSchema,
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type StrategySchema = CreateSchemaType<typeof schema>;
|
|
|
|
|
|
|
|
export const strategySchema = createSchemaObject(schema);
|