mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
53f90d37c5
Adds a first iteration of feature flag naming patterns. Currently behind a flag. Signed-off-by: andreas-unleash <andreas@getunleash.ai> Co-authored-by: Thomas Heartman <thomas@getunleash.io> Co-authored-by: andreas-unleash <andreas@getunleash.ai> Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
146 lines
5.3 KiB
TypeScript
146 lines
5.3 KiB
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
import { parametersSchema } from './parameters-schema';
|
|
import { variantSchema } from './variant-schema';
|
|
import { overrideSchema } from './override-schema';
|
|
import { featureStrategySchema } from './feature-strategy-schema';
|
|
import { featureSchema } from './feature-schema';
|
|
import { constraintSchema } from './constraint-schema';
|
|
import { environmentSchema } from './environment-schema';
|
|
import { featureEnvironmentSchema } from './feature-environment-schema';
|
|
import { projectStatsSchema } from './project-stats-schema';
|
|
import { createFeatureStrategySchema } from './create-feature-strategy-schema';
|
|
import { projectEnvironmentSchema } from './project-environment-schema';
|
|
import { createStrategyVariantSchema } from './create-strategy-variant-schema';
|
|
import { strategyVariantSchema } from './strategy-variant-schema';
|
|
import { createFeatureNamingPatternSchema } from './create-feature-naming-pattern-schema';
|
|
|
|
export const healthOverviewSchema = {
|
|
$id: '#/components/schemas/healthOverviewSchema',
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
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)`,
|
|
properties: {
|
|
version: {
|
|
type: 'integer',
|
|
description: 'The project overview version.',
|
|
example: 1,
|
|
},
|
|
name: {
|
|
type: 'string',
|
|
description: `The project's name`,
|
|
example: 'enterprisegrowth',
|
|
},
|
|
description: {
|
|
type: 'string',
|
|
nullable: true,
|
|
description: `The project's description`,
|
|
example: 'The project for all things enterprisegrowth',
|
|
},
|
|
defaultStickiness: {
|
|
type: 'string',
|
|
example: 'userId',
|
|
description:
|
|
'A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy',
|
|
},
|
|
mode: {
|
|
type: 'string',
|
|
enum: ['open', 'protected'],
|
|
example: 'open',
|
|
description:
|
|
"The project's [collaboration mode](https://docs.getunleash.io/reference/project-collaboration-mode). Determines whether non-project members can submit change requests or not.",
|
|
},
|
|
featureLimit: {
|
|
type: 'number',
|
|
nullable: true,
|
|
example: 100,
|
|
description:
|
|
'A limit on the number of features allowed in the project. Null if no limit.',
|
|
},
|
|
members: {
|
|
type: 'integer',
|
|
description: 'The number of users/members in the project.',
|
|
example: 5,
|
|
minimum: 0,
|
|
},
|
|
health: {
|
|
type: 'integer',
|
|
description:
|
|
'The overall [health rating](https://docs.getunleash.io/reference/technical-debt#health-rating) of the project.',
|
|
example: 95,
|
|
},
|
|
environments: {
|
|
type: 'array',
|
|
items: {
|
|
$ref: '#/components/schemas/projectEnvironmentSchema',
|
|
},
|
|
description:
|
|
'An array containing the names of all the environments configured for the project.',
|
|
},
|
|
features: {
|
|
type: 'array',
|
|
items: {
|
|
$ref: '#/components/schemas/featureSchema',
|
|
},
|
|
description:
|
|
'An array containing an overview of all the features of the project and their individual status',
|
|
},
|
|
updatedAt: {
|
|
type: 'string',
|
|
format: 'date-time',
|
|
nullable: true,
|
|
description: 'When the project was last updated.',
|
|
example: '2023-04-19T08:15:14.000Z',
|
|
},
|
|
createdAt: {
|
|
type: 'string',
|
|
format: 'date-time',
|
|
nullable: true,
|
|
description: 'When the project was last updated.',
|
|
example: '2023-04-19T08:15:14.000Z',
|
|
},
|
|
favorite: {
|
|
type: 'boolean',
|
|
description:
|
|
'Indicates if the project has been marked as a favorite by the current user requesting the project health overview.',
|
|
example: true,
|
|
},
|
|
stats: {
|
|
$ref: '#/components/schemas/projectStatsSchema',
|
|
description: 'Project statistics',
|
|
},
|
|
featureNaming: {
|
|
$ref: '#/components/schemas/createFeatureNamingPatternSchema',
|
|
},
|
|
},
|
|
components: {
|
|
schemas: {
|
|
environmentSchema,
|
|
projectEnvironmentSchema,
|
|
createFeatureStrategySchema,
|
|
createStrategyVariantSchema,
|
|
constraintSchema,
|
|
featureSchema,
|
|
featureEnvironmentSchema,
|
|
overrideSchema,
|
|
parametersSchema,
|
|
featureStrategySchema,
|
|
strategyVariantSchema,
|
|
variantSchema,
|
|
projectStatsSchema,
|
|
createFeatureNamingPatternSchema,
|
|
},
|
|
},
|
|
} as const;
|
|
|
|
export type HealthOverviewSchema = FromSchema<typeof healthOverviewSchema>;
|