@decaf-ts/decorator-validation 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/constants/errors.cjs +1 -0
- package/lib/cjs/constants/errors.cjs.map +1 -0
- package/lib/cjs/constants/index.cjs +1 -0
- package/lib/cjs/constants/index.cjs.map +1 -0
- package/lib/cjs/constants/validation.cjs +1 -0
- package/lib/cjs/constants/validation.cjs.map +1 -0
- package/lib/cjs/index.cjs +2 -1
- package/lib/cjs/index.cjs.map +1 -0
- package/lib/cjs/model/Builder.cjs +49 -48
- package/lib/cjs/model/Builder.cjs.map +1 -0
- package/lib/cjs/model/Model.cjs +31 -30
- package/lib/cjs/model/Model.cjs.map +1 -0
- package/lib/cjs/model/ModelErrorDefinition.cjs +1 -0
- package/lib/cjs/model/ModelErrorDefinition.cjs.map +1 -0
- package/lib/cjs/model/ModelRegistry.cjs +7 -6
- package/lib/cjs/model/ModelRegistry.cjs.map +1 -0
- package/lib/cjs/model/constants.cjs +2 -13
- package/lib/cjs/model/constants.cjs.map +1 -0
- package/lib/cjs/model/construction.cjs +5 -4
- package/lib/cjs/model/construction.cjs.map +1 -0
- package/lib/cjs/model/decorators.cjs +12 -11
- package/lib/cjs/model/decorators.cjs.map +1 -0
- package/lib/cjs/model/index.cjs +1 -0
- package/lib/cjs/model/index.cjs.map +1 -0
- package/lib/cjs/model/types.cjs +1 -0
- package/lib/cjs/model/types.cjs.map +1 -0
- package/lib/cjs/model/utils.cjs +1 -0
- package/lib/cjs/model/utils.cjs.map +1 -0
- package/lib/cjs/model/validation.cjs +33 -32
- package/lib/cjs/model/validation.cjs.map +1 -0
- package/lib/cjs/overrides/Metadata.cjs +1 -0
- package/lib/cjs/overrides/Metadata.cjs.map +1 -0
- package/lib/cjs/overrides/index.cjs +1 -0
- package/lib/cjs/overrides/index.cjs.map +1 -0
- package/lib/cjs/overrides/overrides.cjs +20 -19
- package/lib/cjs/overrides/overrides.cjs.map +1 -0
- package/lib/cjs/overrides/types.cjs +1 -0
- package/lib/cjs/overrides/types.cjs.map +1 -0
- package/lib/cjs/types/index.cjs +1 -0
- package/lib/cjs/types/index.cjs.map +1 -0
- package/lib/cjs/types/validation.cjs +1 -0
- package/lib/cjs/types/{validation.js.map → validation.cjs.map} +1 -1
- package/lib/cjs/utils/DateBuilder.cjs +1 -0
- package/lib/cjs/utils/DateBuilder.cjs.map +1 -0
- package/lib/cjs/utils/PathProxy.cjs +9 -8
- package/lib/cjs/utils/PathProxy.cjs.map +1 -0
- package/lib/cjs/utils/constants.cjs +2 -21
- package/lib/cjs/utils/constants.cjs.map +1 -0
- package/lib/cjs/utils/dates.cjs +9 -8
- package/lib/cjs/utils/dates.cjs.map +1 -0
- package/lib/cjs/utils/equality.cjs +1 -0
- package/lib/cjs/utils/equality.cjs.map +1 -0
- package/lib/cjs/utils/hashing.cjs +6 -3
- package/lib/cjs/utils/hashing.cjs.map +1 -0
- package/lib/cjs/utils/index.cjs +1 -0
- package/lib/cjs/utils/index.cjs.map +1 -0
- package/lib/cjs/utils/registry.cjs +1 -0
- package/lib/cjs/utils/registry.cjs.map +1 -0
- package/lib/cjs/utils/serialization.cjs +3 -2
- package/lib/cjs/utils/serialization.cjs.map +1 -0
- package/lib/cjs/utils/serializers.cjs +8 -7
- package/lib/cjs/utils/serializers.cjs.map +1 -0
- package/lib/cjs/utils/strings.cjs +1 -0
- package/lib/cjs/utils/strings.cjs.map +1 -0
- package/lib/cjs/utils/types.cjs +1 -0
- package/lib/cjs/utils/types.cjs.map +1 -0
- package/lib/cjs/validation/Validation.cjs +9 -8
- package/lib/cjs/validation/Validation.cjs.map +1 -0
- package/lib/cjs/validation/Validators/AsyncValidator.cjs +5 -4
- package/lib/cjs/validation/Validators/AsyncValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/BaseValidator.cjs +8 -7
- package/lib/cjs/validation/Validators/BaseValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/DateValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/DateValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/DiffValidator.cjs +21 -15
- package/lib/cjs/validation/Validators/DiffValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/EmailValidator.cjs +18 -12
- package/lib/cjs/validation/Validators/EmailValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/EqualsValidator.cjs +21 -15
- package/lib/cjs/validation/Validators/EqualsValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/GreaterThanOrEqualValidator.cjs +24 -18
- package/lib/cjs/validation/Validators/GreaterThanOrEqualValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/GreaterThanValidator.cjs +21 -15
- package/lib/cjs/validation/Validators/GreaterThanValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/LessThanOrEqualValidator.cjs +24 -18
- package/lib/cjs/validation/Validators/LessThanOrEqualValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/LessThanValidator.cjs +21 -15
- package/lib/cjs/validation/Validators/LessThanValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/ListValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/ListValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/MaxLengthValidator.cjs +19 -13
- package/lib/cjs/validation/Validators/MaxLengthValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/MaxValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/MaxValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/MinLengthValidator.cjs +19 -13
- package/lib/cjs/validation/Validators/MinLengthValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/MinValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/MinValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/OptionValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/OptionValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/PasswordValidator.cjs +18 -12
- package/lib/cjs/validation/Validators/PasswordValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/PatternValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/PatternValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/RequiredValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/RequiredValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/StepValidator.cjs +17 -11
- package/lib/cjs/validation/Validators/StepValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/TypeValidator.cjs +23 -17
- package/lib/cjs/validation/Validators/TypeValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/URLValidator.cjs +18 -12
- package/lib/cjs/validation/Validators/URLValidator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/Validator.cjs +5 -4
- package/lib/cjs/validation/Validators/Validator.cjs.map +1 -0
- package/lib/cjs/validation/Validators/ValidatorRegistry.cjs +4 -3
- package/lib/cjs/validation/Validators/ValidatorRegistry.cjs.map +1 -0
- package/lib/cjs/validation/Validators/constants.cjs +3 -2
- package/lib/cjs/validation/Validators/constants.cjs.map +1 -0
- package/lib/cjs/validation/Validators/decorators.cjs +5 -4
- package/lib/cjs/validation/Validators/decorators.cjs.map +1 -0
- package/lib/cjs/validation/Validators/index.cjs +1 -0
- package/lib/cjs/validation/Validators/index.cjs.map +1 -0
- package/lib/cjs/validation/Validators/utils.cjs +14 -13
- package/lib/cjs/validation/Validators/utils.cjs.map +1 -0
- package/lib/cjs/validation/decorators.cjs +70 -69
- package/lib/cjs/validation/decorators.cjs.map +1 -0
- package/lib/cjs/validation/index.cjs +1 -0
- package/lib/cjs/validation/index.cjs.map +1 -0
- package/lib/cjs/validation/types.cjs +2 -1
- package/lib/cjs/validation/types.cjs.map +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/types/constants/errors.d.cts +17 -0
- package/lib/types/constants/errors.d.mts +17 -0
- package/lib/types/constants/index.d.cts +2 -0
- package/lib/types/constants/index.d.mts +2 -0
- package/lib/types/constants/validation.d.cts +16 -0
- package/lib/types/constants/validation.d.mts +16 -0
- package/lib/types/index.d.cts +20 -0
- package/lib/types/index.d.mts +20 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/model/Builder.d.cts +86 -0
- package/lib/types/model/Builder.d.mts +86 -0
- package/lib/types/model/Model.d.cts +286 -0
- package/lib/types/model/Model.d.mts +286 -0
- package/lib/types/model/ModelErrorDefinition.d.cts +22 -0
- package/lib/types/model/ModelErrorDefinition.d.mts +22 -0
- package/lib/types/model/ModelRegistry.d.cts +181 -0
- package/lib/types/model/ModelRegistry.d.mts +181 -0
- package/lib/types/model/constants.d.cts +65 -0
- package/lib/types/model/constants.d.mts +65 -0
- package/lib/types/model/construction.d.cts +46 -0
- package/lib/types/model/construction.d.mts +46 -0
- package/lib/types/model/decorators.d.cts +47 -0
- package/lib/types/model/decorators.d.mts +47 -0
- package/lib/types/model/index.d.cts +10 -0
- package/lib/types/model/index.d.mts +10 -0
- package/lib/types/model/types.d.cts +145 -0
- package/lib/types/model/types.d.mts +145 -0
- package/lib/types/model/utils.d.cts +13 -0
- package/lib/types/model/utils.d.mts +13 -0
- package/lib/types/model/validation.d.cts +92 -0
- package/lib/types/model/validation.d.mts +92 -0
- package/lib/types/overrides/Metadata.d.cts +132 -0
- package/lib/types/overrides/Metadata.d.mts +132 -0
- package/lib/types/overrides/index.d.cts +4 -0
- package/lib/types/overrides/index.d.mts +4 -0
- package/lib/types/overrides/overrides.d.cts +1 -0
- package/lib/types/overrides/overrides.d.mts +1 -0
- package/lib/types/overrides/types.d.cts +17 -0
- package/lib/types/overrides/types.d.mts +17 -0
- package/lib/types/types/index.d.cts +1 -0
- package/lib/types/types/index.d.mts +1 -0
- package/lib/types/types/validation.d.cts +28 -0
- package/lib/types/types/validation.d.mts +28 -0
- package/lib/types/utils/DateBuilder.d.cts +121 -0
- package/lib/types/utils/DateBuilder.d.mts +121 -0
- package/lib/types/utils/PathProxy.d.cts +43 -0
- package/lib/types/utils/PathProxy.d.mts +43 -0
- package/lib/types/utils/constants.d.cts +32 -0
- package/lib/types/utils/constants.d.mts +32 -0
- package/lib/types/utils/dates.d.cts +86 -0
- package/lib/types/utils/dates.d.mts +86 -0
- package/lib/types/utils/equality.d.cts +56 -0
- package/lib/types/utils/equality.d.mts +56 -0
- package/lib/types/utils/hashing.d.cts +82 -0
- package/lib/types/utils/hashing.d.mts +82 -0
- package/lib/types/utils/index.d.cts +11 -0
- package/lib/types/utils/index.d.mts +11 -0
- package/lib/types/utils/registry.d.cts +68 -0
- package/lib/types/utils/registry.d.mts +68 -0
- package/lib/types/utils/serialization.d.cts +12 -0
- package/lib/types/utils/serialization.d.mts +12 -0
- package/lib/types/utils/serializers.d.cts +41 -0
- package/lib/types/utils/serializers.d.mts +41 -0
- package/lib/types/utils/strings.d.cts +25 -0
- package/lib/types/utils/strings.d.mts +25 -0
- package/lib/types/utils/types.d.cts +35 -0
- package/lib/types/utils/types.d.mts +35 -0
- package/lib/types/validation/Validation.d.cts +53 -0
- package/lib/types/validation/Validation.d.mts +53 -0
- package/lib/types/validation/Validators/AsyncValidator.d.cts +72 -0
- package/lib/types/validation/Validators/AsyncValidator.d.mts +72 -0
- package/lib/types/validation/Validators/BaseValidator.d.cts +118 -0
- package/lib/types/validation/Validators/BaseValidator.d.mts +118 -0
- package/lib/types/validation/Validators/DateValidator.d.cts +60 -0
- package/lib/types/validation/Validators/DateValidator.d.mts +60 -0
- package/lib/types/validation/Validators/DiffValidator.d.cts +29 -0
- package/lib/types/validation/Validators/DiffValidator.d.mts +29 -0
- package/lib/types/validation/Validators/EmailValidator.d.cts +60 -0
- package/lib/types/validation/Validators/EmailValidator.d.mts +60 -0
- package/lib/types/validation/Validators/EqualsValidator.d.cts +29 -0
- package/lib/types/validation/Validators/EqualsValidator.d.mts +29 -0
- package/lib/types/validation/Validators/GreaterThanOrEqualValidator.d.cts +29 -0
- package/lib/types/validation/Validators/GreaterThanOrEqualValidator.d.mts +29 -0
- package/lib/types/validation/Validators/GreaterThanValidator.d.cts +29 -0
- package/lib/types/validation/Validators/GreaterThanValidator.d.mts +29 -0
- package/lib/types/validation/Validators/LessThanOrEqualValidator.d.cts +29 -0
- package/lib/types/validation/Validators/LessThanOrEqualValidator.d.mts +29 -0
- package/lib/types/validation/Validators/LessThanValidator.d.cts +29 -0
- package/lib/types/validation/Validators/LessThanValidator.d.mts +29 -0
- package/lib/types/validation/Validators/ListValidator.d.cts +66 -0
- package/lib/types/validation/Validators/ListValidator.d.mts +66 -0
- package/lib/types/validation/Validators/MaxLengthValidator.d.cts +29 -0
- package/lib/types/validation/Validators/MaxLengthValidator.d.mts +29 -0
- package/lib/types/validation/Validators/MaxValidator.d.cts +74 -0
- package/lib/types/validation/Validators/MaxValidator.d.mts +74 -0
- package/lib/types/validation/Validators/MinLengthValidator.d.cts +29 -0
- package/lib/types/validation/Validators/MinLengthValidator.d.mts +29 -0
- package/lib/types/validation/Validators/MinValidator.d.cts +74 -0
- package/lib/types/validation/Validators/MinValidator.d.mts +74 -0
- package/lib/types/validation/Validators/OptionValidator.d.cts +29 -0
- package/lib/types/validation/Validators/OptionValidator.d.mts +29 -0
- package/lib/types/validation/Validators/PasswordValidator.d.cts +28 -0
- package/lib/types/validation/Validators/PasswordValidator.d.mts +28 -0
- package/lib/types/validation/Validators/PatternValidator.d.cts +103 -0
- package/lib/types/validation/Validators/PatternValidator.d.mts +103 -0
- package/lib/types/validation/Validators/RequiredValidator.d.cts +74 -0
- package/lib/types/validation/Validators/RequiredValidator.d.mts +74 -0
- package/lib/types/validation/Validators/StepValidator.d.cts +29 -0
- package/lib/types/validation/Validators/StepValidator.d.mts +29 -0
- package/lib/types/validation/Validators/TypeValidator.d.cts +79 -0
- package/lib/types/validation/Validators/TypeValidator.d.mts +79 -0
- package/lib/types/validation/Validators/URLValidator.d.cts +61 -0
- package/lib/types/validation/Validators/URLValidator.d.mts +61 -0
- package/lib/types/validation/Validators/Validator.d.cts +65 -0
- package/lib/types/validation/Validators/Validator.d.mts +65 -0
- package/lib/types/validation/Validators/ValidatorRegistry.d.cts +41 -0
- package/lib/types/validation/Validators/ValidatorRegistry.d.mts +41 -0
- package/lib/types/validation/Validators/constants.d.cts +157 -0
- package/lib/types/validation/Validators/constants.d.mts +157 -0
- package/lib/types/validation/Validators/decorators.d.cts +12 -0
- package/lib/types/validation/Validators/decorators.d.mts +12 -0
- package/lib/types/validation/Validators/index.d.cts +26 -0
- package/lib/types/validation/Validators/index.d.mts +26 -0
- package/lib/types/validation/Validators/utils.d.cts +75 -0
- package/lib/types/validation/Validators/utils.d.mts +75 -0
- package/lib/types/validation/decorators.d.cts +313 -0
- package/lib/types/validation/decorators.d.mts +313 -0
- package/lib/types/validation/index.d.cts +9 -0
- package/lib/types/validation/index.d.mts +9 -0
- package/lib/types/validation/types.d.cts +309 -0
- package/lib/types/validation/types.d.mts +309 -0
- package/package.json +4 -4
- package/lib/cjs/constants/errors.js.map +0 -1
- package/lib/cjs/constants/index.js.map +0 -1
- package/lib/cjs/constants/validation.js.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/model/Builder.js.map +0 -1
- package/lib/cjs/model/Model.js.map +0 -1
- package/lib/cjs/model/ModelErrorDefinition.js.map +0 -1
- package/lib/cjs/model/ModelRegistry.js.map +0 -1
- package/lib/cjs/model/constants.js.map +0 -1
- package/lib/cjs/model/construction.js.map +0 -1
- package/lib/cjs/model/decorators.js.map +0 -1
- package/lib/cjs/model/index.js.map +0 -1
- package/lib/cjs/model/types.js.map +0 -1
- package/lib/cjs/model/utils.js.map +0 -1
- package/lib/cjs/model/validation.js.map +0 -1
- package/lib/cjs/overrides/Metadata.js.map +0 -1
- package/lib/cjs/overrides/index.js.map +0 -1
- package/lib/cjs/overrides/overrides.js.map +0 -1
- package/lib/cjs/overrides/types.js.map +0 -1
- package/lib/cjs/types/index.js.map +0 -1
- package/lib/cjs/utils/DateBuilder.js.map +0 -1
- package/lib/cjs/utils/PathProxy.js.map +0 -1
- package/lib/cjs/utils/constants.js.map +0 -1
- package/lib/cjs/utils/dates.js.map +0 -1
- package/lib/cjs/utils/equality.js.map +0 -1
- package/lib/cjs/utils/hashing.js.map +0 -1
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/cjs/utils/registry.js.map +0 -1
- package/lib/cjs/utils/serialization.js.map +0 -1
- package/lib/cjs/utils/serializers.js.map +0 -1
- package/lib/cjs/utils/strings.js.map +0 -1
- package/lib/cjs/utils/types.js.map +0 -1
- package/lib/cjs/validation/Validation.js.map +0 -1
- package/lib/cjs/validation/Validators/AsyncValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/BaseValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/DateValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/DiffValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/EmailValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/EqualsValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/GreaterThanOrEqualValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/GreaterThanValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/LessThanOrEqualValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/LessThanValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/ListValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/MaxLengthValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/MaxValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/MinLengthValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/MinValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/OptionValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/PasswordValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/PatternValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/RequiredValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/StepValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/TypeValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/URLValidator.js.map +0 -1
- package/lib/cjs/validation/Validators/Validator.js.map +0 -1
- package/lib/cjs/validation/Validators/ValidatorRegistry.js.map +0 -1
- package/lib/cjs/validation/Validators/constants.js.map +0 -1
- package/lib/cjs/validation/Validators/decorators.js.map +0 -1
- package/lib/cjs/validation/Validators/index.js.map +0 -1
- package/lib/cjs/validation/Validators/utils.js.map +0 -1
- package/lib/cjs/validation/decorators.js.map +0 -1
- package/lib/cjs/validation/index.js.map +0 -1
- package/lib/cjs/validation/types.js.map +0 -1
|
@@ -24,12 +24,12 @@ exports.lte = lte;
|
|
|
24
24
|
exports.gt = gt;
|
|
25
25
|
exports.gte = gte;
|
|
26
26
|
exports.option = option;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
27
|
+
const constants_js_1 = require("./Validators/constants.cjs");
|
|
28
|
+
const strings_js_1 = require("./../utils/strings.cjs");
|
|
29
|
+
const dates_js_1 = require("./../utils/dates.cjs");
|
|
30
|
+
const Validation_js_1 = require("./Validation.cjs");
|
|
31
31
|
const decoration_1 = require("@decaf-ts/decoration");
|
|
32
|
-
const
|
|
32
|
+
const index_js_1 = require("./../constants/index.cjs");
|
|
33
33
|
/**
|
|
34
34
|
* @description Combined property decorator factory for metadata and attribute marking
|
|
35
35
|
* @summary Creates a decorator that both marks a property as a model attribute and assigns metadata to it
|
|
@@ -46,15 +46,15 @@ function validationMetadata(decorator, key, value) {
|
|
|
46
46
|
return (0, decoration_1.apply)((0, decoration_1.propMetadata)(key, value));
|
|
47
47
|
}
|
|
48
48
|
function innerValidationDecorator(dec, key, meta) {
|
|
49
|
-
|
|
49
|
+
Validation_js_1.Validation.registerDecorator(key, dec);
|
|
50
50
|
return function innerValidationDecorator(obj, prop) {
|
|
51
|
-
return validationMetadata(dec, `${
|
|
51
|
+
return validationMetadata(dec, `${constants_js_1.ValidationKeys.REFLECT}.${prop}.${key}`, meta)(obj, prop);
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
function async() {
|
|
55
55
|
return (model) => {
|
|
56
|
-
if (!Object.prototype.hasOwnProperty.call(model,
|
|
57
|
-
model[
|
|
56
|
+
if (!Object.prototype.hasOwnProperty.call(model, index_js_1.ASYNC_META_KEY))
|
|
57
|
+
model[index_js_1.ASYNC_META_KEY] = true;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -80,8 +80,8 @@ function async() {
|
|
|
80
80
|
* }
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
|
-
function required(message =
|
|
84
|
-
const key =
|
|
83
|
+
function required(message = constants_js_1.DEFAULT_ERROR_MESSAGES.REQUIRED) {
|
|
84
|
+
const key = constants_js_1.ValidationKeys.REQUIRED;
|
|
85
85
|
const meta = {
|
|
86
86
|
message: message,
|
|
87
87
|
description: `defines the attribute as required`,
|
|
@@ -118,10 +118,10 @@ function required(message = constants_1.DEFAULT_ERROR_MESSAGES.REQUIRED) {
|
|
|
118
118
|
* }
|
|
119
119
|
* ```
|
|
120
120
|
*/
|
|
121
|
-
function min(value, message =
|
|
122
|
-
const key =
|
|
121
|
+
function min(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.MIN) {
|
|
122
|
+
const key = constants_js_1.ValidationKeys.MIN;
|
|
123
123
|
const meta = {
|
|
124
|
-
[
|
|
124
|
+
[constants_js_1.ValidationKeys.MIN]: value,
|
|
125
125
|
message: message,
|
|
126
126
|
description: `defines the max value of the attribute as ${value} (applies to numbers or Dates)`,
|
|
127
127
|
async: false,
|
|
@@ -143,10 +143,10 @@ function min(value, message = constants_1.DEFAULT_ERROR_MESSAGES.MIN) {
|
|
|
143
143
|
* @function max
|
|
144
144
|
* @category Property Decorators
|
|
145
145
|
*/
|
|
146
|
-
function max(value, message =
|
|
147
|
-
const key =
|
|
146
|
+
function max(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.MAX) {
|
|
147
|
+
const key = constants_js_1.ValidationKeys.MAX;
|
|
148
148
|
const meta = {
|
|
149
|
-
[
|
|
149
|
+
[constants_js_1.ValidationKeys.MAX]: value,
|
|
150
150
|
message: message,
|
|
151
151
|
description: `defines the max value of the attribute as ${value} (applies to numbers or Dates)`,
|
|
152
152
|
async: false,
|
|
@@ -168,10 +168,10 @@ function max(value, message = constants_1.DEFAULT_ERROR_MESSAGES.MAX) {
|
|
|
168
168
|
* @function step
|
|
169
169
|
* @category Property Decorators
|
|
170
170
|
*/
|
|
171
|
-
function step(value, message =
|
|
172
|
-
const key =
|
|
171
|
+
function step(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.STEP) {
|
|
172
|
+
const key = constants_js_1.ValidationKeys.STEP;
|
|
173
173
|
const meta = {
|
|
174
|
-
[
|
|
174
|
+
[constants_js_1.ValidationKeys.STEP]: value,
|
|
175
175
|
message: message,
|
|
176
176
|
description: `defines the step of the attribute as ${value}`,
|
|
177
177
|
async: false,
|
|
@@ -193,10 +193,10 @@ function step(value, message = constants_1.DEFAULT_ERROR_MESSAGES.STEP) {
|
|
|
193
193
|
* @function minlength
|
|
194
194
|
* @category Property Decorators
|
|
195
195
|
*/
|
|
196
|
-
function minlength(value, message =
|
|
197
|
-
const key =
|
|
196
|
+
function minlength(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.MIN_LENGTH) {
|
|
197
|
+
const key = constants_js_1.ValidationKeys.MIN_LENGTH;
|
|
198
198
|
const meta = {
|
|
199
|
-
[
|
|
199
|
+
[constants_js_1.ValidationKeys.MIN_LENGTH]: value,
|
|
200
200
|
message: message,
|
|
201
201
|
description: `defines the min length of the attribute as ${value} (applies to strings or lists)`,
|
|
202
202
|
async: false,
|
|
@@ -218,10 +218,10 @@ function minlength(value, message = constants_1.DEFAULT_ERROR_MESSAGES.MIN_LENGT
|
|
|
218
218
|
* @function maxlength
|
|
219
219
|
* @category Property Decorators
|
|
220
220
|
*/
|
|
221
|
-
function maxlength(value, message =
|
|
222
|
-
const key =
|
|
221
|
+
function maxlength(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.MAX_LENGTH) {
|
|
222
|
+
const key = constants_js_1.ValidationKeys.MAX_LENGTH;
|
|
223
223
|
const meta = {
|
|
224
|
-
[
|
|
224
|
+
[constants_js_1.ValidationKeys.MAX_LENGTH]: value,
|
|
225
225
|
message: message,
|
|
226
226
|
description: `defines the max length of the attribute as ${value} (applies to strings or lists)`,
|
|
227
227
|
async: false,
|
|
@@ -243,10 +243,10 @@ function maxlength(value, message = constants_1.DEFAULT_ERROR_MESSAGES.MAX_LENGT
|
|
|
243
243
|
* @function pattern
|
|
244
244
|
* @category Property Decorators
|
|
245
245
|
*/
|
|
246
|
-
function pattern(value, message =
|
|
247
|
-
const key =
|
|
246
|
+
function pattern(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.PATTERN) {
|
|
247
|
+
const key = constants_js_1.ValidationKeys.PATTERN;
|
|
248
248
|
const meta = {
|
|
249
|
-
[
|
|
249
|
+
[constants_js_1.ValidationKeys.PATTERN]: typeof value === "string" ? value : value.toString(),
|
|
250
250
|
message: message,
|
|
251
251
|
description: `assigns the ${value === "string" ? value : value.toString()} pattern to the attribute`,
|
|
252
252
|
async: false,
|
|
@@ -267,10 +267,10 @@ function pattern(value, message = constants_1.DEFAULT_ERROR_MESSAGES.PATTERN) {
|
|
|
267
267
|
* @function email
|
|
268
268
|
* @category Property Decorators
|
|
269
269
|
*/
|
|
270
|
-
function email(message =
|
|
271
|
-
const key =
|
|
270
|
+
function email(message = constants_js_1.DEFAULT_ERROR_MESSAGES.EMAIL) {
|
|
271
|
+
const key = constants_js_1.ValidationKeys.EMAIL;
|
|
272
272
|
const meta = {
|
|
273
|
-
[
|
|
273
|
+
[constants_js_1.ValidationKeys.PATTERN]: constants_js_1.DEFAULT_PATTERNS.EMAIL.toString(),
|
|
274
274
|
message: message,
|
|
275
275
|
description: "marks the attribute as an email",
|
|
276
276
|
async: false,
|
|
@@ -291,10 +291,10 @@ function email(message = constants_1.DEFAULT_ERROR_MESSAGES.EMAIL) {
|
|
|
291
291
|
* @function url
|
|
292
292
|
* @category Property Decorators
|
|
293
293
|
*/
|
|
294
|
-
function url(message =
|
|
295
|
-
const key =
|
|
294
|
+
function url(message = constants_js_1.DEFAULT_ERROR_MESSAGES.URL) {
|
|
295
|
+
const key = constants_js_1.ValidationKeys.URL;
|
|
296
296
|
const meta = {
|
|
297
|
-
[
|
|
297
|
+
[constants_js_1.ValidationKeys.PATTERN]: constants_js_1.DEFAULT_PATTERNS.URL.toString(),
|
|
298
298
|
message: message,
|
|
299
299
|
description: "marks the attribute as an url",
|
|
300
300
|
async: false,
|
|
@@ -317,8 +317,8 @@ function url(message = constants_1.DEFAULT_ERROR_MESSAGES.URL) {
|
|
|
317
317
|
* @category Property Decorators
|
|
318
318
|
*/
|
|
319
319
|
//TODO
|
|
320
|
-
function type(types, message =
|
|
321
|
-
const key =
|
|
320
|
+
function type(types, message = constants_js_1.DEFAULT_ERROR_MESSAGES.TYPE) {
|
|
321
|
+
const key = constants_js_1.ValidationKeys.TYPE;
|
|
322
322
|
const meta = {
|
|
323
323
|
customTypes: types,
|
|
324
324
|
message: message,
|
|
@@ -345,11 +345,11 @@ function type(types, message = constants_1.DEFAULT_ERROR_MESSAGES.TYPE) {
|
|
|
345
345
|
*
|
|
346
346
|
* @category Property Decorators
|
|
347
347
|
*/
|
|
348
|
-
function date(format = "dd-MM-yyyy HH:mm:ss:S", message =
|
|
349
|
-
const key =
|
|
348
|
+
function date(format = "dd-MM-yyyy HH:mm:ss:S", message = constants_js_1.DEFAULT_ERROR_MESSAGES.DATE) {
|
|
349
|
+
const key = constants_js_1.ValidationKeys.DATE;
|
|
350
350
|
function innerDateDec(format, message) {
|
|
351
351
|
const meta = {
|
|
352
|
-
[
|
|
352
|
+
[constants_js_1.ValidationKeys.FORMAT]: format,
|
|
353
353
|
message: message,
|
|
354
354
|
description: `defines the attribute as a date with the format ${format}`,
|
|
355
355
|
async: false,
|
|
@@ -420,11 +420,11 @@ function date(format = "dd-MM-yyyy HH:mm:ss:S", message = constants_1.DEFAULT_ER
|
|
|
420
420
|
set: (newValue) => {
|
|
421
421
|
let val;
|
|
422
422
|
try {
|
|
423
|
-
val = (0,
|
|
423
|
+
val = (0, dates_js_1.parseDate)(format, newValue);
|
|
424
424
|
values.set(this, val);
|
|
425
425
|
}
|
|
426
426
|
catch (e) {
|
|
427
|
-
console.error((0,
|
|
427
|
+
console.error((0, strings_js_1.sf)("Failed to parse date: {0}", e.message || e));
|
|
428
428
|
}
|
|
429
429
|
},
|
|
430
430
|
});
|
|
@@ -455,10 +455,10 @@ function date(format = "dd-MM-yyyy HH:mm:ss:S", message = constants_1.DEFAULT_ER
|
|
|
455
455
|
*
|
|
456
456
|
* @category Property Decorators
|
|
457
457
|
*/
|
|
458
|
-
function password(pattern =
|
|
459
|
-
const key =
|
|
458
|
+
function password(pattern = constants_js_1.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH, message = constants_js_1.DEFAULT_ERROR_MESSAGES.PASSWORD) {
|
|
459
|
+
const key = constants_js_1.ValidationKeys.PASSWORD;
|
|
460
460
|
const meta = {
|
|
461
|
-
[
|
|
461
|
+
[constants_js_1.ValidationKeys.PATTERN]: pattern.toString(),
|
|
462
462
|
message: message,
|
|
463
463
|
description: `attribute as a password`,
|
|
464
464
|
async: false,
|
|
@@ -482,8 +482,8 @@ function password(pattern = constants_1.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_E
|
|
|
482
482
|
*
|
|
483
483
|
* @category Property Decorators
|
|
484
484
|
*/
|
|
485
|
-
function list(clazz, collection = "Array", message =
|
|
486
|
-
const key =
|
|
485
|
+
function list(clazz, collection = "Array", message = constants_js_1.DEFAULT_ERROR_MESSAGES.LIST) {
|
|
486
|
+
const key = constants_js_1.ValidationKeys.LIST;
|
|
487
487
|
const meta = {
|
|
488
488
|
clazz: (Array.isArray(clazz) ? clazz : [clazz]),
|
|
489
489
|
type: collection,
|
|
@@ -509,7 +509,7 @@ function list(clazz, collection = "Array", message = constants_1.DEFAULT_ERROR_M
|
|
|
509
509
|
*
|
|
510
510
|
* @category Property Decorators
|
|
511
511
|
*/
|
|
512
|
-
function set(clazz, message =
|
|
512
|
+
function set(clazz, message = constants_js_1.DEFAULT_ERROR_MESSAGES.LIST) {
|
|
513
513
|
return list(clazz, "Set", message);
|
|
514
514
|
}
|
|
515
515
|
/**
|
|
@@ -531,11 +531,11 @@ function eq(propertyToCompare, options
|
|
|
531
531
|
) {
|
|
532
532
|
const equalsOptions = {
|
|
533
533
|
label: options?.label || propertyToCompare,
|
|
534
|
-
message: options?.message ||
|
|
535
|
-
[
|
|
534
|
+
message: options?.message || constants_js_1.DEFAULT_ERROR_MESSAGES.EQUALS,
|
|
535
|
+
[constants_js_1.ValidationKeys.EQUALS]: propertyToCompare,
|
|
536
536
|
description: `defines attribute as equal to ${propertyToCompare}`,
|
|
537
537
|
};
|
|
538
|
-
return innerValidationDecorator(eq,
|
|
538
|
+
return innerValidationDecorator(eq, constants_js_1.ValidationKeys.EQUALS, {
|
|
539
539
|
...equalsOptions,
|
|
540
540
|
async: false,
|
|
541
541
|
});
|
|
@@ -557,11 +557,11 @@ function eq(propertyToCompare, options
|
|
|
557
557
|
function diff(propertyToCompare, options) {
|
|
558
558
|
const diffOptions = {
|
|
559
559
|
label: options?.label || propertyToCompare,
|
|
560
|
-
message: options?.message ||
|
|
561
|
-
[
|
|
560
|
+
message: options?.message || constants_js_1.DEFAULT_ERROR_MESSAGES.DIFF,
|
|
561
|
+
[constants_js_1.ValidationKeys.DIFF]: propertyToCompare,
|
|
562
562
|
description: `defines attribute as different to ${propertyToCompare}`,
|
|
563
563
|
};
|
|
564
|
-
return innerValidationDecorator(diff,
|
|
564
|
+
return innerValidationDecorator(diff, constants_js_1.ValidationKeys.DIFF, {
|
|
565
565
|
...diffOptions,
|
|
566
566
|
async: false,
|
|
567
567
|
});
|
|
@@ -583,11 +583,11 @@ function diff(propertyToCompare, options) {
|
|
|
583
583
|
function lt(propertyToCompare, options) {
|
|
584
584
|
const ltOptions = {
|
|
585
585
|
label: options?.label || propertyToCompare,
|
|
586
|
-
message: options?.message ||
|
|
587
|
-
[
|
|
586
|
+
message: options?.message || constants_js_1.DEFAULT_ERROR_MESSAGES.LESS_THAN,
|
|
587
|
+
[constants_js_1.ValidationKeys.LESS_THAN]: propertyToCompare,
|
|
588
588
|
description: `defines attribute as less than to ${propertyToCompare}`,
|
|
589
589
|
};
|
|
590
|
-
return innerValidationDecorator(lt,
|
|
590
|
+
return innerValidationDecorator(lt, constants_js_1.ValidationKeys.LESS_THAN, {
|
|
591
591
|
...ltOptions,
|
|
592
592
|
async: false,
|
|
593
593
|
});
|
|
@@ -609,11 +609,11 @@ function lt(propertyToCompare, options) {
|
|
|
609
609
|
function lte(propertyToCompare, options) {
|
|
610
610
|
const lteOptions = {
|
|
611
611
|
label: options?.label || propertyToCompare,
|
|
612
|
-
message: options?.message ||
|
|
613
|
-
[
|
|
612
|
+
message: options?.message || constants_js_1.DEFAULT_ERROR_MESSAGES.LESS_THAN_OR_EQUAL,
|
|
613
|
+
[constants_js_1.ValidationKeys.LESS_THAN_OR_EQUAL]: propertyToCompare,
|
|
614
614
|
description: `defines attribute as less or equal to ${propertyToCompare}`,
|
|
615
615
|
};
|
|
616
|
-
return innerValidationDecorator(lte,
|
|
616
|
+
return innerValidationDecorator(lte, constants_js_1.ValidationKeys.LESS_THAN_OR_EQUAL, {
|
|
617
617
|
...lteOptions,
|
|
618
618
|
async: false,
|
|
619
619
|
});
|
|
@@ -635,11 +635,11 @@ function lte(propertyToCompare, options) {
|
|
|
635
635
|
function gt(propertyToCompare, options) {
|
|
636
636
|
const gtOptions = {
|
|
637
637
|
label: options?.label || propertyToCompare,
|
|
638
|
-
message: options?.message ||
|
|
639
|
-
[
|
|
638
|
+
message: options?.message || constants_js_1.DEFAULT_ERROR_MESSAGES.GREATER_THAN,
|
|
639
|
+
[constants_js_1.ValidationKeys.GREATER_THAN]: propertyToCompare,
|
|
640
640
|
description: `defines attribute as greater than ${propertyToCompare}`,
|
|
641
641
|
};
|
|
642
|
-
return innerValidationDecorator(gt,
|
|
642
|
+
return innerValidationDecorator(gt, constants_js_1.ValidationKeys.GREATER_THAN, {
|
|
643
643
|
...gtOptions,
|
|
644
644
|
async: false,
|
|
645
645
|
});
|
|
@@ -661,11 +661,11 @@ function gt(propertyToCompare, options) {
|
|
|
661
661
|
function gte(propertyToCompare, options) {
|
|
662
662
|
const gteOptions = {
|
|
663
663
|
label: options?.label || propertyToCompare,
|
|
664
|
-
message: options?.message ||
|
|
665
|
-
[
|
|
664
|
+
message: options?.message || constants_js_1.DEFAULT_ERROR_MESSAGES.GREATER_THAN_OR_EQUAL,
|
|
665
|
+
[constants_js_1.ValidationKeys.GREATER_THAN_OR_EQUAL]: propertyToCompare,
|
|
666
666
|
description: `defines attribute as greater or equal to ${propertyToCompare}`,
|
|
667
667
|
};
|
|
668
|
-
return innerValidationDecorator(gte,
|
|
668
|
+
return innerValidationDecorator(gte, constants_js_1.ValidationKeys.GREATER_THAN_OR_EQUAL, {
|
|
669
669
|
...gteOptions,
|
|
670
670
|
async: false,
|
|
671
671
|
});
|
|
@@ -680,10 +680,10 @@ function gte(propertyToCompare, options) {
|
|
|
680
680
|
* @function option
|
|
681
681
|
* @category Property Decorators
|
|
682
682
|
*/
|
|
683
|
-
function option(value, message =
|
|
684
|
-
const key =
|
|
683
|
+
function option(value, message = constants_js_1.DEFAULT_ERROR_MESSAGES.ENUM) {
|
|
684
|
+
const key = constants_js_1.ValidationKeys.ENUM;
|
|
685
685
|
const meta = {
|
|
686
|
-
[
|
|
686
|
+
[constants_js_1.ValidationKeys.ENUM]: value,
|
|
687
687
|
message: message,
|
|
688
688
|
description: `defines a list or an object of accepted values for the attribute`,
|
|
689
689
|
async: false,
|
|
@@ -695,4 +695,5 @@ function option(value, message = constants_1.DEFAULT_ERROR_MESSAGES.ENUM) {
|
|
|
695
695
|
})
|
|
696
696
|
.apply();
|
|
697
697
|
}
|
|
698
|
+
//# sourceMappingURL=decorators.js.map
|
|
698
699
|
//# sourceMappingURL=decorators.js.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AC;AACjB,CAAC;AACD,sCAAsC"}
|
|
@@ -23,4 +23,5 @@ __exportStar(require("./Validators/index.cjs"), exports);
|
|
|
23
23
|
__exportStar(require("./decorators.cjs"), exports);
|
|
24
24
|
__exportStar(require("./types.cjs"), exports);
|
|
25
25
|
__exportStar(require("./Validation.cjs"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,wDAAsC;AACtC,kDAAgC;AAChC,6CAA2B;AAC3B,kDAAgC;AAChC,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;AAAA,oDAAuD;AACvD,iCAAiC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export * from "./model/index.js";
|
|
|
18
18
|
* @const VERSION
|
|
19
19
|
* @memberOf module:decorator-validation
|
|
20
20
|
*/
|
|
21
|
-
export const VERSION = "1.
|
|
21
|
+
export const VERSION = "1.16.0";
|
|
22
22
|
/**
|
|
23
23
|
* @description Current version of the reflection package
|
|
24
24
|
* @summary Stores the semantic version number of the package
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Error messages for comparison validators.
|
|
3
|
+
* @summary Provides a centralized collection of error message templates for comparison-related validation errors.
|
|
4
|
+
* @const COMPARISON_ERROR_MESSAGES
|
|
5
|
+
* @memberOf module:decorator-validation
|
|
6
|
+
*/
|
|
7
|
+
export declare const COMPARISON_ERROR_MESSAGES: {
|
|
8
|
+
INVALID_PATH: string;
|
|
9
|
+
CONTEXT_NOT_OBJECT_COMPARISON: string;
|
|
10
|
+
PROPERTY_INVALID: string;
|
|
11
|
+
PROPERTY_NOT_EXIST: string;
|
|
12
|
+
UNSUPPORTED_TYPES_COMPARISON: string;
|
|
13
|
+
NULL_OR_UNDEFINED_COMPARISON: string;
|
|
14
|
+
INVALID_DATE_COMPARISON: string;
|
|
15
|
+
TYPE_MISMATCH_COMPARISON: string;
|
|
16
|
+
NAN_COMPARISON: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Error messages for comparison validators.
|
|
3
|
+
* @summary Provides a centralized collection of error message templates for comparison-related validation errors.
|
|
4
|
+
* @const COMPARISON_ERROR_MESSAGES
|
|
5
|
+
* @memberOf module:decorator-validation
|
|
6
|
+
*/
|
|
7
|
+
export declare const COMPARISON_ERROR_MESSAGES: {
|
|
8
|
+
INVALID_PATH: string;
|
|
9
|
+
CONTEXT_NOT_OBJECT_COMPARISON: string;
|
|
10
|
+
PROPERTY_INVALID: string;
|
|
11
|
+
PROPERTY_NOT_EXIST: string;
|
|
12
|
+
UNSUPPORTED_TYPES_COMPARISON: string;
|
|
13
|
+
NULL_OR_UNDEFINED_COMPARISON: string;
|
|
14
|
+
INVALID_DATE_COMPARISON: string;
|
|
15
|
+
TYPE_MISMATCH_COMPARISON: string;
|
|
16
|
+
NAN_COMPARISON: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Symbol key for tracking parent-child relationships in validation.
|
|
3
|
+
* @summary Symbol used to internally track the parent object during nested validation.
|
|
4
|
+
*
|
|
5
|
+
* @const VALIDATION_PARENT_KEY
|
|
6
|
+
* @memberOf module:decorator-validation
|
|
7
|
+
*/
|
|
8
|
+
export declare const VALIDATION_PARENT_KEY: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* @description Symbol key for tracking asynchronous validation metadata.
|
|
11
|
+
* @summary Symbol used to identify whether a validation process should be treated as asynchronous.
|
|
12
|
+
*
|
|
13
|
+
* @const ASYNC_META_KEY
|
|
14
|
+
* @memberOf module:decorator-validation
|
|
15
|
+
*/
|
|
16
|
+
export declare const ASYNC_META_KEY: unique symbol;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Symbol key for tracking parent-child relationships in validation.
|
|
3
|
+
* @summary Symbol used to internally track the parent object during nested validation.
|
|
4
|
+
*
|
|
5
|
+
* @const VALIDATION_PARENT_KEY
|
|
6
|
+
* @memberOf module:decorator-validation
|
|
7
|
+
*/
|
|
8
|
+
export declare const VALIDATION_PARENT_KEY: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* @description Symbol key for tracking asynchronous validation metadata.
|
|
11
|
+
* @summary Symbol used to identify whether a validation process should be treated as asynchronous.
|
|
12
|
+
*
|
|
13
|
+
* @const ASYNC_META_KEY
|
|
14
|
+
* @memberOf module:decorator-validation
|
|
15
|
+
*/
|
|
16
|
+
export declare const ASYNC_META_KEY: unique symbol;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./overrides/index.cjs";
|
|
2
|
+
export * from "./constants/index.cjs";
|
|
3
|
+
export * from "./types/index.cjs";
|
|
4
|
+
export * from "./utils/index.cjs";
|
|
5
|
+
export * from "./validation/index.cjs";
|
|
6
|
+
export * from "./model/index.cjs";
|
|
7
|
+
/**
|
|
8
|
+
* @description Current version of the reflection package
|
|
9
|
+
* @summary Stores the semantic version number of the package
|
|
10
|
+
* @const VERSION
|
|
11
|
+
* @memberOf module:decorator-validation
|
|
12
|
+
*/
|
|
13
|
+
export declare const VERSION = "1.16.0";
|
|
14
|
+
/**
|
|
15
|
+
* @description Current version of the reflection package
|
|
16
|
+
* @summary Stores the semantic version number of the package
|
|
17
|
+
* @const PACKAGE_NAME
|
|
18
|
+
* @memberOf module:decorator-validation
|
|
19
|
+
*/
|
|
20
|
+
export declare const PACKAGE_NAME = "@decaf-ts/decorator-validation";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./overrides/index.js";
|
|
2
|
+
export * from "./constants/index.js";
|
|
3
|
+
export * from "./types/index.js";
|
|
4
|
+
export * from "./utils/index.js";
|
|
5
|
+
export * from "./validation/index.js";
|
|
6
|
+
export * from "./model/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* @description Current version of the reflection package
|
|
9
|
+
* @summary Stores the semantic version number of the package
|
|
10
|
+
* @const VERSION
|
|
11
|
+
* @memberOf module:decorator-validation
|
|
12
|
+
*/
|
|
13
|
+
export declare const VERSION = "1.16.0";
|
|
14
|
+
/**
|
|
15
|
+
* @description Current version of the reflection package
|
|
16
|
+
* @summary Stores the semantic version number of the package
|
|
17
|
+
* @const PACKAGE_NAME
|
|
18
|
+
* @memberOf module:decorator-validation
|
|
19
|
+
*/
|
|
20
|
+
export declare const PACKAGE_NAME = "@decaf-ts/decorator-validation";
|
package/lib/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export * from "./model";
|
|
|
10
10
|
* @const VERSION
|
|
11
11
|
* @memberOf module:decorator-validation
|
|
12
12
|
*/
|
|
13
|
-
export declare const VERSION = "1.
|
|
13
|
+
export declare const VERSION = "1.16.0";
|
|
14
14
|
/**
|
|
15
15
|
* @description Current version of the reflection package
|
|
16
16
|
* @summary Stores the semantic version number of the package
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Model } from "./Model.cjs";
|
|
2
|
+
import { ObjectAccumulator } from "typed-object-accumulator";
|
|
3
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
4
|
+
import { ComparisonValidatorOptions } from "../validation/types.cjs";
|
|
5
|
+
import { ExtendedMetadata } from "../overrides/types.cjs";
|
|
6
|
+
type BuildableModel = Model & Record<PropertyKey, any>;
|
|
7
|
+
export interface DecorateOption<M extends Model> {
|
|
8
|
+
decorate(...decorators: PropertyDecorator[]): ModelBuilder<M>;
|
|
9
|
+
}
|
|
10
|
+
export declare class AttributeBuilder<M extends BuildableModel, N extends keyof M, T> implements DecorateOption<M> {
|
|
11
|
+
protected parent: ModelBuilder<M>;
|
|
12
|
+
readonly attr: N;
|
|
13
|
+
readonly declaredType: T;
|
|
14
|
+
constructor(parent: ModelBuilder<M>, attr: N, declaredType: T);
|
|
15
|
+
private decorators;
|
|
16
|
+
decorate(...decorators: PropertyDecorator[]): ModelBuilder<M>;
|
|
17
|
+
undecorate(...decorators: PropertyDecorator[]): ModelBuilder<M>;
|
|
18
|
+
required(messageOrMeta?: string | Record<string, any>): ModelBuilder<M>;
|
|
19
|
+
min(valueOrMeta: number | Date | string | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
20
|
+
max(valueOrMeta: number | Date | string | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
21
|
+
step(valueOrMeta: number | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
22
|
+
minlength(valueOrMeta: number | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
23
|
+
maxlength(valueOrMeta: number | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
24
|
+
pattern(valueOrMeta: RegExp | string | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
25
|
+
email(messageOrMeta?: string | Record<string, any>): ModelBuilder<M>;
|
|
26
|
+
url(messageOrMeta?: string | Record<string, any>): ModelBuilder<M>;
|
|
27
|
+
type(valueOrMeta: Constructor | (() => Constructor) | (Constructor | (() => Constructor))[] | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
28
|
+
date(formatOrMeta?: string | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
29
|
+
password(valueOrMeta?: RegExp | string | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
30
|
+
list(clazzOrMeta: Constructor | (() => Constructor) | (Constructor | (() => Constructor))[] | Record<string, any>, collection?: "Array" | "Set", message?: string): ModelBuilder<M>;
|
|
31
|
+
set(clazzOrMeta: Constructor | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
32
|
+
enum(valueOrMeta: any[] | Record<any, any> | Record<string, any>, message?: string): ModelBuilder<M>;
|
|
33
|
+
option(value: any[] | Record<any, any>, message?: string): ModelBuilder<M>;
|
|
34
|
+
private static isMetadataPayload;
|
|
35
|
+
private static asMeta;
|
|
36
|
+
private static resolveMessage;
|
|
37
|
+
private static patternFromString;
|
|
38
|
+
private resolveComparison;
|
|
39
|
+
equals(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
40
|
+
eq(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
41
|
+
different(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
42
|
+
diff(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
43
|
+
lessThan(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
44
|
+
lt(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
45
|
+
lessThanOrEqual(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
46
|
+
lte(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
47
|
+
greaterThan(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
48
|
+
gt(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
49
|
+
greaterThanOrEqual(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
50
|
+
gte(propertyOrMeta: string | Record<string, any>, options?: Omit<ComparisonValidatorOptions, "async" | "description">): ModelBuilder<M>;
|
|
51
|
+
description(desc: string): ModelBuilder<M>;
|
|
52
|
+
/**
|
|
53
|
+
* Applies the attribute metadata and decorators to the provided constructor.
|
|
54
|
+
*/
|
|
55
|
+
build(constructor: Constructor<M>): void;
|
|
56
|
+
}
|
|
57
|
+
declare class ListAttributeBuilder<M extends BuildableModel, N extends keyof M> {
|
|
58
|
+
private readonly parent;
|
|
59
|
+
private readonly attribute;
|
|
60
|
+
private readonly collection;
|
|
61
|
+
constructor(parent: ModelBuilder<M>, attribute: AttributeBuilder<M, N, any>, collection: "Array" | "Set");
|
|
62
|
+
ofPrimitives(clazz: Constructor | (() => Constructor) | (Constructor | (() => Constructor))[], message?: string): ModelBuilder<M>;
|
|
63
|
+
ofModel<MM extends BuildableModel>(): ModelBuilder<MM>;
|
|
64
|
+
}
|
|
65
|
+
export declare class ModelBuilder<M extends BuildableModel = BuildableModel> extends ObjectAccumulator<M> {
|
|
66
|
+
private attributes;
|
|
67
|
+
private _name?;
|
|
68
|
+
private _description?;
|
|
69
|
+
private _classDecorators;
|
|
70
|
+
private _parent?;
|
|
71
|
+
setName(name: string): this;
|
|
72
|
+
description(desc: string): this;
|
|
73
|
+
decorateClass(decorator: ClassDecorator): this;
|
|
74
|
+
private attribute;
|
|
75
|
+
string<N extends keyof M>(attr: N): AttributeBuilder<M, N, StringConstructor>;
|
|
76
|
+
number<N extends keyof M>(attr: N): AttributeBuilder<M, N, NumberConstructor>;
|
|
77
|
+
date<N extends keyof M>(attr: N): AttributeBuilder<M, N, DateConstructor>;
|
|
78
|
+
bigint<N extends keyof M>(attr: N): AttributeBuilder<M, N, BigIntConstructor>;
|
|
79
|
+
instance<N extends keyof M>(clazz: Constructor<any>, attr: N): AttributeBuilder<M, N, Constructor<any>>;
|
|
80
|
+
model<MM extends Model, N extends keyof M>(attr: N): ModelBuilder<MM>;
|
|
81
|
+
listOf<N extends keyof M>(attr: N, collection?: "Array" | "Set"): ListAttributeBuilder<M, N>;
|
|
82
|
+
build(): Constructor<M>;
|
|
83
|
+
static builder<M extends BuildableModel = BuildableModel>(): ModelBuilder<M>;
|
|
84
|
+
static from<N extends Model, M extends ExtendedMetadata<N>>(meta: M, name?: string): Constructor<N>;
|
|
85
|
+
}
|
|
86
|
+
export {};
|