mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	chore: automate openapi schema list (#6463)
## About the changes This PR automates the generation of exported open api schemas on pre-commit, removing some manual steps and also standardizing the process. The schema list definition now looks way simpler:b6f3877296/src/lib/openapi/index.ts (L37-L49)Also added2817e66b29/src/lib/openapi/spec/index.ts (L1-L4)for devs
This commit is contained in:
		
							parent
							
								
									381af7835b
								
							
						
					
					
						commit
						da41d3dbcf
					
				| @ -2,3 +2,10 @@ | ||||
| . "$(dirname -- "$0")/_/husky.sh" | ||||
| 
 | ||||
| npx lint-staged | ||||
| 
 | ||||
| node .husky/update-openapi-spec-list.js | ||||
| 
 | ||||
| # Check if the src/lib/openapi/spec/index.ts file was modified and if so, add it to the commit | ||||
| if git ls-files -m | grep -q "src/lib/openapi/spec/index.ts"; then | ||||
|   git add src/lib/openapi/spec/index.ts | ||||
| fi | ||||
							
								
								
									
										34
									
								
								.husky/update-openapi-spec-list.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								.husky/update-openapi-spec-list.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| const fs = require('fs'); | ||||
| const path = require('path'); | ||||
| 
 | ||||
| const directoryPath = path.join(`${__dirname}/..`, 'src/lib/openapi/spec'); | ||||
| const indexPath = path.join(directoryPath, 'index.ts'); | ||||
| 
 | ||||
| // Read files from the directory
 | ||||
| fs.readdir(directoryPath, (err, files) => { | ||||
|     if (err) { | ||||
|         console.error('Could not list the directory.', err); | ||||
|         process.exit(1); | ||||
|     } | ||||
| 
 | ||||
|     const exports = files | ||||
|         .filter((file) => file.includes('schema.ts')) // Filter files by 'schema.ts'
 | ||||
|         .map((file) => `export * from './${file.replace('.ts', '')}';`) // Create export statements
 | ||||
|         .join('\n'); | ||||
| 
 | ||||
|     // Append export statements to index.ts
 | ||||
|     const script = path.basename(__filename); | ||||
|     const message = `/**
 | ||||
|  * Auto-generated file by ${script}. Do not edit. | ||||
|  * To run it manually execute \`node ${script}\` from ${path.basename( | ||||
|      __dirname, | ||||
|  )} | ||||
|  */\n`; | ||||
|     fs.writeFileSync(indexPath, `${message}${exports}\n${message}`, (err) => { | ||||
|         if (err) { | ||||
|             console.error('Could not append to file.', err); | ||||
|             process.exit(1); | ||||
|         } | ||||
|         console.log('Export statements added to index.ts successfully.'); | ||||
|     }); | ||||
| }); | ||||
| @ -1,209 +1,10 @@ | ||||
| import { OpenAPIV3 } from 'openapi-types'; | ||||
| import { | ||||
|     addonCreateUpdateSchema, | ||||
|     addonParameterSchema, | ||||
|     addonSchema, | ||||
|     addonsSchema, | ||||
|     addonTypeSchema, | ||||
|     adminCountSchema, | ||||
|     adminFeaturesQuerySchema, | ||||
|     adminSegmentSchema, | ||||
|     advancedPlaygroundFeatureSchema, | ||||
|     advancedPlaygroundRequestSchema, | ||||
|     advancedPlaygroundResponseSchema, | ||||
|     apiTokenSchema, | ||||
|     apiTokensSchema, | ||||
|     applicationSchema, | ||||
|     applicationsSchema, | ||||
|     applicationUsageSchema, | ||||
|     batchFeaturesSchema, | ||||
|     bulkToggleFeaturesSchema, | ||||
|     changePasswordSchema, | ||||
|     clientApplicationSchema, | ||||
|     clientFeatureSchema, | ||||
|     clientFeaturesQuerySchema, | ||||
|     clientFeaturesSchema, | ||||
|     clientMetricsSchema, | ||||
|     clientSegmentSchema, | ||||
|     cloneFeatureSchema, | ||||
|     constraintSchema, | ||||
|     contextFieldSchema, | ||||
|     contextFieldsSchema, | ||||
|     createApiTokenSchema, | ||||
|     createContextFieldSchema, | ||||
|     createDependentFeatureSchema, | ||||
|     createFeatureSchema, | ||||
|     createFeatureStrategySchema, | ||||
|     createGroupSchema, | ||||
|     createInvitedUserSchema, | ||||
|     createPatSchema, | ||||
|     createStrategySchema, | ||||
|     createStrategyVariantSchema, | ||||
|     createUserResponseSchema, | ||||
|     createUserSchema, | ||||
|     dateSchema, | ||||
|     dependenciesExistSchema, | ||||
|     dependentFeatureSchema, | ||||
|     deprecatedProjectOverviewSchema, | ||||
|     doraFeaturesSchema, | ||||
|     edgeTokenSchema, | ||||
|     emailSchema, | ||||
|     environmentProjectSchema, | ||||
|     environmentSchema, | ||||
|     environmentsProjectSchema, | ||||
|     environmentsSchema, | ||||
|     eventSchema, | ||||
|     eventsSchema, | ||||
|     exportQuerySchema, | ||||
|     exportResultSchema, | ||||
|     featureEnvironmentMetricsSchema, | ||||
|     featureEnvironmentSchema, | ||||
|     featureEventsSchema, | ||||
|     featureMetricsSchema, | ||||
|     featureSchema, | ||||
|     featureSearchResponseSchema, | ||||
|     featuresSchema, | ||||
|     featureStrategySchema, | ||||
|     featureStrategySegmentSchema, | ||||
|     featureTagSchema, | ||||
|     featureTypeCountSchema, | ||||
|     featureTypeSchema, | ||||
|     featureTypesSchema, | ||||
|     featureUsageSchema, | ||||
|     featureVariantsSchema, | ||||
|     feedbackCreateSchema, | ||||
|     feedbackResponseSchema, | ||||
|     feedbackUpdateSchema, | ||||
|     groupSchema, | ||||
|     groupsSchema, | ||||
|     groupUserModelSchema, | ||||
|     healthCheckSchema, | ||||
|     healthOverviewSchema, | ||||
|     healthReportSchema, | ||||
|     idSchema, | ||||
|     idsSchema, | ||||
|     importTogglesSchema, | ||||
|     importTogglesValidateItemSchema, | ||||
|     importTogglesValidateSchema, | ||||
|     inactiveUserSchema, | ||||
|     inactiveUsersSchema, | ||||
|     instanceAdminStatsSchema, | ||||
|     legalValueSchema, | ||||
|     loginSchema, | ||||
|     meSchema, | ||||
|     nameSchema, | ||||
|     overrideSchema, | ||||
|     parametersSchema, | ||||
|     parentFeatureOptionsSchema, | ||||
|     passwordSchema, | ||||
|     patchesSchema, | ||||
|     patchSchema, | ||||
|     patSchema, | ||||
|     patsSchema, | ||||
|     permissionSchema, | ||||
|     playgroundConstraintSchema, | ||||
|     playgroundFeatureSchema, | ||||
|     playgroundRequestSchema, | ||||
|     playgroundResponseSchema, | ||||
|     playgroundSegmentSchema, | ||||
|     playgroundStrategySchema, | ||||
|     profileSchema, | ||||
|     projectDoraMetricsSchema, | ||||
|     projectEnvironmentSchema, | ||||
|     projectOverviewSchema, | ||||
|     projectSchema, | ||||
|     projectsSchema, | ||||
|     projectStatsSchema, | ||||
|     proxyClientSchema, | ||||
|     proxyFeatureSchema, | ||||
|     proxyFeaturesSchema, | ||||
|     publicSignupTokenCreateSchema, | ||||
|     publicSignupTokenSchema, | ||||
|     publicSignupTokensSchema, | ||||
|     publicSignupTokenUpdateSchema, | ||||
|     pushVariantsSchema, | ||||
|     recordUiErrorSchema, | ||||
|     requestsPerSecondSchema, | ||||
|     requestsPerSecondSegmentedSchema, | ||||
|     resetPasswordSchema, | ||||
|     resourceLimitsSchema, | ||||
|     roleSchema, | ||||
|     sdkContextSchema, | ||||
|     sdkFlatContextSchema, | ||||
|     searchEventsSchema, | ||||
|     searchFeaturesSchema, | ||||
|     segmentSchema, | ||||
|     segmentsSchema, | ||||
|     setStrategySortOrderSchema, | ||||
|     setUiConfigSchema, | ||||
|     sortOrderSchema, | ||||
|     splashRequestSchema, | ||||
|     splashResponseSchema, | ||||
|     stateSchema, | ||||
|     strategiesSchema, | ||||
|     strategySchema, | ||||
|     strategyVariantSchema, | ||||
|     tagsBulkAddSchema, | ||||
|     tagSchema, | ||||
|     tagsSchema, | ||||
|     tagTypeSchema, | ||||
|     tagTypesSchema, | ||||
|     tagWithVersionSchema, | ||||
|     telemetrySettingsSchema, | ||||
|     tokenStringListSchema, | ||||
|     tokenUserSchema, | ||||
|     uiConfigSchema, | ||||
|     updateApiTokenSchema, | ||||
|     updateContextFieldSchema, | ||||
|     updateFeatureSchema, | ||||
|     updateFeatureStrategySchema, | ||||
|     updateFeatureStrategySegmentsSchema, | ||||
|     updateFeatureTypeLifetimeSchema, | ||||
|     updateStrategySchema, | ||||
|     updateTagTypeSchema, | ||||
|     updateUserSchema, | ||||
|     upsertSegmentSchema, | ||||
|     userSchema, | ||||
|     usersGroupsBaseSchema, | ||||
|     usersSchema, | ||||
|     usersSearchSchema, | ||||
|     validateArchiveFeaturesSchema, | ||||
|     validatedEdgeTokensSchema, | ||||
|     validateFeatureSchema, | ||||
|     validatePasswordSchema, | ||||
|     validateTagTypeSchema, | ||||
|     variantFlagSchema, | ||||
|     variantSchema, | ||||
|     variantsSchema, | ||||
|     versionSchema, | ||||
| } from './spec'; | ||||
| 
 | ||||
| import { IServerOption } from '../types'; | ||||
| import { mapValues, omitKeys } from '../util'; | ||||
| import { openApiTags } from './util'; | ||||
| import { URL } from 'url'; | ||||
| import apiVersion from '../util/version'; | ||||
| import { maintenanceSchema } from './spec/maintenance-schema'; | ||||
| import { toggleMaintenanceSchema } from './spec/toggle-maintenance-schema'; | ||||
| import { bulkRegistrationSchema } from './spec/bulk-registration-schema'; | ||||
| import { bulkMetricsSchema } from './spec/bulk-metrics-schema'; | ||||
| import { clientMetricsEnvSchema } from './spec/client-metrics-env-schema'; | ||||
| import { updateTagsSchema } from './spec/update-tags-schema'; | ||||
| import { batchStaleSchema } from './spec/batch-stale-schema'; | ||||
| import { createApplicationSchema } from './spec/create-application-schema'; | ||||
| import { contextFieldStrategiesSchema } from './spec/context-field-strategies-schema'; | ||||
| import { advancedPlaygroundEnvironmentFeatureSchema } from './spec/advanced-playground-environment-feature-schema'; | ||||
| import { createFeatureNamingPatternSchema } from './spec/create-feature-naming-pattern-schema'; | ||||
| import { segmentStrategiesSchema } from './spec/segment-strategies-schema'; | ||||
| import { featureDependenciesSchema } from './spec/feature-dependencies-schema'; | ||||
| import { projectApplicationsSchema } from './spec/project-applications-schema'; | ||||
| import { projectApplicationSchema } from './spec/project-application-schema'; | ||||
| import { projectApplicationSdkSchema } from './spec/project-application-sdk-schema'; | ||||
| import { rolesSchema } from './spec/roles-schema'; | ||||
| import { applicationOverviewSchema } from './spec/application-overview-schema'; | ||||
| import { applicationOverviewEnvironmentSchema } from './spec/application-overview-environment-schema'; | ||||
| import { applicationOverviewIssuesSchema } from './spec/application-overview-issues-schema'; | ||||
| import { applicationEnvironmentInstancesSchema } from './spec/application-environment-instances-schema'; | ||||
| import { applicationEnvironmentIssuesSchema } from './spec/application-environment-issues-schema'; | ||||
| 
 | ||||
| // Schemas must have an $id property on the form "#/components/schemas/mySchema".
 | ||||
| export type SchemaId = (typeof schemas)[keyof typeof schemas]['$id']; | ||||
| @ -233,207 +34,19 @@ interface OpenAPIV3DocumentWithServers extends OpenAPIV3.Document { | ||||
|     servers: OpenAPIV3.ServerObject[]; | ||||
| } | ||||
| 
 | ||||
| // All schemas in `openapi/spec` should be listed here.
 | ||||
| export const schemas: UnleashSchemas = { | ||||
|     adminCountSchema, | ||||
|     adminFeaturesQuerySchema, | ||||
|     adminSegmentSchema, | ||||
|     segmentStrategiesSchema, | ||||
|     addonParameterSchema, | ||||
|     addonSchema, | ||||
|     addonCreateUpdateSchema, | ||||
|     addonsSchema, | ||||
|     addonTypeSchema, | ||||
|     advancedPlaygroundEnvironmentFeatureSchema, | ||||
|     advancedPlaygroundFeatureSchema, | ||||
|     advancedPlaygroundRequestSchema, | ||||
|     advancedPlaygroundResponseSchema, | ||||
|     apiTokenSchema, | ||||
|     apiTokensSchema, | ||||
|     applicationSchema, | ||||
|     applicationOverviewSchema, | ||||
|     applicationOverviewIssuesSchema, | ||||
|     applicationOverviewEnvironmentSchema, | ||||
|     applicationEnvironmentInstancesSchema, | ||||
|     applicationEnvironmentIssuesSchema, | ||||
|     applicationUsageSchema, | ||||
|     applicationsSchema, | ||||
|     batchFeaturesSchema, | ||||
|     batchStaleSchema, | ||||
|     bulkRegistrationSchema, | ||||
|     bulkMetricsSchema, | ||||
|     bulkToggleFeaturesSchema, | ||||
|     changePasswordSchema, | ||||
|     clientApplicationSchema, | ||||
|     clientFeatureSchema, | ||||
|     clientFeaturesQuerySchema, | ||||
|     clientFeaturesSchema, | ||||
|     clientMetricsSchema, | ||||
|     clientMetricsEnvSchema, | ||||
|     cloneFeatureSchema, | ||||
|     constraintSchema, | ||||
|     contextFieldSchema, | ||||
|     contextFieldsSchema, | ||||
|     createApiTokenSchema, | ||||
|     createApplicationSchema, | ||||
|     createFeatureSchema, | ||||
|     createFeatureStrategySchema, | ||||
|     createInvitedUserSchema, | ||||
|     createUserSchema, | ||||
|     dateSchema, | ||||
|     edgeTokenSchema, | ||||
|     emailSchema, | ||||
|     environmentSchema, | ||||
|     environmentProjectSchema, | ||||
|     environmentsSchema, | ||||
|     environmentsProjectSchema, | ||||
|     eventSchema, | ||||
|     eventsSchema, | ||||
|     exportResultSchema, | ||||
|     exportQuerySchema, | ||||
|     featureEnvironmentMetricsSchema, | ||||
|     featureEnvironmentSchema, | ||||
|     featureEventsSchema, | ||||
|     featureMetricsSchema, | ||||
|     featureSchema, | ||||
|     featuresSchema, | ||||
|     featureStrategySchema, | ||||
|     featureStrategySegmentSchema, | ||||
|     featureTagSchema, | ||||
|     featureTypeSchema, | ||||
|     featureTypesSchema, | ||||
|     featureUsageSchema, | ||||
|     featureVariantsSchema, | ||||
|     feedbackCreateSchema, | ||||
|     feedbackUpdateSchema, | ||||
|     feedbackResponseSchema, | ||||
|     groupSchema, | ||||
|     groupsSchema, | ||||
|     groupUserModelSchema, | ||||
|     healthCheckSchema, | ||||
|     healthOverviewSchema, | ||||
|     healthReportSchema, | ||||
|     idSchema, | ||||
|     idsSchema, | ||||
|     instanceAdminStatsSchema, | ||||
|     legalValueSchema, | ||||
|     loginSchema, | ||||
|     maintenanceSchema, | ||||
|     toggleMaintenanceSchema, | ||||
|     meSchema, | ||||
|     nameSchema, | ||||
|     overrideSchema, | ||||
|     parametersSchema, | ||||
|     passwordSchema, | ||||
|     patchesSchema, | ||||
|     patchSchema, | ||||
|     createPatSchema, | ||||
|     patSchema, | ||||
|     patsSchema, | ||||
|     permissionSchema, | ||||
|     playgroundConstraintSchema, | ||||
|     playgroundFeatureSchema, | ||||
|     playgroundRequestSchema, | ||||
|     playgroundResponseSchema, | ||||
|     playgroundSegmentSchema, | ||||
|     playgroundStrategySchema, | ||||
|     profileSchema, | ||||
|     projectApplicationSchema, | ||||
|     projectApplicationSdkSchema, | ||||
|     projectApplicationsSchema, | ||||
|     projectEnvironmentSchema, | ||||
|     projectSchema, | ||||
|     projectsSchema, | ||||
|     proxyClientSchema, | ||||
|     proxyFeatureSchema, | ||||
|     proxyFeaturesSchema, | ||||
|     publicSignupTokenCreateSchema, | ||||
|     publicSignupTokenSchema, | ||||
|     publicSignupTokensSchema, | ||||
|     publicSignupTokenUpdateSchema, | ||||
|     pushVariantsSchema, | ||||
|     projectStatsSchema, | ||||
|     resetPasswordSchema, | ||||
|     requestsPerSecondSchema, | ||||
|     requestsPerSecondSegmentedSchema, | ||||
|     roleSchema, | ||||
|     rolesSchema, | ||||
|     sdkContextSchema, | ||||
|     sdkFlatContextSchema, | ||||
|     searchEventsSchema, | ||||
|     segmentSchema, | ||||
|     setStrategySortOrderSchema, | ||||
|     setUiConfigSchema, | ||||
|     sortOrderSchema, | ||||
|     splashRequestSchema, | ||||
|     splashResponseSchema, | ||||
|     stateSchema, | ||||
|     strategiesSchema, | ||||
|     strategySchema, | ||||
|     tagsBulkAddSchema, | ||||
|     tagSchema, | ||||
|     tagsSchema, | ||||
|     tagTypeSchema, | ||||
|     tagTypesSchema, | ||||
|     tagWithVersionSchema, | ||||
|     tokenUserSchema, | ||||
|     tokenStringListSchema, | ||||
|     uiConfigSchema, | ||||
|     updateApiTokenSchema, | ||||
|     updateFeatureSchema, | ||||
|     updateFeatureStrategySchema, | ||||
|     updateTagTypeSchema, | ||||
|     updateUserSchema, | ||||
|     updateTagsSchema, | ||||
|     createContextFieldSchema, | ||||
|     updateContextFieldSchema, | ||||
|     upsertSegmentSchema, | ||||
|     createStrategySchema, | ||||
|     updateStrategySchema, | ||||
|     updateFeatureTypeLifetimeSchema, | ||||
|     userSchema, | ||||
|     createUserResponseSchema, | ||||
|     usersGroupsBaseSchema, | ||||
|     usersSchema, | ||||
|     usersSearchSchema, | ||||
|     validatedEdgeTokensSchema, | ||||
|     validateFeatureSchema, | ||||
|     validatePasswordSchema, | ||||
|     validateTagTypeSchema, | ||||
|     variantSchema, | ||||
|     variantFlagSchema, | ||||
|     variantsSchema, | ||||
|     versionSchema, | ||||
|     deprecatedProjectOverviewSchema, | ||||
|     importTogglesSchema, | ||||
|     importTogglesValidateSchema, | ||||
|     importTogglesValidateItemSchema, | ||||
|     contextFieldStrategiesSchema, | ||||
|     telemetrySettingsSchema, | ||||
|     strategyVariantSchema, | ||||
|     createStrategyVariantSchema, | ||||
|     clientSegmentSchema, | ||||
|     createGroupSchema, | ||||
|     createFeatureNamingPatternSchema, | ||||
|     doraFeaturesSchema, | ||||
|     projectDoraMetricsSchema, | ||||
|     segmentsSchema, | ||||
|     updateFeatureStrategySegmentsSchema, | ||||
|     dependentFeatureSchema, | ||||
|     createDependentFeatureSchema, | ||||
|     parentFeatureOptionsSchema, | ||||
|     featureDependenciesSchema, | ||||
|     dependenciesExistSchema, | ||||
|     validateArchiveFeaturesSchema, | ||||
|     searchFeaturesSchema, | ||||
|     featureTypeCountSchema, | ||||
|     projectOverviewSchema, | ||||
|     featureSearchResponseSchema, | ||||
|     inactiveUserSchema, | ||||
|     inactiveUsersSchema, | ||||
|     recordUiErrorSchema, | ||||
|     resourceLimitsSchema, | ||||
| }; | ||||
| /* | ||||
|  * All schemas in `openapi/spec` should be listed here. | ||||
|  * Instead of listing them all maunally, exclude those that are not schemas (maybe they should be moved elsewhere) | ||||
|  */ | ||||
| import * as importedSchemas from './spec'; | ||||
| const { | ||||
|     constraintSchemaBase, | ||||
|     unknownFeatureEvaluationResult, | ||||
|     playgroundStrategyEvaluation, | ||||
|     strategyEvaluationResults, | ||||
|     ...exportedSchemas | ||||
| } = importedSchemas; | ||||
| export const schemas: UnleashSchemas = exportedSchemas; | ||||
| 
 | ||||
| // Remove JSONSchema keys that would result in an invalid OpenAPI spec.
 | ||||
| export const removeJsonSchemaProps = <T extends JsonSchemaProps>( | ||||
|  | ||||
| @ -61,4 +61,4 @@ export const clientMetricsEnvSchema = { | ||||
|     }, | ||||
| } as const; | ||||
| 
 | ||||
| export type ClientMetricsSchema = FromSchema<typeof clientMetricsEnvSchema>; | ||||
| export type ClientMetricsEnvSchema = FromSchema<typeof clientMetricsEnvSchema>; | ||||
|  | ||||
| @ -1,182 +1,206 @@ | ||||
| export * from './id-schema'; | ||||
| export * from './ids-schema'; | ||||
| export * from './me-schema'; | ||||
| export * from './create-pat-schema'; | ||||
| export * from './pat-schema'; | ||||
| export * from './tag-schema'; | ||||
| export * from './date-schema'; | ||||
| export * from './name-schema'; | ||||
| export * from './pats-schema'; | ||||
| export * from './role-schema'; | ||||
| export * from './tags-schema'; | ||||
| export * from './user-schema'; | ||||
| export * from './create-user-response-schema'; | ||||
| export * from './addon-schema'; | ||||
| /** | ||||
|  * Auto-generated file by update-openapi-spec-list.js. Do not edit. | ||||
|  * To run it manually execute `node update-openapi-spec-list.js` from .husky | ||||
|  */ | ||||
| export * from './addon-create-update-schema'; | ||||
| export * from './email-schema'; | ||||
| export * from './event-schema'; | ||||
| export * from './group-schema'; | ||||
| export * from './login-schema'; | ||||
| export * from './patch-schema'; | ||||
| export * from './state-schema'; | ||||
| export * from './users-schema'; | ||||
| export * from './addons-schema'; | ||||
| export * from './events-schema'; | ||||
| export * from './groups-schema'; | ||||
| export * from './splash-request-schema'; | ||||
| export * from './splash-response-schema'; | ||||
| export * from './feature-schema'; | ||||
| export * from './patches-schema'; | ||||
| export * from './profile-schema'; | ||||
| export * from './project-schema'; | ||||
| export * from './segment-schema'; | ||||
| export * from './variant-schema'; | ||||
| export * from './variant-flag-schema'; | ||||
| export * from './version-schema'; | ||||
| export * from './features-schema'; | ||||
| export * from './feedback-create-schema'; | ||||
| export * from './feedback-update-schema'; | ||||
| export * from './feedback-response-schema'; | ||||
| export * from './override-schema'; | ||||
| export * from './password-schema'; | ||||
| export * from './projects-schema'; | ||||
| export * from './strategy-schema'; | ||||
| export * from './tag-type-schema'; | ||||
| export * from './variants-schema'; | ||||
| export * from './api-token-schema'; | ||||
| export * from './tag-types-schema'; | ||||
| export * from './ui-config-schema'; | ||||
| export * from './addon-parameter-schema'; | ||||
| export * from './addon-schema'; | ||||
| export * from './addon-type-schema'; | ||||
| export * from './addons-schema'; | ||||
| export * from './admin-count-schema'; | ||||
| export * from './admin-features-query-schema'; | ||||
| export * from './admin-segment-schema'; | ||||
| export * from './advanced-playground-environment-feature-schema'; | ||||
| export * from './advanced-playground-feature-schema'; | ||||
| export * from './advanced-playground-request-schema'; | ||||
| export * from './advanced-playground-response-schema'; | ||||
| export * from './api-token-schema'; | ||||
| export * from './api-tokens-schema'; | ||||
| export * from './constraint-schema'; | ||||
| export * from './edge-token-schema'; | ||||
| export * from './parameters-schema'; | ||||
| export * from './permission-schema'; | ||||
| export * from './sort-order-schema'; | ||||
| export * from './strategies-schema'; | ||||
| export * from './token-user-schema'; | ||||
| export * from './application-environment-instances-schema'; | ||||
| export * from './application-environment-issues-schema'; | ||||
| export * from './application-overview-environment-schema'; | ||||
| export * from './application-overview-issues-schema'; | ||||
| export * from './application-overview-schema'; | ||||
| export * from './application-schema'; | ||||
| export * from './create-user-schema'; | ||||
| export * from './environment-schema'; | ||||
| export * from './feature-tag-schema'; | ||||
| export * from './legal-value-schema'; | ||||
| export * from './sdk-context-schema'; | ||||
| export * from './sdk-flat-context-schema'; | ||||
| export * from './update-user-schema'; | ||||
| export * from './application-usage-schema'; | ||||
| export * from './applications-schema'; | ||||
| export * from './environments-schema'; | ||||
| export * from './feature-type-schema'; | ||||
| export * from './health-check-schema'; | ||||
| export * from './proxy-client-schema'; | ||||
| export * from './users-search-schema'; | ||||
| export * from './batch-features-schema'; | ||||
| export * from './batch-stale-schema'; | ||||
| export * from './bulk-metrics-schema'; | ||||
| export * from './bulk-registration-schema'; | ||||
| export * from './bulk-toggle-features-schema'; | ||||
| export * from './change-password-schema'; | ||||
| export * from './client-application-schema'; | ||||
| export * from './client-feature-schema'; | ||||
| export * from './client-features-query-schema'; | ||||
| export * from './client-features-schema'; | ||||
| export * from './client-metrics-env-schema'; | ||||
| export * from './client-metrics-schema'; | ||||
| export * from './client-segment-schema'; | ||||
| export * from './clone-feature-schema'; | ||||
| export * from './constraint-schema'; | ||||
| export * from './context-field-schema'; | ||||
| export * from './context-field-strategies-schema'; | ||||
| export * from './context-fields-schema'; | ||||
| export * from './create-api-token-schema'; | ||||
| export * from './create-application-schema'; | ||||
| export * from './create-context-field-schema'; | ||||
| export * from './create-dependent-feature-schema'; | ||||
| export * from './create-feature-naming-pattern-schema'; | ||||
| export * from './create-feature-schema'; | ||||
| export * from './create-feature-strategy-schema'; | ||||
| export * from './create-group-schema'; | ||||
| export * from './create-invited-user-schema'; | ||||
| export * from './create-pat-schema'; | ||||
| export * from './create-strategy-schema'; | ||||
| export * from './create-strategy-variant-schema'; | ||||
| export * from './create-user-response-schema'; | ||||
| export * from './create-user-schema'; | ||||
| export * from './date-schema'; | ||||
| export * from './dependencies-exist-schema'; | ||||
| export * from './dependent-feature-schema'; | ||||
| export * from './deprecated-project-overview-schema'; | ||||
| export * from './dora-features-schema'; | ||||
| export * from './edge-token-schema'; | ||||
| export * from './email-schema'; | ||||
| export * from './environment-project-schema'; | ||||
| export * from './environment-schema'; | ||||
| export * from './environments-project-schema'; | ||||
| export * from './environments-schema'; | ||||
| export * from './event-schema'; | ||||
| export * from './events-schema'; | ||||
| export * from './export-query-schema'; | ||||
| export * from './export-result-schema'; | ||||
| export * from './feature-dependencies-schema'; | ||||
| export * from './feature-environment-metrics-schema'; | ||||
| export * from './feature-environment-schema'; | ||||
| export * from './feature-events-schema'; | ||||
| export * from './feature-metrics-schema'; | ||||
| export * from './feature-schema'; | ||||
| export * from './feature-search-response-schema'; | ||||
| export * from './feature-strategy-schema'; | ||||
| export * from './feature-strategy-segment-schema'; | ||||
| export * from './feature-tag-schema'; | ||||
| export * from './feature-type-count-schema'; | ||||
| export * from './feature-type-schema'; | ||||
| export * from './feature-types-schema'; | ||||
| export * from './feature-usage-schema'; | ||||
| export * from './health-report-schema'; | ||||
| export * from './proxy-feature-schema'; | ||||
| export * from './search-events-schema'; | ||||
| export * from './set-ui-config-schema'; | ||||
| export * from './client-feature-schema'; | ||||
| export * from './client-metrics-schema'; | ||||
| export * from './context-fields-schema'; | ||||
| export * from './create-feature-schema'; | ||||
| export * from './feature-events-schema'; | ||||
| export * from './proxy-features-schema'; | ||||
| export * from './reset-password-schema'; | ||||
| export * from './update-feature-schema'; | ||||
| export * from './addon-parameter-schema'; | ||||
| export * from './change-password-schema'; | ||||
| export * from './client-features-schema'; | ||||
| export * from './feature-metrics-schema'; | ||||
| export * from './health-overview-schema'; | ||||
| export * from './update-tag-type-schema'; | ||||
| export * from './create-strategy-schema'; | ||||
| export * from './update-strategy-schema'; | ||||
| export * from './create-api-token-schema'; | ||||
| export * from './export-query-parameters'; | ||||
| export * from './feature-strategy-schema'; | ||||
| export * from './feature-variants-schema'; | ||||
| export * from './features-schema'; | ||||
| export * from './feedback-create-schema'; | ||||
| export * from './feedback-response-schema'; | ||||
| export * from './feedback-update-schema'; | ||||
| export * from './group-schema'; | ||||
| export * from './group-user-model-schema'; | ||||
| export * from './tag-with-version-schema'; | ||||
| export * from './update-api-token-schema'; | ||||
| export * from './users-groups-base-schema'; | ||||
| export * from './validate-password-schema'; | ||||
| export * from './validate-tag-type-schema'; | ||||
| export * from './validate-feature-schema'; | ||||
| export * from './client-application-schema'; | ||||
| export * from './playground-feature-schema'; | ||||
| export * from './playground-request-schema'; | ||||
| export * from './playground-segment-schema'; | ||||
| export * from './create-invited-user-schema'; | ||||
| export * from './environment-project-schema'; | ||||
| export * from './feature-environment-schema'; | ||||
| export * from './playground-response-schema'; | ||||
| export * from './playground-strategy-schema'; | ||||
| export * from './project-environment-schema'; | ||||
| export * from './public-signup-token-schema'; | ||||
| export * from './environments-project-schema'; | ||||
| export * from './instance-admin-stats-schema'; | ||||
| export * from './public-signup-tokens-schema'; | ||||
| export * from './update-context-field-schema'; | ||||
| export * from './create-context-field-schema'; | ||||
| export * from './validated-edge-tokens-schema'; | ||||
| export * from './client-features-query-schema'; | ||||
| export * from './admin-features-query-schema'; | ||||
| export * from './playground-constraint-schema'; | ||||
| export * from './create-feature-strategy-schema'; | ||||
| export * from './set-strategy-sort-order-schema'; | ||||
| export * from './update-feature-strategy-schema'; | ||||
| export * from './feature-strategy-segment-schema'; | ||||
| export * from './public-signup-token-create-schema'; | ||||
| export * from './public-signup-token-update-schema'; | ||||
| export * from './feature-environment-metrics-schema'; | ||||
| export * from './requests-per-second-schema'; | ||||
| export * from './requests-per-second-segmented-schema'; | ||||
| export * from './export-result-schema'; | ||||
| export * from './export-query-schema'; | ||||
| export * from './push-variants-schema'; | ||||
| export * from './project-stats-schema'; | ||||
| export * from './deprecated-project-overview-schema'; | ||||
| export * from './project-overview-schema'; | ||||
| export * from './groups-schema'; | ||||
| export * from './health-check-schema'; | ||||
| export * from './health-overview-schema'; | ||||
| export * from './health-report-schema'; | ||||
| export * from './id-schema'; | ||||
| export * from './ids-schema'; | ||||
| export * from './import-toggles-schema'; | ||||
| export * from './import-toggles-validate-item-schema'; | ||||
| export * from './import-toggles-validate-schema'; | ||||
| export * from './import-toggles-schema'; | ||||
| export * from './tags-bulk-add-schema'; | ||||
| export * from './upsert-segment-schema'; | ||||
| export * from './batch-features-schema'; | ||||
| export * from './token-string-list-schema'; | ||||
| export * from './bulk-toggle-features-schema'; | ||||
| export * from './admin-count-schema'; | ||||
| export * from './advanced-playground-feature-schema'; | ||||
| export * from './advanced-playground-response-schema'; | ||||
| export * from './advanced-playground-request-schema'; | ||||
| export * from './telemetry-settings-schema'; | ||||
| export * from './create-strategy-variant-schema'; | ||||
| export * from './strategy-variant-schema'; | ||||
| export * from './client-segment-schema'; | ||||
| export * from './update-feature-type-lifetime-schema'; | ||||
| export * from './create-group-schema'; | ||||
| export * from './application-usage-schema'; | ||||
| export * from './dora-features-schema'; | ||||
| export * from './project-dora-metrics-schema'; | ||||
| export * from './admin-segment-schema'; | ||||
| export * from './segments-schema'; | ||||
| export * from './update-feature-strategy-segments-schema'; | ||||
| export * from './dependent-feature-schema'; | ||||
| export * from './create-dependent-feature-schema'; | ||||
| export * from './parent-feature-options-schema'; | ||||
| export * from './feature-dependencies-schema'; | ||||
| export * from './dependencies-exist-schema'; | ||||
| export * from './validate-archive-features-schema'; | ||||
| export * from './search-features-schema'; | ||||
| export * from './feature-search-query-parameters'; | ||||
| export * from './feature-type-count-schema'; | ||||
| export * from './feature-search-response-schema'; | ||||
| export * from './inactive-user-schema'; | ||||
| export * from './inactive-users-schema'; | ||||
| export * from './record-ui-error-schema'; | ||||
| export * from './instance-admin-stats-schema'; | ||||
| export * from './legal-value-schema'; | ||||
| export * from './login-schema'; | ||||
| export * from './maintenance-schema'; | ||||
| export * from './me-schema'; | ||||
| export * from './name-schema'; | ||||
| export * from './override-schema'; | ||||
| export * from './parameters-schema'; | ||||
| export * from './parent-feature-options-schema'; | ||||
| export * from './password-schema'; | ||||
| export * from './pat-schema'; | ||||
| export * from './patch-schema'; | ||||
| export * from './patches-schema'; | ||||
| export * from './pats-schema'; | ||||
| export * from './permission-schema'; | ||||
| export * from './playground-constraint-schema'; | ||||
| export * from './playground-feature-schema'; | ||||
| export * from './playground-request-schema'; | ||||
| export * from './playground-response-schema'; | ||||
| export * from './playground-segment-schema'; | ||||
| export * from './playground-strategy-schema'; | ||||
| export * from './profile-schema'; | ||||
| export * from './project-application-schema'; | ||||
| export * from './project-application-sdk-schema'; | ||||
| export * from './project-applications-schema'; | ||||
| export * from './application-environment-instances-schema'; | ||||
| export * from './project-dora-metrics-schema'; | ||||
| export * from './project-environment-schema'; | ||||
| export * from './project-overview-schema'; | ||||
| export * from './project-schema'; | ||||
| export * from './project-stats-schema'; | ||||
| export * from './projects-schema'; | ||||
| export * from './proxy-client-schema'; | ||||
| export * from './proxy-feature-schema'; | ||||
| export * from './proxy-features-schema'; | ||||
| export * from './public-signup-token-create-schema'; | ||||
| export * from './public-signup-token-schema'; | ||||
| export * from './public-signup-token-update-schema'; | ||||
| export * from './public-signup-tokens-schema'; | ||||
| export * from './push-variants-schema'; | ||||
| export * from './record-ui-error-schema'; | ||||
| export * from './requests-per-second-schema'; | ||||
| export * from './requests-per-second-segmented-schema'; | ||||
| export * from './reset-password-schema'; | ||||
| export * from './resource-limits-schema'; | ||||
| export * from './role-schema'; | ||||
| export * from './roles-schema'; | ||||
| export * from './sdk-context-schema'; | ||||
| export * from './sdk-flat-context-schema'; | ||||
| export * from './search-events-schema'; | ||||
| export * from './search-features-schema'; | ||||
| export * from './segment-schema'; | ||||
| export * from './segment-strategies-schema'; | ||||
| export * from './segments-schema'; | ||||
| export * from './set-strategy-sort-order-schema'; | ||||
| export * from './set-ui-config-schema'; | ||||
| export * from './sort-order-schema'; | ||||
| export * from './splash-request-schema'; | ||||
| export * from './splash-response-schema'; | ||||
| export * from './state-schema'; | ||||
| export * from './strategies-schema'; | ||||
| export * from './strategy-schema'; | ||||
| export * from './strategy-variant-schema'; | ||||
| export * from './tag-schema'; | ||||
| export * from './tag-type-schema'; | ||||
| export * from './tag-types-schema'; | ||||
| export * from './tag-with-version-schema'; | ||||
| export * from './tags-bulk-add-schema'; | ||||
| export * from './tags-schema'; | ||||
| export * from './telemetry-settings-schema'; | ||||
| export * from './toggle-maintenance-schema'; | ||||
| export * from './token-string-list-schema'; | ||||
| export * from './token-user-schema'; | ||||
| export * from './ui-config-schema'; | ||||
| export * from './update-api-token-schema'; | ||||
| export * from './update-context-field-schema'; | ||||
| export * from './update-feature-schema'; | ||||
| export * from './update-feature-strategy-schema'; | ||||
| export * from './update-feature-strategy-segments-schema'; | ||||
| export * from './update-feature-type-lifetime-schema'; | ||||
| export * from './update-strategy-schema'; | ||||
| export * from './update-tag-type-schema'; | ||||
| export * from './update-tags-schema'; | ||||
| export * from './update-user-schema'; | ||||
| export * from './upsert-segment-schema'; | ||||
| export * from './user-schema'; | ||||
| export * from './users-groups-base-schema'; | ||||
| export * from './users-schema'; | ||||
| export * from './users-search-schema'; | ||||
| export * from './validate-archive-features-schema'; | ||||
| export * from './validate-feature-schema'; | ||||
| export * from './validate-password-schema'; | ||||
| export * from './validate-tag-type-schema'; | ||||
| export * from './validated-edge-tokens-schema'; | ||||
| export * from './variant-flag-schema'; | ||||
| export * from './variant-schema'; | ||||
| export * from './variants-schema'; | ||||
| export * from './version-schema'; | ||||
| /** | ||||
|  * Auto-generated file by update-openapi-spec-list.js. Do not edit. | ||||
|  * To run it manually execute `node update-openapi-spec-list.js` from .husky | ||||
|  */ | ||||
|  | ||||
| @ -1,7 +1,6 @@ | ||||
| import { FromSchema } from 'json-schema-to-ts'; | ||||
| import { TAG_MAX_LENGTH, TAG_MIN_LENGTH } from '../../services/tag-schema'; | ||||
| 
 | ||||
| export const TAG_MIN_LENGTH = 2; | ||||
| export const TAG_MAX_LENGTH = 50; | ||||
| export const tagSchema = { | ||||
|     $id: '#/components/schemas/tagSchema', | ||||
|     type: 'object', | ||||
|  | ||||
| @ -1,8 +1,9 @@ | ||||
| import Joi from 'joi'; | ||||
| 
 | ||||
| import { customJoi } from '../routes/util'; | ||||
| import { TAG_MAX_LENGTH, TAG_MIN_LENGTH } from '../../lib/openapi'; | ||||
| 
 | ||||
| export const TAG_MIN_LENGTH = 2; | ||||
| export const TAG_MAX_LENGTH = 50; | ||||
| export const tagSchema = Joi.object() | ||||
|     .keys({ | ||||
|         value: Joi.string().min(TAG_MIN_LENGTH).max(TAG_MAX_LENGTH), | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user