Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | 63x 63x 63x 63x 63x 63x 63x 63x 63x 63x 63x 63x 63x 63x | import joi from 'joi'; import { featureSchema, featureTagSchema } from '../schema/feature-schema'; import strategySchema from './strategy-schema'; import { tagSchema } from './tag-schema'; import { tagTypeSchema } from './tag-type-schema'; import { projectSchema } from './project-schema'; import { nameType } from '../routes/util'; import { featureStrategySegmentSchema, segmentSchema } from './segment-schema'; export const featureStrategySchema = joi .object() .keys({ id: joi.string().optional(), featureName: joi.string(), projectId: joi.string(), environment: joi.string(), parameters: joi.object().optional().allow(null), constraints: joi.array().optional(), strategyName: joi.string(), }) .options({ stripUnknown: true }); export const featureEnvironmentsSchema = joi.object().keys({ environment: joi.string(), featureName: joi.string(), enabled: joi.boolean(), }); export const environmentSchema = joi.object().keys({ name: nameType, displayName: joi.string().optional().allow(''), type: joi.string().required(), sortOrder: joi.number().optional(), enabled: joi.boolean().optional(), protected: joi.boolean().optional(), }); export const updateEnvironmentSchema = joi.object().keys({ displayName: joi.string().optional().allow(''), type: joi.string().optional(), sortOrder: joi.number().optional(), }); export const sortOrderSchema = joi.object().pattern(/^/, joi.number()); export const stateSchema = joi.object().keys({ version: joi.number(), features: joi.array().optional().items(featureSchema), strategies: joi.array().optional().items(strategySchema), tags: joi.array().optional().items(tagSchema), tagTypes: joi.array().optional().items(tagTypeSchema), featureTags: joi.array().optional().items(featureTagSchema), projects: joi.array().optional().items(projectSchema), featureStrategies: joi.array().optional().items(featureStrategySchema), featureEnvironments: joi .array() .optional() .items(featureEnvironmentsSchema), environments: joi.array().optional().items(environmentSchema), segments: joi.array().optional().items(segmentSchema), featureStrategySegments: joi .array() .optional() .items(featureStrategySegmentSchema), }); |