@decaf-ts/decorator-validation 1.7.1 → 1.7.2

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.
Files changed (44) hide show
  1. package/README.md +312 -20
  2. package/dist/decorator-validation.cjs +242 -94
  3. package/dist/decorator-validation.esm.cjs +242 -95
  4. package/lib/constants/validation.cjs +6 -8
  5. package/lib/constants/validation.d.ts +4 -6
  6. package/lib/esm/constants/validation.d.ts +4 -6
  7. package/lib/esm/constants/validation.js +6 -8
  8. package/lib/esm/index.d.ts +8 -1
  9. package/lib/esm/index.js +9 -2
  10. package/lib/esm/model/Model.d.ts +164 -40
  11. package/lib/esm/model/Model.js +165 -41
  12. package/lib/esm/model/construction.d.ts +4 -2
  13. package/lib/esm/model/construction.js +4 -2
  14. package/lib/esm/model/decorators.d.ts +25 -1
  15. package/lib/esm/model/decorators.js +26 -2
  16. package/lib/esm/model/types.d.ts +48 -31
  17. package/lib/esm/model/types.js +1 -1
  18. package/lib/esm/utils/decorators.d.ts +7 -12
  19. package/lib/esm/utils/decorators.js +8 -13
  20. package/lib/esm/validation/Validators/decorators.d.ts +1 -1
  21. package/lib/esm/validation/Validators/decorators.js +2 -2
  22. package/lib/esm/validation/Validators/utils.d.ts +4 -0
  23. package/lib/esm/validation/Validators/utils.js +5 -1
  24. package/lib/esm/validation/decorators.d.ts +20 -26
  25. package/lib/esm/validation/decorators.js +21 -27
  26. package/lib/index.cjs +9 -2
  27. package/lib/index.d.ts +8 -1
  28. package/lib/model/Model.cjs +165 -41
  29. package/lib/model/Model.d.ts +164 -40
  30. package/lib/model/construction.cjs +4 -2
  31. package/lib/model/construction.d.ts +4 -2
  32. package/lib/model/decorators.cjs +26 -2
  33. package/lib/model/decorators.d.ts +25 -1
  34. package/lib/model/types.cjs +1 -1
  35. package/lib/model/types.d.ts +48 -31
  36. package/lib/utils/decorators.cjs +8 -13
  37. package/lib/utils/decorators.d.ts +7 -12
  38. package/lib/validation/Validators/decorators.cjs +2 -2
  39. package/lib/validation/Validators/decorators.d.ts +1 -1
  40. package/lib/validation/Validators/utils.cjs +5 -1
  41. package/lib/validation/Validators/utils.d.ts +4 -0
  42. package/lib/validation/decorators.cjs +21 -27
  43. package/lib/validation/decorators.d.ts +20 -26
  44. package/package.json +1 -1
@@ -10,7 +10,7 @@ import { ModelConstructor } from "../model/types";
10
10
  * @return {PropertyDecorator} A decorator function that can be applied to class properties
11
11
  *
12
12
  * @function required
13
- * @category Decorators
13
+ * @category Property Decorators
14
14
  *
15
15
  * @example
16
16
  * ```typescript
@@ -35,7 +35,7 @@ export declare function required(message?: string): (target: any, propertyKey?:
35
35
  * @return {PropertyDecorator} A decorator function that can be applied to class properties
36
36
  *
37
37
  * @function min
38
- * @category Decorators
38
+ * @category Property Decorators
39
39
  *
40
40
  * @example
41
41
  * ```typescript
@@ -57,7 +57,7 @@ export declare function min(value: number | Date | string, message?: string): (t
57
57
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#MAX}
58
58
  *
59
59
  * @function max
60
- * @category Decorators
60
+ * @category Property Decorators
61
61
  */
62
62
  export declare function max(value: number | Date | string, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
63
63
  /**
@@ -68,7 +68,7 @@ export declare function max(value: number | Date | string, message?: string): (t
68
68
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#STEP}
69
69
  *
70
70
  * @function step
71
- * @category Decorators
71
+ * @category Property Decorators
72
72
  */
73
73
  export declare function step(value: number, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
74
74
  /**
@@ -79,7 +79,7 @@ export declare function step(value: number, message?: string): (target: any, pro
79
79
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#MIN_LENGTH}
80
80
  *
81
81
  * @function minlength
82
- * @category Decorators
82
+ * @category Property Decorators
83
83
  */
84
84
  export declare function minlength(value: number, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
85
85
  /**
@@ -90,7 +90,7 @@ export declare function minlength(value: number, message?: string): (target: any
90
90
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#MAX_LENGTH}
91
91
  *
92
92
  * @function maxlength
93
- * @category Decorators
93
+ * @category Property Decorators
94
94
  */
95
95
  export declare function maxlength(value: number, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
96
96
  /**
@@ -101,7 +101,7 @@ export declare function maxlength(value: number, message?: string): (target: any
101
101
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#PATTERN}
102
102
  *
103
103
  * @function pattern
104
- * @category Decorators
104
+ * @category Property Decorators
105
105
  */
106
106
  export declare function pattern(value: RegExp | string, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
107
107
  /**
@@ -111,7 +111,7 @@ export declare function pattern(value: RegExp | string, message?: string): (targ
111
111
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#EMAIL}
112
112
  *
113
113
  * @function email
114
- * @category Decorators
114
+ * @category Property Decorators
115
115
  */
116
116
  export declare function email(message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
117
117
  /**
@@ -121,7 +121,7 @@ export declare function email(message?: string): (target: any, propertyKey?: any
121
121
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#URL}
122
122
  *
123
123
  * @function url
124
- * @category Decorators
124
+ * @category Property Decorators
125
125
  */
126
126
  export declare function url(message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
127
127
  /**
@@ -132,7 +132,7 @@ export declare function url(message?: string): (target: any, propertyKey?: any,
132
132
  * @param {string} [message] the error message. Defaults to {@link DEFAULT_ERROR_MESSAGES#TYPE}
133
133
  *
134
134
  * @function type
135
- * @category Decorators
135
+ * @category Property Decorators
136
136
  */
137
137
  export declare function type(types: string[] | string, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
138
138
  /**
@@ -146,7 +146,7 @@ export declare function type(types: string[] | string, message?: string): (targe
146
146
  *
147
147
  * @function date
148
148
  *
149
- * @category Decorators
149
+ * @category Property Decorators
150
150
  */
151
151
  export declare function date(format?: string, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
152
152
  /**
@@ -158,7 +158,7 @@ export declare function date(format?: string, message?: string): (target: any, p
158
158
  *
159
159
  * @function password
160
160
  *
161
- * @category Decorators
161
+ * @category Property Decorators
162
162
  */
163
163
  export declare function password(pattern?: RegExp, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
164
164
  /**
@@ -171,7 +171,7 @@ export declare function password(pattern?: RegExp, message?: string): (target: a
171
171
  *
172
172
  * @function list
173
173
  *
174
- * @category Decorators
174
+ * @category Property Decorators
175
175
  */
176
176
  export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
177
177
  /**
@@ -183,7 +183,7 @@ export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any
183
183
  *
184
184
  * @function set
185
185
  *
186
- * @category Decorators
186
+ * @category Property Decorators
187
187
  */
188
188
  export declare function set(clazz: ModelConstructor<any>, message?: string): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
189
189
  /**
@@ -196,8 +196,7 @@ export declare function set(clazz: ModelConstructor<any>, message?: string): (ta
196
196
  * @returns {PropertyDecorator} A property decorator used to register the equality validation metadata.
197
197
  *
198
198
  * @function eq
199
- * @memberOf module:decorator-validation.Decorators.Validation
200
- * @category Decorators
199
+ * @category Property Decorators
201
200
  */
202
201
  export declare function eq(propertyToCompare: string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
203
202
  /**
@@ -210,8 +209,7 @@ export declare function eq(propertyToCompare: string, message?: string): (target
210
209
  * @returns {PropertyDecorator} A property decorator used to register the difference validation metadata.
211
210
  *
212
211
  * @function diff
213
- * @memberOf module:decorator-validation.Decorators.Validation
214
- * @category Decorators
212
+ * @category Property Decorators
215
213
  */
216
214
  export declare function diff(propertyToCompare: string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
217
215
  /**
@@ -224,8 +222,7 @@ export declare function diff(propertyToCompare: string, message?: string): (targ
224
222
  * @returns {PropertyDecorator} A property decorator used to register the less than validation metadata.
225
223
  *
226
224
  * @function lt
227
- * @memberOf module:decorator-validation.Decorators.Validation
228
- * @category Decorators
225
+ * @category Property Decorators
229
226
  */
230
227
  export declare function lt(propertyToCompare: string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
231
228
  /**
@@ -238,8 +235,7 @@ export declare function lt(propertyToCompare: string, message?: string): (target
238
235
  * @returns {PropertyDecorator} A property decorator used to register the less than or equal validation metadata.
239
236
  *
240
237
  * @function lte
241
- * @memberOf module:decorator-validation.Decorators.Validation
242
- * @category Decorators
238
+ * @category Property Decorators
243
239
  */
244
240
  export declare function lte(propertyToCompare: string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
245
241
  /**
@@ -252,8 +248,7 @@ export declare function lte(propertyToCompare: string, message?: string): (targe
252
248
  * @returns {PropertyDecorator} A property decorator used to register the greater than validation metadata.
253
249
  *
254
250
  * @function gt
255
- * @memberOf module:decorator-validation.Decorators.Validation
256
- * @category Decorators
251
+ * @category Property Decorators
257
252
  */
258
253
  export declare function gt(propertyToCompare: string, message?: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
259
254
  /**
@@ -266,7 +261,6 @@ export declare function gt(propertyToCompare: string, message?: string): (target
266
261
  * @returns {PropertyDecorator} A property decorator used to register the greater than or equal validation metadata.
267
262
  *
268
263
  * @function gte
269
- * @memberOf module:decorator-validation.Decorators.Validation
270
- * @category Decorators
264
+ * @category Property Decorators
271
265
  */
272
266
  export declare function gte(propertyToCompare: string, 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.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "simple decorator based validation engine",
5
5
  "type": "module",
6
6
  "exports": {