2022-06-08 15:31:34 +02:00
import { FromSchema } from 'json-schema-to-ts' ;
export const environmentSchema = {
$id : '#/components/schemas/environmentSchema' ,
type : 'object' ,
additionalProperties : false ,
2023-04-04 15:45:34 +02:00
required : [ 'name' , 'type' , 'enabled' , 'protected' , 'sortOrder' ] ,
2023-02-10 15:05:57 +01:00
description : 'A definition of the project environment' ,
2022-06-08 15:31:34 +02:00
properties : {
name : {
type : 'string' ,
2023-02-10 15:05:57 +01:00
example : 'my-dev-env' ,
description : 'The name of the environment' ,
2022-06-08 15:31:34 +02:00
} ,
type : {
type : 'string' ,
2023-02-10 15:05:57 +01:00
example : 'development' ,
2023-04-04 15:45:34 +02:00
description :
'The [type of environment](https://docs.getunleash.io/reference/environments#environment-types).' ,
2022-06-08 15:31:34 +02:00
} ,
enabled : {
type : 'boolean' ,
2023-02-10 15:05:57 +01:00
example : true ,
description :
'`true` if the environment is enabled for the project, otherwise `false`.' ,
2022-06-08 15:31:34 +02:00
} ,
2022-06-10 10:04:56 +02:00
protected : {
type : 'boolean' ,
2023-04-04 15:45:34 +02:00
example : true ,
description :
'`true` if the environment is protected, otherwise `false`. A *protected* environment can not be deleted.' ,
2022-06-10 10:04:56 +02:00
} ,
2022-06-08 15:31:34 +02:00
sortOrder : {
2023-04-04 15:45:34 +02:00
type : 'integer' ,
2023-02-10 15:05:57 +01:00
example : 3 ,
description :
2023-04-04 15:45:34 +02:00
'Priority of the environment in a list of environments, the lower the value, the higher up in the list the environment will appear. Needs to be an integer' ,
2022-06-08 15:31:34 +02:00
} ,
2022-11-11 11:24:56 +01:00
projectCount : {
2023-04-04 15:45:34 +02:00
type : 'integer' ,
2022-11-11 11:24:56 +01:00
nullable : true ,
2023-04-04 15:45:34 +02:00
minimum : 0 ,
2023-02-10 15:05:57 +01:00
example : 10 ,
description : 'The number of projects with this environment' ,
2022-11-11 11:24:56 +01:00
} ,
apiTokenCount : {
2023-04-04 15:45:34 +02:00
type : 'integer' ,
2022-11-11 11:24:56 +01:00
nullable : true ,
2023-04-04 15:45:34 +02:00
minimum : 0 ,
2023-02-10 15:05:57 +01:00
example : 6 ,
description : 'The number of API tokens for the project environment' ,
2022-11-11 11:24:56 +01:00
} ,
enabledToggleCount : {
2023-04-04 15:45:34 +02:00
type : 'integer' ,
2022-11-11 11:24:56 +01:00
nullable : true ,
2023-04-04 15:45:34 +02:00
minimum : 0 ,
2023-02-10 15:05:57 +01:00
example : 10 ,
description :
'The number of enabled toggles for the project environment' ,
2022-11-11 11:24:56 +01:00
} ,
2022-06-08 15:31:34 +02:00
} ,
components : { } ,
} as const ;
export type EnvironmentSchema = FromSchema < typeof environmentSchema > ;