2022-06-22 09:09:49 +02:00
import { FromSchema } from 'json-schema-to-ts' ;
import { featureSchema } from './feature-schema' ;
import { tagSchema } from './tag-schema' ;
import { tagTypeSchema } from './tag-type-schema' ;
import { featureTagSchema } from './feature-tag-schema' ;
import { projectSchema } from './project-schema' ;
import { featureStrategySchema } from './feature-strategy-schema' ;
import { featureEnvironmentSchema } from './feature-environment-schema' ;
import { environmentSchema } from './environment-schema' ;
import { segmentSchema } from './segment-schema' ;
import { featureStrategySegmentSchema } from './feature-strategy-segment-schema' ;
2022-06-23 08:10:20 +02:00
import { strategySchema } from './strategy-schema' ;
2022-06-22 09:09:49 +02:00
export const stateSchema = {
$id : '#/components/schemas/stateSchema' ,
type : 'object' ,
additionalProperties : true ,
2023-04-18 18:34:12 +02:00
deprecated : true ,
description :
'The state of the application used by export/import APIs which are deprecated in favor of the more fine grained /api/admin/export and /api/admin/import APIs' ,
2022-06-22 09:09:49 +02:00
required : [ 'version' ] ,
properties : {
version : {
type : 'integer' ,
} ,
features : {
type : 'array' ,
items : {
$ref : '#/components/schemas/featureSchema' ,
} ,
} ,
strategies : {
type : 'array' ,
items : {
$ref : '#/components/schemas/strategySchema' ,
} ,
} ,
tags : {
type : 'array' ,
items : {
$ref : '#/components/schemas/tagSchema' ,
} ,
} ,
tagTypes : {
type : 'array' ,
items : {
$ref : '#/components/schemas/tagTypeSchema' ,
} ,
} ,
featureTags : {
type : 'array' ,
items : {
$ref : '#/components/schemas/featureTagSchema' ,
} ,
} ,
projects : {
type : 'array' ,
items : {
$ref : '#/components/schemas/projectSchema' ,
} ,
} ,
featureStrategies : {
type : 'array' ,
items : {
$ref : '#/components/schemas/featureStrategySchema' ,
} ,
} ,
featureEnvironments : {
type : 'array' ,
items : {
$ref : '#/components/schemas/featureEnvironmentSchema' ,
} ,
} ,
environments : {
type : 'array' ,
items : {
$ref : '#/components/schemas/environmentSchema' ,
} ,
} ,
segments : {
type : 'array' ,
items : {
$ref : '#/components/schemas/segmentSchema' ,
} ,
} ,
featureStrategySegments : {
type : 'array' ,
items : {
$ref : '#/components/schemas/featureStrategySegmentSchema' ,
} ,
} ,
} ,
components : {
schemas : {
featureSchema ,
tagSchema ,
tagTypeSchema ,
featureTagSchema ,
projectSchema ,
featureStrategySchema ,
featureEnvironmentSchema ,
environmentSchema ,
segmentSchema ,
featureStrategySegmentSchema ,
2022-06-23 08:10:20 +02:00
strategySchema ,
2022-06-22 09:09:49 +02:00
} ,
} ,
} as const ;
export type StateSchema = FromSchema < typeof stateSchema > ;