1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/openapi/spec/client-feature-schema.ts

73 lines
1.8 KiB
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { constraintSchema } from './constraint-schema';
import { parametersSchema } from './parameters-schema';
import { featureStrategySchema } from './feature-strategy-schema';
import { variantSchema } from './variant-schema';
import { overrideSchema } from './override-schema';
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: {
$ref: '#/components/schemas/variantSchema',
},
nullable: true,
},
},
components: {
schemas: {
constraintSchema,
parametersSchema,
featureStrategySchema,
variantSchema,
overrideSchema,
},
},
} as const;
export type ClientFeatureSchema = FromSchema<typeof clientFeatureSchema>;