2022-06-30 11:54:14 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
import { constraintSchema } from './constraint-schema';
|
|
|
|
import { parametersSchema } from './parameters-schema';
|
|
|
|
import { featureStrategySchema } from './feature-strategy-schema';
|
2022-08-08 16:21:57 +02:00
|
|
|
import { variantSchema } from './variant-schema';
|
|
|
|
import { overrideSchema } from './override-schema';
|
2022-06-30 11:54:14 +02:00
|
|
|
|
|
|
|
export const clientFeatureSchema = {
|
|
|
|
$id: '#/components/schemas/clientFeatureSchema',
|
|
|
|
type: 'object',
|
|
|
|
required: ['name', 'enabled'],
|
|
|
|
additionalProperties: false,
|
|
|
|
properties: {
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
type: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
description: {
|
|
|
|
type: 'string',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
createdAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
lastSeenAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
enabled: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
|
|
|
stale: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
|
|
|
impressionData: {
|
|
|
|
type: 'boolean',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
project: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
strategies: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureStrategySchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
variants: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
2022-08-08 16:21:57 +02:00
|
|
|
$ref: '#/components/schemas/variantSchema',
|
2022-06-30 11:54:14 +02:00
|
|
|
},
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
constraintSchema,
|
|
|
|
parametersSchema,
|
|
|
|
featureStrategySchema,
|
2022-08-08 16:21:57 +02:00
|
|
|
variantSchema,
|
|
|
|
overrideSchema,
|
2022-06-30 11:54:14 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type ClientFeatureSchema = FromSchema<typeof clientFeatureSchema>;
|