2022-06-08 15:31:34 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
import { parametersSchema } from './parameters-schema';
|
|
|
|
import { variantSchema } from './variant-schema';
|
|
|
|
import { overrideSchema } from './override-schema';
|
2022-06-23 08:10:20 +02:00
|
|
|
import { featureStrategySchema } from './feature-strategy-schema';
|
2022-06-08 15:31:34 +02:00
|
|
|
import { featureSchema } from './feature-schema';
|
|
|
|
import { constraintSchema } from './constraint-schema';
|
|
|
|
import { environmentSchema } from './environment-schema';
|
2023-01-11 09:53:43 +01:00
|
|
|
import { featureEnvironmentSchema } from './feature-environment-schema';
|
2023-01-27 13:13:41 +01:00
|
|
|
import { projectStatsSchema } from './project-stats-schema';
|
2022-06-08 15:31:34 +02:00
|
|
|
|
|
|
|
export const healthOverviewSchema = {
|
|
|
|
$id: '#/components/schemas/healthOverviewSchema',
|
|
|
|
type: 'object',
|
|
|
|
additionalProperties: false,
|
|
|
|
required: ['version', 'name'],
|
|
|
|
properties: {
|
|
|
|
version: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
description: {
|
|
|
|
type: 'string',
|
2023-02-14 11:25:13 +01:00
|
|
|
nullable: true,
|
2022-06-08 15:31:34 +02:00
|
|
|
},
|
2023-03-17 13:41:59 +01:00
|
|
|
defaultStickiness: {
|
|
|
|
type: 'string',
|
|
|
|
enum: ['default', 'userId', 'sessionId', 'random'],
|
|
|
|
example: 'userId',
|
|
|
|
description:
|
|
|
|
'A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy',
|
|
|
|
},
|
2023-03-16 15:29:52 +01:00
|
|
|
mode: {
|
|
|
|
type: 'string',
|
|
|
|
enum: ['open', 'protected'],
|
|
|
|
example: 'open',
|
|
|
|
nullable: true,
|
|
|
|
description:
|
|
|
|
'A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null`',
|
|
|
|
},
|
2022-06-08 15:31:34 +02:00
|
|
|
members: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
health: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
environments: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
features: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/featureSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
updatedAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
nullable: true,
|
|
|
|
},
|
2022-11-30 12:41:53 +01:00
|
|
|
favorite: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
2023-02-14 11:25:13 +01:00
|
|
|
stats: {
|
|
|
|
$ref: '#/components/schemas/projectStatsSchema',
|
|
|
|
description: 'Project statistics',
|
|
|
|
},
|
2022-06-08 15:31:34 +02:00
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
constraintSchema,
|
|
|
|
environmentSchema,
|
|
|
|
featureSchema,
|
2023-01-11 09:53:43 +01:00
|
|
|
featureEnvironmentSchema,
|
2022-06-08 15:31:34 +02:00
|
|
|
overrideSchema,
|
|
|
|
parametersSchema,
|
2022-06-23 08:10:20 +02:00
|
|
|
featureStrategySchema,
|
2022-06-08 15:31:34 +02:00
|
|
|
variantSchema,
|
2023-01-27 13:13:41 +01:00
|
|
|
projectStatsSchema,
|
2022-06-08 15:31:34 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type HealthOverviewSchema = FromSchema<typeof healthOverviewSchema>;
|