UNPKG

30.7 kBSource Map (JSON)View Raw
1{"version":3,"file":"ValidationExecutor.js","sourceRoot":"","sources":["../../../src/validation/ValidationExecutor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;GAEG;AACH;IAcE,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,4BAAoB,SAAoB,EAAU,gBAAmC;QAAjE,cAAS,GAAT,SAAS,CAAW;QAAU,qBAAgB,GAAhB,gBAAgB,CAAmB;QAjBrF,4EAA4E;QAC5E,aAAa;QACb,4EAA4E;QAE5E,qBAAgB,GAAmB,EAAE,CAAC;QACtC,2BAAsB,GAAY,KAAK,CAAC;QAExC,4EAA4E;QAC5E,qBAAqB;QACrB,4EAA4E;QAEpE,oBAAe,GAAG,kBAAkB,EAAE,CAAC;IAMyC,CAAC;IAEzF,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E,oCAAO,GAAP,UAAQ,MAAc,EAAE,YAAoB,EAAE,gBAAmC;QAAjF,iBAyEC;;QAxEC;;;;;WAKG;QACH,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,qBAAqB,IAAI,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,mBAAmB,MAAK,IAAI,EAAE;YACtG,OAAO,CAAC,IAAI,CACV,+HAA+H,CAChI,CAAC;SACH;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAChF,IAAM,YAAY,GAAG,CAAC,IAAI,C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AAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QACvE,IAAM,mBAAmB,GAAwB;YAC/C,UAAU,EAAE,UAAU;YACtB,QAAQ,EAAE,QAAQ,CAAC,YAAY;YAC/B,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,QAAQ,CAAC,WAAW;SAClC,CAAC;QAEF,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;QACrC,IACE,CAAC,QAAQ,CAAC,OAAO;YACjB,CAAC,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,EACpG;YACA,IAAI,uBAAuB,IAAI,uBAAuB,CAAC,QAAQ,CAAC,cAAc,YAAY,QAAQ,EAAE;gBAClG,OAAO,GAAG,uBAAuB,CAAC,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;aAChF;SACF;QAED,IAAM,aAAa,GAAG,eAAe,CAAC,2BAA2B,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;QAChG,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC/B,CAAC;IAEO,8CAAiB,GAAzB,UAA0B,QAA4B,EAAE,uBAA4C;QAClG,IAAM,IAAI,GAAG,uBAAuB,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QACpH,OAAO,IAAI,CAAC;IACd,CAAC;IACH,yBAAC;AAAD,CAAC,AA1ZD,IA0ZC","sourcesContent":["import { Validator } from './Validator';\nimport { ValidationError } from './ValidationError';\nimport { ValidationMetadata } from '../metadata/ValidationMetadata';\nimport { ValidatorOptions } from './ValidatorOptions';\nimport { ValidationTypes } from './ValidationTypes';\nimport { ConstraintMetadata } from '../metadata/ConstraintMetadata';\nimport { ValidationArguments } from './ValidationArguments';\nimport { ValidationUtils } from './ValidationUtils';\nimport { isPromise, convertToArray } from '../utils';\nimport { getMetadataStorage } from '../metadata/MetadataStorage';\n\n/**\n * Executes validation over given object.\n */\nexport class ValidationExecutor {\n // -------------------------------------------------------------------------\n // Properties\n // -------------------------------------------------------------------------\n\n awaitingPromises: Promise<any>[] = [];\n ignoreAsyncValidations: boolean = false;\n\n // -------------------------------------------------------------------------\n // Private Properties\n // -------------------------------------------------------------------------\n\n private metadataStorage = getMetadataStorage();\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(private validator: Validator, private validatorOptions?: ValidatorOptions) {}\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n execute(object: object, targetSchema: string, validationErrors: ValidationError[]): void {\n /**\n * If there is no metadata registered it means possibly the dependencies are not flatterned and\n * more than one instance is used.\n *\n * TODO: This needs proper handling, forcing to use the same container or some other proper solution.\n */\n if (!this.metadataStorage.hasValidationMetaData && this.validatorOptions?.enableDebugMessages === true) {\n console.warn(\n `No metadata found. There is more than once class-validator version installed probably. You need to flatten your dependencies.`\n );\n }\n\n const groups = this.validatorOptions ? this.validatorOptions.groups : undefined;\n const strictGroups = (this.validatorOptions && this.validatorOptions.strictGroups) || false;\n const always = (this.validatorOptions && this.validatorOptions.always) || false;\n\n const targetMetadatas = this.metadataStorage.getTargetValidationMetadatas(\n object.constructor,\n targetSchema,\n always,\n strictGroups,\n groups\n );\n const groupedMetadatas = this.metadataStorage.groupByPropertyName(targetMetadatas);\n\n if (this.validatorOptions && this.validatorOptions.forbidUnknownValues && !targetMetadatas.length) {\n const validationError = new ValidationError();\n\n if (\n !this.validatorOptions ||\n !this.validatorOptions.validationError ||\n this.validatorOptions.validationError.target === undefined ||\n this.validatorOptions.validationError.target === true\n )\n validationError.target = object;\n\n validationError.value = undefined;\n validationError.property = undefined;\n validationError.children = [];\n validationError.constraints = { unknownValue: 'an unknown value was passed to the validate function' };\n\n validationErrors.push(validationError);\n\n return;\n }\n\n if (this.validatorOptions && this.validatorOptions.whitelist)\n this.whitelist(object, groupedMetadatas, validationErrors);\n\n // General validation\n Object.keys(groupedMetadatas).forEach(propertyName => {\n const value = (object as any)[propertyName];\n const definedMetadatas = groupedMetadatas[propertyName].filter(\n metadata => metadata.type === ValidationTypes.IS_DEFINED\n );\n const metadatas = groupedMetadatas[propertyName].filter(\n metadata => metadata.type !== ValidationTypes.IS_DEFINED && metadata.type !== ValidationTypes.WHITELIST\n );\n\n if (\n value instanceof Promise &&\n metadatas.find(metadata => metadata.type === ValidationTypes.PROMISE_VALIDATION)\n ) {\n this.awaitingPromises.push(\n value.then(resolvedValue => {\n this.performValidations(object, resolvedValue, propertyName, definedMetadatas, metadatas, validationErrors);\n })\n );\n } else {\n this.performValidations(object, value, propertyName, definedMetadatas, metadatas, validationErrors);\n }\n });\n }\n\n whitelist(\n object: any,\n groupedMetadatas: { [propertyName: string]: ValidationMetadata[] },\n validationErrors: ValidationError[]\n ): void {\n const notAllowedProperties: string[] = [];\n\n Object.keys(object).forEach(propertyName => {\n // does this property have no metadata?\n if (!groupedMetadatas[propertyName] || groupedMetadatas[propertyName].length === 0)\n notAllowedProperties.push(propertyName);\n });\n\n if (notAllowedProperties.length > 0) {\n if (this.validatorOptions && this.validatorOptions.forbidNonWhitelisted) {\n // throw errors\n notAllowedProperties.forEach(property => {\n const validationError: ValidationError = this.generateValidationError(object, object[property], property);\n validationError.constraints = { [ValidationTypes.WHITELIST]: `property ${property} should not exist` };\n validationError.children = undefined;\n validationErrors.push(validationError);\n });\n } else {\n // strip non allowed properties\n notAllowedProperties.forEach(property => delete object[property]);\n }\n }\n }\n\n stripEmptyErrors(errors: ValidationError[]): ValidationError[] {\n return errors.filter(error => {\n if (error.children) {\n error.children = this.stripEmptyErrors(error.children);\n }\n\n if (Object.keys(error.constraints).length === 0) {\n if (error.children.length === 0) {\n return false;\n } else {\n delete error.constraints;\n }\n }\n\n return true;\n });\n }\n\n // -------------------------------------------------------------------------\n // Private Methods\n // -------------------------------------------------------------------------\n\n private performValidations(\n object: any,\n value: any,\n propertyName: string,\n definedMetadatas: ValidationMetadata[],\n metadatas: ValidationMetadata[],\n validationErrors: ValidationError[]\n ): void {\n const customValidationMetadatas = metadatas.filter(metadata => metadata.type === ValidationTypes.CUSTOM_VALIDATION);\n const nestedValidationMetadatas = metadatas.filter(metadata => metadata.type === ValidationTypes.NESTED_VALIDATION);\n const conditionalValidationMetadatas = metadatas.filter(\n metadata => metadata.type === ValidationTypes.CONDITIONAL_VALIDATION\n );\n\n const validationError = this.generateValidationError(object, value, propertyName);\n validationErrors.push(validationError);\n\n const canValidate = this.conditionalValidations(object, value, conditionalValidationMetadatas);\n if (!canValidate) {\n return;\n }\n\n // handle IS_DEFINED validation type the special way - it should work no matter skipUndefinedProperties/skipMissingProperties is set or not\n this.customValidations(object, value, definedMetadatas, validationError);\n this.mapContexts(object, value, definedMetadatas, validationError);\n\n if (value === undefined && this.validatorOptions && this.validatorOptions.skipUndefinedProperties === true) {\n return;\n }\n\n if (value === null && this.validatorOptions && this.validatorOptions.skipNullProperties === true) {\n return;\n }\n\n if (\n (value === null || value === undefined) &&\n this.validatorOptions &&\n this.validatorOptions.skipMissingProperties === true\n ) {\n return;\n }\n\n this.customValidations(object, value, customValidationMetadatas, validationError);\n this.nestedValidations(value, nestedValidationMetadatas, validationError.children);\n\n this.mapContexts(object, value, metadatas, validationError);\n this.mapContexts(object, value, customValidationMetadatas, validationError);\n }\n\n private generateValidationError(object: object, value: any, propertyName: string): ValidationError {\n const validationError = new ValidationError();\n\n if (\n !this.validatorOptions ||\n !this.validatorOptions.validationError ||\n this.validatorOptions.validationError.target === undefined ||\n this.validatorOptions.validationError.target === true\n )\n validationError.target = object;\n\n if (\n !this.validatorOptions ||\n !this.validatorOptions.validationError ||\n this.validatorOptions.validationError.value === undefined ||\n this.validatorOptions.validationError.value === true\n )\n validationError.value = value;\n\n validationError.property = propertyName;\n validationError.children = [];\n validationError.constraints = {};\n\n return validationError;\n }\n\n private conditionalValidations(object: object, value: any, metadatas: ValidationMetadata[]): ValidationMetadata[] {\n return metadatas\n .map(metadata => metadata.constraints[0](object, value))\n .reduce((resultA, resultB) => resultA && resultB, true);\n }\n\n private customValidations(object: object, value: any, metadatas: ValidationMetadata[], error: ValidationError): void {\n metadatas.forEach(metadata => {\n this.metadataStorage.getTargetValidatorConstraints(metadata.constraintCls).forEach(customConstraintMetadata => {\n if (customConstraintMetadata.async && this.ignoreAsyncValidations) return;\n if (\n this.validatorOptions &&\n this.validatorOptions.stopAtFirstError &&\n Object.keys(error.constraints || {}).length > 0\n )\n return;\n\n const validationArguments: ValidationArguments = {\n targetName: object.constructor ? (object.constructor as any).name : undefined,\n property: metadata.propertyName,\n object: object,\n value: value,\n constraints: metadata.constraints,\n };\n\n if (!metadata.each || !(Array.isArray(value) || value instanceof Set || value instanceof Map)) {\n const validatedValue = customConstraintMetadata.instance.validate(value, validationArguments);\n if (isPromise(validatedValue)) {\n const promise = validatedValue.then(isValid => {\n if (!isValid) {\n const [type, message] = this.createValidationError(object, value, metadata, customConstraintMetadata);\n error.constraints[type] = message;\n if (metadata.context) {\n if (!error.contexts) {\n error.contexts = {};\n }\n error.contexts[type] = Object.assign(error.contexts[type] || {}, metadata.context);\n }\n }\n });\n this.awaitingPromises.push(promise);\n } else {\n if (!validatedValue) {\n const [type, message] = this.createValidationError(object, value, metadata, customConstraintMetadata);\n error.constraints[type] = message;\n }\n }\n\n return;\n }\n\n // convert set and map into array\n const arrayValue = convertToArray(value);\n // Validation needs to be applied to each array item\n const validatedSubValues = arrayValue.map((subValue: any) =>\n customConstraintMetadata.instance.validate(subValue, validationArguments)\n );\n const validationIsAsync = validatedSubValues.some((validatedSubValue: boolean | Promise<boolean>) =>\n isPromise(validatedSubValue)\n );\n\n if (validationIsAsync) {\n // Wrap plain values (if any) in promises, so that all are async\n const asyncValidatedSubValues = validatedSubValues.map((validatedSubValue: boolean | Promise<boolean>) =>\n isPromise(validatedSubValue) ? validatedSubValue : Promise.resolve(validatedSubValue)\n );\n const asyncValidationIsFinishedPromise = Promise.all(asyncValidatedSubValues).then(\n (flatValidatedValues: boolean[]) => {\n const validationResult = flatValidatedValues.every((isValid: boolean) => isValid);\n if (!validationResult) {\n const [type, message] = this.createValidationError(object, value, metadata, customConstraintMetadata);\n error.constraints[type] = message;\n if (metadata.context) {\n if (!error.contexts) {\n error.contexts = {};\n }\n error.contexts[type] = Object.assign(error.contexts[type] || {}, metadata.context);\n }\n }\n }\n );\n\n this.awaitingPromises.push(asyncValidationIsFinishedPromise);\n\n return;\n }\n\n const validationResult = validatedSubValues.every((isValid: boolean) => isValid);\n if (!validationResult) {\n const [type, message] = this.createValidationError(object, value, metadata, customConstraintMetadata);\n error.constraints[type] = message;\n }\n });\n });\n }\n\n private nestedValidations(value: any, metadatas: ValidationMetadata[], errors: ValidationError[]): void {\n if (value === void 0) {\n return;\n }\n\n metadatas.forEach(metadata => {\n if (metadata.type !== ValidationTypes.NESTED_VALIDATION && metadata.type !== ValidationTypes.PROMISE_VALIDATION) {\n return;\n }\n\n if (Array.isArray(value) || value instanceof Set || value instanceof Map) {\n // Treats Set as an array - as index of Set value is value itself and it is common case to have Object as value\n const arrayLikeValue = value instanceof Set ? Array.from(value) : value;\n arrayLikeValue.forEach((subValue: any, index: any) => {\n this.performValidations(value, subValue, index.toString(), [], metadatas, errors);\n });\n } else if (value instanceof Object) {\n const targetSchema = typeof metadata.target === 'string' ? metadata.target : metadata.target.name;\n this.execute(value, targetSchema, errors);\n } else {\n const error = new ValidationError();\n error.value = value;\n error.property = metadata.propertyName;\n error.target = metadata.target as object;\n const [type, message] = this.createValidationError(metadata.target as object, value, metadata);\n error.constraints = {\n [type]: message,\n };\n errors.push(error);\n }\n });\n }\n\n private mapContexts(object: object, value: any, metadatas: ValidationMetadata[], error: ValidationError): void {\n return metadatas.forEach(metadata => {\n if (metadata.context) {\n let customConstraint;\n if (metadata.type === ValidationTypes.CUSTOM_VALIDATION) {\n const customConstraints = this.metadataStorage.getTargetValidatorConstraints(metadata.constraintCls);\n customConstraint = customConstraints[0];\n }\n\n const type = this.getConstraintType(metadata, customConstraint);\n\n if (error.constraints[type]) {\n if (!error.contexts) {\n error.contexts = {};\n }\n\n error.contexts[type] = Object.assign(error.contexts[type] || {}, metadata.context);\n }\n }\n });\n }\n\n private createValidationError(\n object: object,\n value: any,\n metadata: ValidationMetadata,\n customValidatorMetadata?: ConstraintMetadata\n ): [string, string] {\n const targetName = object.constructor ? (object.constructor as any).name : undefined;\n const type = this.getConstraintType(metadata, customValidatorMetadata);\n const validationArguments: ValidationArguments = {\n targetName: targetName,\n property: metadata.propertyName,\n object: object,\n value: value,\n constraints: metadata.constraints,\n };\n\n let message = metadata.message || '';\n if (\n !metadata.message &&\n (!this.validatorOptions || (this.validatorOptions && !this.validatorOptions.dismissDefaultMessages))\n ) {\n if (customValidatorMetadata && customValidatorMetadata.instance.defaultMessage instanceof Function) {\n message = customValidatorMetadata.instance.defaultMessage(validationArguments);\n }\n }\n\n const messageString = ValidationUtils.replaceMessageSpecialTokens(message, validationArguments);\n return [type, messageString];\n }\n\n private getConstraintType(metadata: ValidationMetadata, customValidatorMetadata?: ConstraintMetadata): string {\n const type = customValidatorMetadata && customValidatorMetadata.name ? customValidatorMetadata.name : metadata.type;\n return type;\n }\n}\n"]}
\No newline at end of file