@decaf-ts/decorator-validation 1.4.4 → 1.4.6
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/dist/decorator-validation.bundle.min.js +1 -1
- package/dist/esm/decorator-validation.bundle.min.esm.js +1 -1
- package/lib/esm/index.d.ts +11 -34
- package/lib/esm/index.js +12 -35
- package/lib/esm/model/Model.d.ts +1 -2
- package/lib/esm/model/Model.js +7 -7
- package/lib/esm/model/constants.d.ts +19 -4
- package/lib/esm/model/constants.js +20 -5
- package/lib/esm/model/construction.d.ts +13 -5
- package/lib/esm/model/construction.js +16 -2
- package/lib/esm/model/decorators.d.ts +7 -5
- package/lib/esm/model/decorators.js +4 -2
- package/lib/esm/model/types.d.ts +6 -0
- package/lib/esm/model/types.js +1 -1
- package/lib/esm/model/validation.js +5 -5
- package/lib/esm/utils/dates.js +2 -2
- package/lib/esm/utils/decorators.d.ts +1 -1
- package/lib/esm/utils/decorators.js +1 -1
- package/lib/esm/validation/Validation.d.ts +4 -0
- package/lib/esm/validation/Validation.js +7 -1
- package/lib/esm/validation/Validators/DateValidator.js +2 -2
- package/lib/esm/validation/Validators/MaxLengthValidator.js +2 -2
- package/lib/esm/validation/Validators/MaxValidator.js +3 -3
- package/lib/esm/validation/Validators/MinLengthValidator.js +2 -2
- package/lib/esm/validation/Validators/MinValidator.js +3 -3
- package/lib/esm/validation/Validators/StepValidator.js +2 -2
- package/lib/esm/validation/Validators/TypeValidator.js +3 -3
- package/lib/esm/validation/Validators/Validator.js +3 -3
- package/lib/esm/validation/Validators/decorators.d.ts +1 -1
- package/lib/esm/validation/decorators.d.ts +13 -13
- package/lib/index.cjs +12 -35
- package/lib/index.d.ts +11 -34
- package/lib/model/Model.cjs +6 -6
- package/lib/model/Model.d.ts +1 -2
- package/lib/model/constants.cjs +20 -5
- package/lib/model/constants.d.ts +19 -4
- package/lib/model/construction.cjs +16 -2
- package/lib/model/construction.d.ts +13 -5
- package/lib/model/decorators.cjs +4 -2
- package/lib/model/decorators.d.ts +7 -5
- package/lib/model/types.cjs +1 -1
- package/lib/model/types.d.ts +6 -0
- package/lib/model/validation.cjs +4 -4
- package/lib/utils/dates.cjs +2 -2
- package/lib/utils/decorators.cjs +1 -1
- package/lib/utils/decorators.d.ts +1 -1
- package/lib/validation/Validation.cjs +7 -1
- package/lib/validation/Validation.d.ts +4 -0
- package/lib/validation/Validators/DateValidator.cjs +2 -2
- package/lib/validation/Validators/MaxLengthValidator.cjs +2 -2
- package/lib/validation/Validators/MaxValidator.cjs +3 -3
- package/lib/validation/Validators/MinLengthValidator.cjs +2 -2
- package/lib/validation/Validators/MinValidator.cjs +3 -3
- package/lib/validation/Validators/StepValidator.cjs +2 -2
- package/lib/validation/Validators/TypeValidator.cjs +3 -3
- package/lib/validation/Validators/Validator.cjs +2 -2
- package/lib/validation/Validators/decorators.d.ts +1 -1
- package/lib/validation/decorators.d.ts +13 -13
- package/package.json +6 -1
|
@@ -10,7 +10,7 @@ import { ModelConstructor } from "../model/types";
|
|
|
10
10
|
*
|
|
11
11
|
* @category Decorators
|
|
12
12
|
*/
|
|
13
|
-
export declare function required(message?: string): (target: object, propertyKey?:
|
|
13
|
+
export declare function required(message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
14
14
|
/**
|
|
15
15
|
* @summary Defines a minimum value for the property
|
|
16
16
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#MIN}
|
|
@@ -22,7 +22,7 @@ export declare function required(message?: string): (target: object, propertyKey
|
|
|
22
22
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
23
23
|
* @category Decorators
|
|
24
24
|
*/
|
|
25
|
-
export declare function min(value: number | Date | string, message?: string): (target: object, propertyKey?:
|
|
25
|
+
export declare function min(value: number | Date | string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
26
26
|
/**
|
|
27
27
|
* @summary Defines a maximum value for the property
|
|
28
28
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#MAX}
|
|
@@ -34,7 +34,7 @@ export declare function min(value: number | Date | string, message?: string): (t
|
|
|
34
34
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
35
35
|
* @category Decorators
|
|
36
36
|
*/
|
|
37
|
-
export declare function max(value: number | Date | string, message?: string): (target: object, propertyKey?:
|
|
37
|
+
export declare function max(value: number | Date | string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
38
38
|
/**
|
|
39
39
|
* @summary Defines a step value for the property
|
|
40
40
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#STEP}
|
|
@@ -46,7 +46,7 @@ export declare function max(value: number | Date | string, message?: string): (t
|
|
|
46
46
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
47
47
|
* @category Decorators
|
|
48
48
|
*/
|
|
49
|
-
export declare function step(value: number, message?: string): (target: object, propertyKey?:
|
|
49
|
+
export declare function step(value: number, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
50
50
|
/**
|
|
51
51
|
* @summary Defines a minimum length for the property
|
|
52
52
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#MIN_LENGTH}
|
|
@@ -58,7 +58,7 @@ export declare function step(value: number, message?: string): (target: object,
|
|
|
58
58
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
59
59
|
* @category Decorators
|
|
60
60
|
*/
|
|
61
|
-
export declare function minlength(value: number, message?: string): (target: object, propertyKey?:
|
|
61
|
+
export declare function minlength(value: number, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
62
62
|
/**
|
|
63
63
|
* @summary Defines a maximum length for the property
|
|
64
64
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#MAX_LENGTH}
|
|
@@ -70,7 +70,7 @@ export declare function minlength(value: number, message?: string): (target: obj
|
|
|
70
70
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
71
71
|
* @category Decorators
|
|
72
72
|
*/
|
|
73
|
-
export declare function maxlength(value: number, message?: string): (target: object, propertyKey?:
|
|
73
|
+
export declare function maxlength(value: number, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
74
74
|
/**
|
|
75
75
|
* @summary Defines a RegExp pattern the property must respect
|
|
76
76
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#PATTERN}
|
|
@@ -82,7 +82,7 @@ export declare function maxlength(value: number, message?: string): (target: obj
|
|
|
82
82
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
83
83
|
* @category Decorators
|
|
84
84
|
*/
|
|
85
|
-
export declare function pattern(value: RegExp | string, message?: string): (target: object, propertyKey?:
|
|
85
|
+
export declare function pattern(value: RegExp | string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
86
86
|
/**
|
|
87
87
|
* @summary Defines the property as an email
|
|
88
88
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#EMAIL}
|
|
@@ -93,7 +93,7 @@ export declare function pattern(value: RegExp | string, message?: string): (targ
|
|
|
93
93
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
94
94
|
* @category Decorators
|
|
95
95
|
*/
|
|
96
|
-
export declare function email(message?: string): (target: object, propertyKey?:
|
|
96
|
+
export declare function email(message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
97
97
|
/**
|
|
98
98
|
* @summary Defines the property as an URL
|
|
99
99
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#URL}
|
|
@@ -104,7 +104,7 @@ export declare function email(message?: string): (target: object, propertyKey?:
|
|
|
104
104
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
105
105
|
* @category Decorators
|
|
106
106
|
*/
|
|
107
|
-
export declare function url(message?: string): (target: object, propertyKey?:
|
|
107
|
+
export declare function url(message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
108
108
|
/**
|
|
109
109
|
* @summary Enforces type verification
|
|
110
110
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#TYPE}
|
|
@@ -116,7 +116,7 @@ export declare function url(message?: string): (target: object, propertyKey?: an
|
|
|
116
116
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
117
117
|
* @category Decorators
|
|
118
118
|
*/
|
|
119
|
-
export declare function type(types: string[] | string, message?: string): (target: object, propertyKey?:
|
|
119
|
+
export declare function type(types: string[] | string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
120
120
|
/**
|
|
121
121
|
* @summary Date Handler Decorator
|
|
122
122
|
* @description Validators to validate a decorated property must use key {@link ValidationKeys#DATE}
|
|
@@ -146,7 +146,7 @@ export declare function date(format?: string, message?: string): (target: Record
|
|
|
146
146
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
147
147
|
* @category Decorators
|
|
148
148
|
*/
|
|
149
|
-
export declare function password(pattern?: RegExp, message?: string): (target: object, propertyKey?:
|
|
149
|
+
export declare function password(pattern?: RegExp, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
150
150
|
/**
|
|
151
151
|
* @summary List Decorator
|
|
152
152
|
* @description Also sets the {@link type} to the provided collection
|
|
@@ -161,7 +161,7 @@ export declare function password(pattern?: RegExp, message?: string): (target: o
|
|
|
161
161
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
162
162
|
* @category Decorators
|
|
163
163
|
*/
|
|
164
|
-
export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): (target: object, propertyKey?:
|
|
164
|
+
export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
|
165
165
|
/**
|
|
166
166
|
* @summary Set Decorator
|
|
167
167
|
* @description Wrapper for {@link list} with the 'Set' Collection
|
|
@@ -175,4 +175,4 @@ export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any
|
|
|
175
175
|
* @memberOf module:decorator-validation.Decorators.Validation
|
|
176
176
|
* @category Decorators
|
|
177
177
|
*/
|
|
178
|
-
export declare function set(clazz: ModelConstructor<any>, message?: string): (target: object, propertyKey?:
|
|
178
|
+
export declare function set(clazz: ModelConstructor<any>, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/decorator-validation",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "simple decorator based validation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -96,5 +96,10 @@
|
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"@decaf-ts/reflection": "latest",
|
|
98
98
|
"reflect-metadata": "^0.2.1"
|
|
99
|
+
},
|
|
100
|
+
"overrides": {
|
|
101
|
+
"gulp-run-command": {
|
|
102
|
+
"cross-spawn": "^7.0.6"
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
}
|