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';
|
2023-07-13 13:50:03 +02:00
|
|
|
import { strategyVariantSchema } from './strategy-variant-schema';
|
2022-06-22 09:09:49 +02:00
|
|
|
|
|
|
|
export const stateSchema = {
|
|
|
|
$id: '#/components/schemas/stateSchema',
|
|
|
|
type: 'object',
|
2023-04-18 18:34:12 +02:00
|
|
|
deprecated: true,
|
|
|
|
description:
|
2023-07-28 08:59:05 +02:00
|
|
|
'The application state as used by the deprecated export/import APIs.',
|
2022-06-22 09:09:49 +02:00
|
|
|
required: ['version'],
|
|
|
|
properties: {
|
|
|
|
version: {
|
|
|
|
type: 'integer',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'The version of the schema used to describe the state',
|
|
|
|
example: 1,
|
2022-06-22 09:09:49 +02:00
|
|
|
},
|
|
|
|
features: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of features',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
strategies: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of strategies',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/strategySchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tags: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of tags',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/tagSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tagTypes: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of tag types',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/tagTypeSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
featureTags: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of tags applied to features',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureTagSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
projects: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of projects',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/projectSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
featureStrategies: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of feature strategies as applied to features',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureStrategySchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
featureEnvironments: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of feature environment configurations',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureEnvironmentSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
environments: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of environments',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/environmentSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
segments: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of segments',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/segmentSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
featureStrategySegments: {
|
|
|
|
type: 'array',
|
2023-07-28 08:59:05 +02:00
|
|
|
description: 'A list of segment/strategy pairings',
|
2022-06-22 09:09:49 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureStrategySegmentSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
featureSchema,
|
|
|
|
tagSchema,
|
|
|
|
tagTypeSchema,
|
|
|
|
featureTagSchema,
|
|
|
|
projectSchema,
|
|
|
|
featureStrategySchema,
|
2023-07-13 13:50:03 +02:00
|
|
|
strategyVariantSchema,
|
2022-06-22 09:09:49 +02:00
|
|
|
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>;
|