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' ;
2023-04-28 13:59:04 +02:00
import { createFeatureStrategySchema } from './create-feature-strategy-schema' ;
import { projectEnvironmentSchema } from './project-environment-schema' ;
2022-06-08 15:31:34 +02:00
export const healthOverviewSchema = {
$id : '#/components/schemas/healthOverviewSchema' ,
type : 'object' ,
additionalProperties : false ,
2023-05-19 09:07:23 +02:00
required : [
'version' ,
'name' ,
'defaultStickiness' ,
'mode' ,
'members' ,
'health' ,
'environments' ,
'features' ,
] ,
description : ` An overview of a project's stats and its health as described in the documentation on [technical debt](https://docs.getunleash.io/reference/technical-debt) ` ,
2022-06-08 15:31:34 +02:00
properties : {
version : {
2023-05-19 09:07:23 +02:00
type : 'integer' ,
description : 'The project overview version.' ,
example : 1 ,
2022-06-08 15:31:34 +02:00
} ,
name : {
type : 'string' ,
2023-05-19 09:07:23 +02:00
description : ` The project's name ` ,
example : 'enterprisegrowth' ,
2022-06-08 15:31:34 +02:00
} ,
description : {
type : 'string' ,
2023-02-14 11:25:13 +01:00
nullable : true ,
2023-05-19 09:07:23 +02:00
description : ` The project's description ` ,
example : 'The project for all things enterprisegrowth' ,
2022-06-08 15:31:34 +02:00
} ,
2023-03-17 13:41:59 +01:00
defaultStickiness : {
type : 'string' ,
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' ,
description :
2023-03-23 14:13:34 +01:00
"The project's [collaboration mode](https://docs.getunleash.io/reference/project-collaboration-mode). Determines whether non-project members can submit change requests or not." ,
2023-03-16 15:29:52 +01:00
} ,
2022-06-08 15:31:34 +02:00
members : {
2023-05-19 09:07:23 +02:00
type : 'integer' ,
description : 'The number of users/members in the project.' ,
example : 5 ,
minimum : 0 ,
2022-06-08 15:31:34 +02:00
} ,
health : {
2023-05-19 09:07:23 +02:00
type : 'integer' ,
description :
'The overall [health rating](https://docs.getunleash.io/reference/technical-debt#health-rating) of the project.' ,
example : 95 ,
2022-06-08 15:31:34 +02:00
} ,
environments : {
type : 'array' ,
items : {
2023-04-28 13:59:04 +02:00
$ref : '#/components/schemas/projectEnvironmentSchema' ,
2022-06-08 15:31:34 +02:00
} ,
2023-05-19 09:07:23 +02:00
description :
'An array containing the names of all the environments configured for the project.' ,
2022-06-08 15:31:34 +02:00
} ,
features : {
type : 'array' ,
items : {
$ref : '#/components/schemas/featureSchema' ,
} ,
2023-05-19 09:07:23 +02:00
description :
'An array containing an overview of all the features of the project and their individual status' ,
2022-06-08 15:31:34 +02:00
} ,
updatedAt : {
type : 'string' ,
format : 'date-time' ,
nullable : true ,
2023-05-19 09:07:23 +02:00
description : 'When the project was last updated.' ,
example : '2023-04-19T08:15:14.000Z' ,
2022-06-08 15:31:34 +02:00
} ,
2022-11-30 12:41:53 +01:00
favorite : {
type : 'boolean' ,
2023-05-19 09:07:23 +02:00
description :
'Indicates if the project has been marked as a favorite by the current user requesting the project health overview.' ,
example : true ,
2022-11-30 12:41:53 +01:00
} ,
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 : {
environmentSchema ,
2023-04-28 13:59:04 +02:00
projectEnvironmentSchema ,
createFeatureStrategySchema ,
constraintSchema ,
2022-06-08 15:31:34 +02:00
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 > ;