2022-04-25 14:17:59 +02:00
|
|
|
import { createSchemaObject, CreateSchemaType } from '../types';
|
2022-05-04 15:16:18 +02:00
|
|
|
import { overrideSchema } from './override-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-05-04 15:16:18 +02:00
|
|
|
required: ['name', 'weight', 'weightType', 'stickiness'],
|
2022-04-25 14:17:59 +02:00
|
|
|
properties: {
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
weight: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
weightType: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
stickiness: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
payload: {
|
|
|
|
type: 'object',
|
|
|
|
},
|
|
|
|
overrides: {
|
|
|
|
type: 'array',
|
2022-05-04 15:16:18 +02:00
|
|
|
items: overrideSchema,
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type VariantSchema = CreateSchemaType<typeof schema>;
|
|
|
|
|
|
|
|
export const variantSchema = createSchemaObject(schema);
|