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,
|
|
|
|
required: ['name', 'type', 'enabled'],
|
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',
|
|
|
|
description: 'The type of the environment',
|
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',
|
|
|
|
},
|
2022-06-08 15:31:34 +02:00
|
|
|
sortOrder: {
|
|
|
|
type: 'number',
|
2023-02-10 15:05:57 +01:00
|
|
|
example: 3,
|
|
|
|
description:
|
|
|
|
'The sort order of the environment in the environments list',
|
2022-06-08 15:31:34 +02:00
|
|
|
},
|
2022-11-11 11:24:56 +01:00
|
|
|
projectCount: {
|
|
|
|
type: 'number',
|
|
|
|
nullable: true,
|
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: {
|
|
|
|
type: 'number',
|
|
|
|
nullable: true,
|
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: {
|
|
|
|
type: 'number',
|
|
|
|
nullable: true,
|
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>;
|