1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-17 13:46:47 +02:00
unleash.unleash/src/lib/openapi/spec/project-environment-schema.ts
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

41 lines
1.4 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
import { createFeatureStrategySchema } from './create-feature-strategy-schema';
import { createStrategyVariantSchema } from './create-strategy-variant-schema';
export const projectEnvironmentSchema = {
$id: '#/components/schemas/projectEnvironmentSchema',
type: 'object',
additionalProperties: false,
description:
'Add an environment to a project, optionally also sets if change requests are enabled for this environment on the project',
required: ['environment'],
properties: {
environment: {
type: 'string',
description: 'The environment to add to the project',
example: 'development',
},
changeRequestsEnabled: {
type: 'boolean',
description:
'Whether change requests should be enabled or for this environment on the project or not',
example: true,
},
defaultStrategy: {
$ref: '#/components/schemas/createFeatureStrategySchema',
description:
'A default strategy to create for this environment on the project.',
},
},
components: {
schemas: {
createFeatureStrategySchema,
createStrategyVariantSchema,
},
},
} as const;
export type ProjectEnvironmentSchema = FromSchema<
typeof projectEnvironmentSchema
>;