@fluojs/validation 1.0.1 → 1.0.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.
- package/dist/decorators.d.ts +213 -84
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +213 -84
- package/package.json +1 -1
package/dist/decorators.d.ts
CHANGED
|
@@ -36,59 +36,105 @@ export declare function IsBoolean(options?: ValidationDecoratorOptions): FieldDe
|
|
|
36
36
|
*/
|
|
37
37
|
export declare const ValidateIf: (validateIf: (dto: unknown, value: unknown) => boolean | Promise<boolean>, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Validates that the decorated field is neither `null` nor `undefined`.
|
|
40
|
+
*
|
|
41
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
42
|
+
* @returns A field decorator that registers a required-value rule.
|
|
40
43
|
*/
|
|
41
44
|
export declare const IsDefined: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
42
45
|
/**
|
|
43
|
-
*
|
|
46
|
+
* Skips subsequent validators when the decorated field is `null` or `undefined`.
|
|
47
|
+
*
|
|
48
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
49
|
+
* @returns A field decorator that registers optional-value semantics.
|
|
44
50
|
*/
|
|
45
51
|
export declare const IsOptional: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
53
|
+
* Validates that the decorated field strictly equals the expected value.
|
|
54
|
+
*
|
|
55
|
+
* @param value Expected value to compare against the field value.
|
|
56
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
57
|
+
* @returns A field decorator that registers an equality rule.
|
|
48
58
|
*/
|
|
49
59
|
export declare const Equals: (value: unknown, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
50
60
|
/**
|
|
51
|
-
*
|
|
61
|
+
* Validates that the decorated field does not strictly equal the forbidden value.
|
|
62
|
+
*
|
|
63
|
+
* @param value Forbidden value to compare against the field value.
|
|
64
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
65
|
+
* @returns A field decorator that registers an inequality rule.
|
|
52
66
|
*/
|
|
53
67
|
export declare const NotEquals: (value: unknown, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
54
68
|
/**
|
|
55
|
-
*
|
|
69
|
+
* Validates that the decorated field is empty.
|
|
70
|
+
*
|
|
71
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
72
|
+
* @returns A field decorator that registers an empty-value rule.
|
|
56
73
|
*/
|
|
57
74
|
export declare const IsEmpty: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
58
75
|
/**
|
|
59
|
-
*
|
|
76
|
+
* Validates that the decorated field is not empty.
|
|
77
|
+
*
|
|
78
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
79
|
+
* @returns A field decorator that registers a non-empty-value rule.
|
|
60
80
|
*/
|
|
61
81
|
export declare const IsNotEmpty: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
62
82
|
/**
|
|
63
|
-
*
|
|
83
|
+
* Validates that the decorated field is included in the accepted values.
|
|
84
|
+
*
|
|
85
|
+
* @param values Accepted values for the field.
|
|
86
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
87
|
+
* @returns A field decorator that registers an inclusion rule.
|
|
64
88
|
*/
|
|
65
89
|
export declare const IsIn: (values: readonly unknown[], options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
66
90
|
/**
|
|
67
|
-
*
|
|
91
|
+
* Validates that the decorated field is not included in the rejected values.
|
|
92
|
+
*
|
|
93
|
+
* @param values Rejected values for the field.
|
|
94
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
95
|
+
* @returns A field decorator that registers an exclusion rule.
|
|
68
96
|
*/
|
|
69
97
|
export declare const IsNotIn: (values: readonly unknown[], options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
70
98
|
/**
|
|
71
|
-
*
|
|
99
|
+
* Validates that the decorated field is a `Date` value.
|
|
100
|
+
*
|
|
101
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
102
|
+
* @returns A field decorator that registers a date validation rule.
|
|
72
103
|
*/
|
|
73
104
|
export declare const IsDate: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
74
105
|
/**
|
|
75
|
-
*
|
|
106
|
+
* Validates that the decorated field is an array.
|
|
107
|
+
*
|
|
108
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
109
|
+
* @returns A field decorator that registers an array validation rule.
|
|
76
110
|
*/
|
|
77
111
|
export declare const IsArray: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
78
112
|
/**
|
|
79
|
-
*
|
|
113
|
+
* Validates that the decorated field is an object value.
|
|
114
|
+
*
|
|
115
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
116
|
+
* @returns A field decorator that registers an object validation rule.
|
|
80
117
|
*/
|
|
81
118
|
export declare const IsObject: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
82
119
|
/**
|
|
83
|
-
*
|
|
120
|
+
* Validates that the decorated field is an integer.
|
|
121
|
+
*
|
|
122
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
123
|
+
* @returns A field decorator that registers an integer validation rule.
|
|
84
124
|
*/
|
|
85
125
|
export declare const IsInt: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
86
126
|
/**
|
|
87
|
-
*
|
|
127
|
+
* Validates that the decorated field is a positive number.
|
|
128
|
+
*
|
|
129
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
130
|
+
* @returns A field decorator that registers a positive-number rule.
|
|
88
131
|
*/
|
|
89
132
|
export declare const IsPositive: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
90
133
|
/**
|
|
91
|
-
*
|
|
134
|
+
* Validates that the decorated field is a negative number.
|
|
135
|
+
*
|
|
136
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
137
|
+
* @returns A field decorator that registers a negative-number rule.
|
|
92
138
|
*/
|
|
93
139
|
export declare const IsNegative: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
94
140
|
/**
|
|
@@ -100,31 +146,59 @@ export declare const IsNegative: (options?: ValidationDecoratorOptions) => Field
|
|
|
100
146
|
*/
|
|
101
147
|
export declare function IsEnum(values: Record<string, unknown> | readonly unknown[], options?: ValidationDecoratorOptions): FieldDecoratorFn;
|
|
102
148
|
/**
|
|
103
|
-
*
|
|
149
|
+
* Validates that the decorated field is divisible by the given divisor.
|
|
150
|
+
*
|
|
151
|
+
* @param value Divisor used for the numeric divisibility check.
|
|
152
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
153
|
+
* @returns A field decorator that registers a divisibility rule.
|
|
104
154
|
*/
|
|
105
155
|
export declare const IsDivisibleBy: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
106
156
|
/**
|
|
107
|
-
*
|
|
157
|
+
* Validates that the decorated field is greater than or equal to the minimum.
|
|
158
|
+
*
|
|
159
|
+
* @param value Inclusive minimum allowed numeric value.
|
|
160
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
161
|
+
* @returns A field decorator that registers a minimum-value rule.
|
|
108
162
|
*/
|
|
109
163
|
export declare const Min: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
110
164
|
/**
|
|
111
|
-
*
|
|
165
|
+
* Validates that the decorated field is less than or equal to the maximum.
|
|
166
|
+
*
|
|
167
|
+
* @param value Inclusive maximum allowed numeric value.
|
|
168
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
169
|
+
* @returns A field decorator that registers a maximum-value rule.
|
|
112
170
|
*/
|
|
113
171
|
export declare const Max: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
114
172
|
/**
|
|
115
|
-
*
|
|
173
|
+
* Validates that the decorated field is on or after the minimum date.
|
|
174
|
+
*
|
|
175
|
+
* @param value Inclusive minimum allowed date.
|
|
176
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
177
|
+
* @returns A field decorator that registers a minimum-date rule.
|
|
116
178
|
*/
|
|
117
179
|
export declare const MinDate: (value: Date, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
118
180
|
/**
|
|
119
|
-
*
|
|
181
|
+
* Validates that the decorated field is on or before the maximum date.
|
|
182
|
+
*
|
|
183
|
+
* @param value Inclusive maximum allowed date.
|
|
184
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
185
|
+
* @returns A field decorator that registers a maximum-date rule.
|
|
120
186
|
*/
|
|
121
187
|
export declare const MaxDate: (value: Date, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
122
188
|
/**
|
|
123
|
-
*
|
|
189
|
+
* Validates that the decorated field contains the required substring.
|
|
190
|
+
*
|
|
191
|
+
* @param value Required substring.
|
|
192
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
193
|
+
* @returns A field decorator that registers a substring-presence rule.
|
|
124
194
|
*/
|
|
125
195
|
export declare const Contains: (value: string, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
126
196
|
/**
|
|
127
|
-
*
|
|
197
|
+
* Validates that the decorated field does not contain the forbidden substring.
|
|
198
|
+
*
|
|
199
|
+
* @param value Forbidden substring.
|
|
200
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
201
|
+
* @returns A field decorator that registers a substring-exclusion rule.
|
|
128
202
|
*/
|
|
129
203
|
export declare const NotContains: (value: string, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
130
204
|
/**
|
|
@@ -145,11 +219,19 @@ export declare function Length(min: number, max?: number, options?: ValidationDe
|
|
|
145
219
|
*/
|
|
146
220
|
export declare function ValidateNested(dto: Constructor | (() => Constructor), options?: ValidationDecoratorOptions): FieldDecoratorFn;
|
|
147
221
|
/**
|
|
148
|
-
*
|
|
222
|
+
* Validates that the decorated field has at least the given length.
|
|
223
|
+
*
|
|
224
|
+
* @param value Inclusive minimum string length.
|
|
225
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
226
|
+
* @returns A field decorator that registers a minimum-length rule.
|
|
149
227
|
*/
|
|
150
228
|
export declare const MinLength: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
151
229
|
/**
|
|
152
|
-
*
|
|
230
|
+
* Validates that the decorated field has at most the given length.
|
|
231
|
+
*
|
|
232
|
+
* @param value Inclusive maximum string length.
|
|
233
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
234
|
+
* @returns A field decorator that registers a maximum-length rule.
|
|
153
235
|
*/
|
|
154
236
|
export declare const MaxLength: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
155
237
|
/**
|
|
@@ -162,171 +244,199 @@ export declare const MaxLength: (value: number, options?: ValidationDecoratorOpt
|
|
|
162
244
|
*/
|
|
163
245
|
export declare function Matches(pattern: RegExp | string, modifiersOrOptions?: string | ValidationDecoratorOptions, options?: ValidationDecoratorOptions): FieldDecoratorFn;
|
|
164
246
|
/**
|
|
165
|
-
*
|
|
247
|
+
* Validates that the decorated field contains only alphabetic characters.
|
|
166
248
|
*
|
|
167
|
-
* @param options
|
|
249
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
250
|
+
* @returns A field decorator that registers an alphabetic string rule.
|
|
168
251
|
*/
|
|
169
252
|
export declare const IsAlpha: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
170
253
|
/**
|
|
171
|
-
*
|
|
254
|
+
* Validates that the decorated field contains only alphanumeric characters.
|
|
172
255
|
*
|
|
173
|
-
* @param options
|
|
256
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
257
|
+
* @returns A field decorator that registers an alphanumeric string rule.
|
|
174
258
|
*/
|
|
175
259
|
export declare const IsAlphanumeric: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
176
260
|
/**
|
|
177
|
-
*
|
|
261
|
+
* Validates that the decorated field contains only ASCII characters.
|
|
178
262
|
*
|
|
179
|
-
* @param options
|
|
263
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
264
|
+
* @returns A field decorator that registers an ASCII string rule.
|
|
180
265
|
*/
|
|
181
266
|
export declare const IsAscii: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
182
267
|
/**
|
|
183
|
-
*
|
|
268
|
+
* Validates that the decorated field is a Base64 string.
|
|
184
269
|
*
|
|
185
|
-
* @param options
|
|
270
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
271
|
+
* @returns A field decorator that registers a Base64 string rule.
|
|
186
272
|
*/
|
|
187
273
|
export declare const IsBase64: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
188
274
|
/**
|
|
189
|
-
*
|
|
275
|
+
* Validates that the decorated field is a boolean-like string.
|
|
190
276
|
*
|
|
191
|
-
* @param options
|
|
277
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
278
|
+
* @returns A field decorator that registers a boolean-string rule.
|
|
192
279
|
*/
|
|
193
280
|
export declare const IsBooleanString: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
194
281
|
/**
|
|
195
|
-
*
|
|
282
|
+
* Validates that the decorated field is a data URI string.
|
|
196
283
|
*
|
|
197
|
-
* @param options
|
|
284
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
285
|
+
* @returns A field decorator that registers a data URI rule.
|
|
198
286
|
*/
|
|
199
287
|
export declare const IsDataURI: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
200
288
|
/**
|
|
201
|
-
*
|
|
289
|
+
* Validates that the decorated field is a date string.
|
|
202
290
|
*
|
|
203
|
-
* @param options
|
|
291
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
292
|
+
* @returns A field decorator that registers a date-string rule.
|
|
204
293
|
*/
|
|
205
294
|
export declare const IsDateString: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
206
295
|
/**
|
|
207
|
-
*
|
|
296
|
+
* Validates that the decorated field is a decimal string.
|
|
208
297
|
*
|
|
209
|
-
* @param options
|
|
298
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
299
|
+
* @returns A field decorator that registers a decimal-string rule.
|
|
210
300
|
*/
|
|
211
301
|
export declare const IsDecimal: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
212
302
|
/**
|
|
213
|
-
*
|
|
303
|
+
* Validates that the decorated field is an email address.
|
|
214
304
|
*
|
|
215
|
-
* @param options
|
|
305
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
306
|
+
* @returns A field decorator that registers an email-address rule.
|
|
216
307
|
*/
|
|
217
308
|
export declare const IsEmail: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
218
309
|
/**
|
|
219
|
-
*
|
|
310
|
+
* Validates that the decorated field is a fully qualified domain name.
|
|
220
311
|
*
|
|
221
|
-
* @param options
|
|
312
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
313
|
+
* @returns A field decorator that registers an FQDN rule.
|
|
222
314
|
*/
|
|
223
315
|
export declare const IsFQDN: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
224
316
|
/**
|
|
225
|
-
*
|
|
317
|
+
* Validates that the decorated field is a hexadecimal color string.
|
|
226
318
|
*
|
|
227
|
-
* @param options
|
|
319
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
320
|
+
* @returns A field decorator that registers a hex-color rule.
|
|
228
321
|
*/
|
|
229
322
|
export declare const IsHexColor: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
230
323
|
/**
|
|
231
|
-
*
|
|
324
|
+
* Validates that the decorated field is a hexadecimal string.
|
|
232
325
|
*
|
|
233
|
-
* @param options
|
|
326
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
327
|
+
* @returns A field decorator that registers a hexadecimal string rule.
|
|
234
328
|
*/
|
|
235
329
|
export declare const IsHexadecimal: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
236
330
|
/**
|
|
237
|
-
*
|
|
331
|
+
* Validates that the decorated field is a JSON string.
|
|
238
332
|
*
|
|
239
|
-
* @param options
|
|
333
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
334
|
+
* @returns A field decorator that registers a JSON-string rule.
|
|
240
335
|
*/
|
|
241
336
|
export declare const IsJSON: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
242
337
|
/**
|
|
243
|
-
*
|
|
338
|
+
* Validates that the decorated field is a JSON Web Token string.
|
|
244
339
|
*
|
|
245
|
-
* @param options
|
|
340
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
341
|
+
* @returns A field decorator that registers a JWT-string rule.
|
|
246
342
|
*/
|
|
247
343
|
export declare const IsJWT: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
248
344
|
/**
|
|
249
|
-
*
|
|
345
|
+
* Validates that the decorated field is a locale identifier.
|
|
250
346
|
*
|
|
251
|
-
* @param options
|
|
347
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
348
|
+
* @returns A field decorator that registers a locale-string rule.
|
|
252
349
|
*/
|
|
253
350
|
export declare const IsLocale: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
254
351
|
/**
|
|
255
|
-
*
|
|
352
|
+
* Validates that the decorated field is lowercase.
|
|
256
353
|
*
|
|
257
|
-
* @param options
|
|
354
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
355
|
+
* @returns A field decorator that registers a lowercase-string rule.
|
|
258
356
|
*/
|
|
259
357
|
export declare const IsLowercase: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
260
358
|
/**
|
|
261
|
-
*
|
|
359
|
+
* Validates that the decorated field is a magnet URI string.
|
|
262
360
|
*
|
|
263
|
-
* @param options
|
|
361
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
362
|
+
* @returns A field decorator that registers a magnet URI rule.
|
|
264
363
|
*/
|
|
265
364
|
export declare const IsMagnetURI: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
266
365
|
/**
|
|
267
|
-
*
|
|
366
|
+
* Validates that the decorated field is a MIME type string.
|
|
268
367
|
*
|
|
269
|
-
* @param options
|
|
368
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
369
|
+
* @returns A field decorator that registers a MIME type rule.
|
|
270
370
|
*/
|
|
271
371
|
export declare const IsMimeType: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
272
372
|
/**
|
|
273
|
-
*
|
|
373
|
+
* Validates that the decorated field is a MongoDB object ID string.
|
|
274
374
|
*
|
|
275
|
-
* @param options
|
|
375
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
376
|
+
* @returns A field decorator that registers a MongoDB object ID rule.
|
|
276
377
|
*/
|
|
277
378
|
export declare const IsMongoId: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
278
379
|
/**
|
|
279
|
-
*
|
|
380
|
+
* Validates that the decorated field is a numeric string.
|
|
280
381
|
*
|
|
281
|
-
* @param options
|
|
382
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
383
|
+
* @returns A field decorator that registers a numeric-string rule.
|
|
282
384
|
*/
|
|
283
385
|
export declare const IsNumberString: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
284
386
|
/**
|
|
285
|
-
*
|
|
387
|
+
* Validates that the decorated field is a network port string.
|
|
286
388
|
*
|
|
287
|
-
* @param options
|
|
389
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
390
|
+
* @returns A field decorator that registers a port-string rule.
|
|
288
391
|
*/
|
|
289
392
|
export declare const IsPort: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
290
393
|
/**
|
|
291
|
-
*
|
|
394
|
+
* Validates that the decorated field is an RFC 3339 date-time string.
|
|
292
395
|
*
|
|
293
|
-
* @param options
|
|
396
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
397
|
+
* @returns A field decorator that registers an RFC 3339 string rule.
|
|
294
398
|
*/
|
|
295
399
|
export declare const IsRFC3339: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
296
400
|
/**
|
|
297
|
-
*
|
|
401
|
+
* Validates that the decorated field is a semantic version string.
|
|
298
402
|
*
|
|
299
|
-
* @param options
|
|
403
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
404
|
+
* @returns A field decorator that registers a semantic-version rule.
|
|
300
405
|
*/
|
|
301
406
|
export declare const IsSemVer: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
302
407
|
/**
|
|
303
|
-
*
|
|
408
|
+
* Validates that the decorated field is uppercase.
|
|
304
409
|
*
|
|
305
|
-
* @param options
|
|
410
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
411
|
+
* @returns A field decorator that registers an uppercase-string rule.
|
|
306
412
|
*/
|
|
307
413
|
export declare const IsUppercase: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
308
414
|
/**
|
|
309
|
-
*
|
|
415
|
+
* Validates that the decorated field is an ISO 8601 date-time string.
|
|
310
416
|
*
|
|
311
|
-
* @param options
|
|
417
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
418
|
+
* @returns A field decorator that registers an ISO 8601 string rule.
|
|
312
419
|
*/
|
|
313
420
|
export declare const IsISO8601: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
314
421
|
/**
|
|
315
|
-
*
|
|
422
|
+
* Validates that the decorated field is a latitude value.
|
|
316
423
|
*
|
|
317
|
-
* @param options
|
|
424
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
425
|
+
* @returns A field decorator that registers a latitude rule.
|
|
318
426
|
*/
|
|
319
427
|
export declare const IsLatitude: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
320
428
|
/**
|
|
321
|
-
*
|
|
429
|
+
* Validates that the decorated field is a longitude value.
|
|
322
430
|
*
|
|
323
|
-
* @param options
|
|
431
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
432
|
+
* @returns A field decorator that registers a longitude rule.
|
|
324
433
|
*/
|
|
325
434
|
export declare const IsLongitude: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
326
435
|
/**
|
|
327
|
-
*
|
|
436
|
+
* Validates that the decorated field is a latitude/longitude coordinate string.
|
|
328
437
|
*
|
|
329
|
-
* @param options
|
|
438
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
439
|
+
* @returns A field decorator that registers a latitude/longitude rule.
|
|
330
440
|
*/
|
|
331
441
|
export declare const IsLatLong: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
332
442
|
/**
|
|
@@ -399,23 +509,42 @@ export declare function IsUUID(version?: '3' | '4' | '5' | 'all', options?: Vali
|
|
|
399
509
|
*/
|
|
400
510
|
export declare function IsCurrency(options?: ValidationDecoratorOptions): FieldDecoratorFn;
|
|
401
511
|
/**
|
|
402
|
-
*
|
|
512
|
+
* Validates that the decorated array contains all required values.
|
|
513
|
+
*
|
|
514
|
+
* @param values Required values that must be present in the array.
|
|
515
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
516
|
+
* @returns A field decorator that registers an array-contains rule.
|
|
403
517
|
*/
|
|
404
518
|
export declare const ArrayContains: (values: readonly unknown[], options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
405
519
|
/**
|
|
406
|
-
*
|
|
520
|
+
* Validates that the decorated array excludes all forbidden values.
|
|
521
|
+
*
|
|
522
|
+
* @param values Forbidden values that must not be present in the array.
|
|
523
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
524
|
+
* @returns A field decorator that registers an array-exclusion rule.
|
|
407
525
|
*/
|
|
408
526
|
export declare const ArrayNotContains: (values: readonly unknown[], options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
409
527
|
/**
|
|
410
|
-
*
|
|
528
|
+
* Validates that the decorated array is not empty.
|
|
529
|
+
*
|
|
530
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
531
|
+
* @returns A field decorator that registers a non-empty-array rule.
|
|
411
532
|
*/
|
|
412
533
|
export declare const ArrayNotEmpty: (options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
413
534
|
/**
|
|
414
|
-
*
|
|
535
|
+
* Validates that the decorated array has at least the given size.
|
|
536
|
+
*
|
|
537
|
+
* @param value Inclusive minimum array length.
|
|
538
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
539
|
+
* @returns A field decorator that registers a minimum-array-size rule.
|
|
415
540
|
*/
|
|
416
541
|
export declare const ArrayMinSize: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
417
542
|
/**
|
|
418
|
-
*
|
|
543
|
+
* Validates that the decorated array has at most the given size.
|
|
544
|
+
*
|
|
545
|
+
* @param value Inclusive maximum array length.
|
|
546
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
547
|
+
* @returns A field decorator that registers a maximum-array-size rule.
|
|
419
548
|
*/
|
|
420
549
|
export declare const ArrayMaxSize: (value: number, options?: ValidationDecoratorOptions) => FieldDecoratorFn;
|
|
421
550
|
/**
|
package/dist/decorators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,EAErC,KAAK,0BAA0B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAgE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG/H,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAClF,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;AAElH,KAAK,kBAAkB,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAyGtE;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,gBAAgB,CAE/E;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,gBAAgB,CAExG;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,gBAAgB,CAEhF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EACxE,UAAU,0BAA0B,qBACgD,CAAC;AAEvF
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WA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BAAgB,aAAa,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,gBAAgB,CAUlH"}
|
package/dist/decorators.js
CHANGED
|
@@ -127,21 +127,31 @@ export const ValidateIf = (validateIf, options) => createValidationDecorator(()
|
|
|
127
127
|
}));
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* Validates that the decorated field is neither `null` nor `undefined`.
|
|
131
|
+
*
|
|
132
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
133
|
+
* @returns A field decorator that registers a required-value rule.
|
|
131
134
|
*/
|
|
132
135
|
export const IsDefined = createFlagValidationDecorator(options => ({
|
|
133
136
|
kind: 'defined',
|
|
134
137
|
...options
|
|
135
138
|
}));
|
|
136
139
|
/**
|
|
137
|
-
*
|
|
140
|
+
* Skips subsequent validators when the decorated field is `null` or `undefined`.
|
|
141
|
+
*
|
|
142
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
143
|
+
* @returns A field decorator that registers optional-value semantics.
|
|
138
144
|
*/
|
|
139
145
|
export const IsOptional = createFlagValidationDecorator(options => ({
|
|
140
146
|
kind: 'optional',
|
|
141
147
|
...options
|
|
142
148
|
}));
|
|
143
149
|
/**
|
|
144
|
-
*
|
|
150
|
+
* Validates that the decorated field strictly equals the expected value.
|
|
151
|
+
*
|
|
152
|
+
* @param value Expected value to compare against the field value.
|
|
153
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
154
|
+
* @returns A field decorator that registers an equality rule.
|
|
145
155
|
*/
|
|
146
156
|
export const Equals = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
147
157
|
kind: 'equals',
|
|
@@ -149,7 +159,11 @@ export const Equals = createValidationOptionsWithConfigDecorator((value, options
|
|
|
149
159
|
...options
|
|
150
160
|
}));
|
|
151
161
|
/**
|
|
152
|
-
*
|
|
162
|
+
* Validates that the decorated field does not strictly equal the forbidden value.
|
|
163
|
+
*
|
|
164
|
+
* @param value Forbidden value to compare against the field value.
|
|
165
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
166
|
+
* @returns A field decorator that registers an inequality rule.
|
|
153
167
|
*/
|
|
154
168
|
export const NotEquals = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
155
169
|
kind: 'notEquals',
|
|
@@ -157,21 +171,31 @@ export const NotEquals = createValidationOptionsWithConfigDecorator((value, opti
|
|
|
157
171
|
...options
|
|
158
172
|
}));
|
|
159
173
|
/**
|
|
160
|
-
*
|
|
174
|
+
* Validates that the decorated field is empty.
|
|
175
|
+
*
|
|
176
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
177
|
+
* @returns A field decorator that registers an empty-value rule.
|
|
161
178
|
*/
|
|
162
179
|
export const IsEmpty = createFlagValidationDecorator(options => ({
|
|
163
180
|
kind: 'empty',
|
|
164
181
|
...options
|
|
165
182
|
}));
|
|
166
183
|
/**
|
|
167
|
-
*
|
|
184
|
+
* Validates that the decorated field is not empty.
|
|
185
|
+
*
|
|
186
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
187
|
+
* @returns A field decorator that registers a non-empty-value rule.
|
|
168
188
|
*/
|
|
169
189
|
export const IsNotEmpty = createFlagValidationDecorator(options => ({
|
|
170
190
|
kind: 'notEmpty',
|
|
171
191
|
...options
|
|
172
192
|
}));
|
|
173
193
|
/**
|
|
174
|
-
*
|
|
194
|
+
* Validates that the decorated field is included in the accepted values.
|
|
195
|
+
*
|
|
196
|
+
* @param values Accepted values for the field.
|
|
197
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
198
|
+
* @returns A field decorator that registers an inclusion rule.
|
|
175
199
|
*/
|
|
176
200
|
export const IsIn = createArrayValidationDecorator((values, options) => ({
|
|
177
201
|
kind: 'in',
|
|
@@ -179,7 +203,11 @@ export const IsIn = createArrayValidationDecorator((values, options) => ({
|
|
|
179
203
|
...options
|
|
180
204
|
}));
|
|
181
205
|
/**
|
|
182
|
-
*
|
|
206
|
+
* Validates that the decorated field is not included in the rejected values.
|
|
207
|
+
*
|
|
208
|
+
* @param values Rejected values for the field.
|
|
209
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
210
|
+
* @returns A field decorator that registers an exclusion rule.
|
|
183
211
|
*/
|
|
184
212
|
export const IsNotIn = createArrayValidationDecorator((values, options) => ({
|
|
185
213
|
kind: 'notIn',
|
|
@@ -187,42 +215,60 @@ export const IsNotIn = createArrayValidationDecorator((values, options) => ({
|
|
|
187
215
|
...options
|
|
188
216
|
}));
|
|
189
217
|
/**
|
|
190
|
-
*
|
|
218
|
+
* Validates that the decorated field is a `Date` value.
|
|
219
|
+
*
|
|
220
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
221
|
+
* @returns A field decorator that registers a date validation rule.
|
|
191
222
|
*/
|
|
192
223
|
export const IsDate = createFlagValidationDecorator(options => ({
|
|
193
224
|
kind: 'date',
|
|
194
225
|
...options
|
|
195
226
|
}));
|
|
196
227
|
/**
|
|
197
|
-
*
|
|
228
|
+
* Validates that the decorated field is an array.
|
|
229
|
+
*
|
|
230
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
231
|
+
* @returns A field decorator that registers an array validation rule.
|
|
198
232
|
*/
|
|
199
233
|
export const IsArray = createFlagValidationDecorator(options => ({
|
|
200
234
|
kind: 'array',
|
|
201
235
|
...options
|
|
202
236
|
}));
|
|
203
237
|
/**
|
|
204
|
-
*
|
|
238
|
+
* Validates that the decorated field is an object value.
|
|
239
|
+
*
|
|
240
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
241
|
+
* @returns A field decorator that registers an object validation rule.
|
|
205
242
|
*/
|
|
206
243
|
export const IsObject = createFlagValidationDecorator(options => ({
|
|
207
244
|
kind: 'object',
|
|
208
245
|
...options
|
|
209
246
|
}));
|
|
210
247
|
/**
|
|
211
|
-
*
|
|
248
|
+
* Validates that the decorated field is an integer.
|
|
249
|
+
*
|
|
250
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
251
|
+
* @returns A field decorator that registers an integer validation rule.
|
|
212
252
|
*/
|
|
213
253
|
export const IsInt = createFlagValidationDecorator(options => ({
|
|
214
254
|
kind: 'int',
|
|
215
255
|
...options
|
|
216
256
|
}));
|
|
217
257
|
/**
|
|
218
|
-
*
|
|
258
|
+
* Validates that the decorated field is a positive number.
|
|
259
|
+
*
|
|
260
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
261
|
+
* @returns A field decorator that registers a positive-number rule.
|
|
219
262
|
*/
|
|
220
263
|
export const IsPositive = createFlagValidationDecorator(options => ({
|
|
221
264
|
kind: 'positive',
|
|
222
265
|
...options
|
|
223
266
|
}));
|
|
224
267
|
/**
|
|
225
|
-
*
|
|
268
|
+
* Validates that the decorated field is a negative number.
|
|
269
|
+
*
|
|
270
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
271
|
+
* @returns A field decorator that registers a negative-number rule.
|
|
226
272
|
*/
|
|
227
273
|
export const IsNegative = createFlagValidationDecorator(options => ({
|
|
228
274
|
kind: 'negative',
|
|
@@ -246,7 +292,11 @@ export function IsEnum(values, options) {
|
|
|
246
292
|
}
|
|
247
293
|
|
|
248
294
|
/**
|
|
249
|
-
*
|
|
295
|
+
* Validates that the decorated field is divisible by the given divisor.
|
|
296
|
+
*
|
|
297
|
+
* @param value Divisor used for the numeric divisibility check.
|
|
298
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
299
|
+
* @returns A field decorator that registers a divisibility rule.
|
|
250
300
|
*/
|
|
251
301
|
export const IsDivisibleBy = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
252
302
|
kind: 'divisibleBy',
|
|
@@ -254,7 +304,11 @@ export const IsDivisibleBy = createValidationOptionsWithConfigDecorator((value,
|
|
|
254
304
|
...options
|
|
255
305
|
}));
|
|
256
306
|
/**
|
|
257
|
-
*
|
|
307
|
+
* Validates that the decorated field is greater than or equal to the minimum.
|
|
308
|
+
*
|
|
309
|
+
* @param value Inclusive minimum allowed numeric value.
|
|
310
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
311
|
+
* @returns A field decorator that registers a minimum-value rule.
|
|
258
312
|
*/
|
|
259
313
|
export const Min = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
260
314
|
kind: 'min',
|
|
@@ -262,7 +316,11 @@ export const Min = createValidationOptionsWithConfigDecorator((value, options) =
|
|
|
262
316
|
...options
|
|
263
317
|
}));
|
|
264
318
|
/**
|
|
265
|
-
*
|
|
319
|
+
* Validates that the decorated field is less than or equal to the maximum.
|
|
320
|
+
*
|
|
321
|
+
* @param value Inclusive maximum allowed numeric value.
|
|
322
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
323
|
+
* @returns A field decorator that registers a maximum-value rule.
|
|
266
324
|
*/
|
|
267
325
|
export const Max = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
268
326
|
kind: 'max',
|
|
@@ -270,7 +328,11 @@ export const Max = createValidationOptionsWithConfigDecorator((value, options) =
|
|
|
270
328
|
...options
|
|
271
329
|
}));
|
|
272
330
|
/**
|
|
273
|
-
*
|
|
331
|
+
* Validates that the decorated field is on or after the minimum date.
|
|
332
|
+
*
|
|
333
|
+
* @param value Inclusive minimum allowed date.
|
|
334
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
335
|
+
* @returns A field decorator that registers a minimum-date rule.
|
|
274
336
|
*/
|
|
275
337
|
export const MinDate = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
276
338
|
kind: 'minDate',
|
|
@@ -278,7 +340,11 @@ export const MinDate = createValidationOptionsWithConfigDecorator((value, option
|
|
|
278
340
|
...options
|
|
279
341
|
}));
|
|
280
342
|
/**
|
|
281
|
-
*
|
|
343
|
+
* Validates that the decorated field is on or before the maximum date.
|
|
344
|
+
*
|
|
345
|
+
* @param value Inclusive maximum allowed date.
|
|
346
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
347
|
+
* @returns A field decorator that registers a maximum-date rule.
|
|
282
348
|
*/
|
|
283
349
|
export const MaxDate = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
284
350
|
kind: 'maxDate',
|
|
@@ -286,7 +352,11 @@ export const MaxDate = createValidationOptionsWithConfigDecorator((value, option
|
|
|
286
352
|
...options
|
|
287
353
|
}));
|
|
288
354
|
/**
|
|
289
|
-
*
|
|
355
|
+
* Validates that the decorated field contains the required substring.
|
|
356
|
+
*
|
|
357
|
+
* @param value Required substring.
|
|
358
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
359
|
+
* @returns A field decorator that registers a substring-presence rule.
|
|
290
360
|
*/
|
|
291
361
|
export const Contains = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
292
362
|
kind: 'contains',
|
|
@@ -294,7 +364,11 @@ export const Contains = createValidationOptionsWithConfigDecorator((value, optio
|
|
|
294
364
|
...options
|
|
295
365
|
}));
|
|
296
366
|
/**
|
|
297
|
-
*
|
|
367
|
+
* Validates that the decorated field does not contain the forbidden substring.
|
|
368
|
+
*
|
|
369
|
+
* @param value Forbidden substring.
|
|
370
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
371
|
+
* @returns A field decorator that registers a substring-exclusion rule.
|
|
298
372
|
*/
|
|
299
373
|
export const NotContains = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
300
374
|
kind: 'notContains',
|
|
@@ -335,7 +409,11 @@ export function ValidateNested(dto, options) {
|
|
|
335
409
|
}
|
|
336
410
|
|
|
337
411
|
/**
|
|
338
|
-
*
|
|
412
|
+
* Validates that the decorated field has at least the given length.
|
|
413
|
+
*
|
|
414
|
+
* @param value Inclusive minimum string length.
|
|
415
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
416
|
+
* @returns A field decorator that registers a minimum-length rule.
|
|
339
417
|
*/
|
|
340
418
|
export const MinLength = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
341
419
|
kind: 'minLength',
|
|
@@ -343,7 +421,11 @@ export const MinLength = createValidationOptionsWithConfigDecorator((value, opti
|
|
|
343
421
|
...options
|
|
344
422
|
}));
|
|
345
423
|
/**
|
|
346
|
-
*
|
|
424
|
+
* Validates that the decorated field has at most the given length.
|
|
425
|
+
*
|
|
426
|
+
* @param value Inclusive maximum string length.
|
|
427
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
428
|
+
* @returns A field decorator that registers a maximum-length rule.
|
|
347
429
|
*/
|
|
348
430
|
export const MaxLength = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
349
431
|
kind: 'maxLength',
|
|
@@ -378,171 +460,199 @@ export function Matches(pattern, modifiersOrOptions, options) {
|
|
|
378
460
|
}
|
|
379
461
|
|
|
380
462
|
/**
|
|
381
|
-
*
|
|
463
|
+
* Validates that the decorated field contains only alphabetic characters.
|
|
382
464
|
*
|
|
383
|
-
* @param options
|
|
465
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
466
|
+
* @returns A field decorator that registers an alphabetic string rule.
|
|
384
467
|
*/
|
|
385
468
|
export const IsAlpha = options => createValidatorJsDecorator('alpha')(undefined, options);
|
|
386
469
|
/**
|
|
387
|
-
*
|
|
470
|
+
* Validates that the decorated field contains only alphanumeric characters.
|
|
388
471
|
*
|
|
389
|
-
* @param options
|
|
472
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
473
|
+
* @returns A field decorator that registers an alphanumeric string rule.
|
|
390
474
|
*/
|
|
391
475
|
export const IsAlphanumeric = options => createValidatorJsDecorator('alphanumeric')(undefined, options);
|
|
392
476
|
/**
|
|
393
|
-
*
|
|
477
|
+
* Validates that the decorated field contains only ASCII characters.
|
|
394
478
|
*
|
|
395
|
-
* @param options
|
|
479
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
480
|
+
* @returns A field decorator that registers an ASCII string rule.
|
|
396
481
|
*/
|
|
397
482
|
export const IsAscii = options => createValidatorJsDecorator('ascii')(undefined, options);
|
|
398
483
|
/**
|
|
399
|
-
*
|
|
484
|
+
* Validates that the decorated field is a Base64 string.
|
|
400
485
|
*
|
|
401
|
-
* @param options
|
|
486
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
487
|
+
* @returns A field decorator that registers a Base64 string rule.
|
|
402
488
|
*/
|
|
403
489
|
export const IsBase64 = options => createValidatorJsDecorator('base64')(undefined, options);
|
|
404
490
|
/**
|
|
405
|
-
*
|
|
491
|
+
* Validates that the decorated field is a boolean-like string.
|
|
406
492
|
*
|
|
407
|
-
* @param options
|
|
493
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
494
|
+
* @returns A field decorator that registers a boolean-string rule.
|
|
408
495
|
*/
|
|
409
496
|
export const IsBooleanString = options => createValidatorJsDecorator('booleanString')(undefined, options);
|
|
410
497
|
/**
|
|
411
|
-
*
|
|
498
|
+
* Validates that the decorated field is a data URI string.
|
|
412
499
|
*
|
|
413
|
-
* @param options
|
|
500
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
501
|
+
* @returns A field decorator that registers a data URI rule.
|
|
414
502
|
*/
|
|
415
503
|
export const IsDataURI = options => createValidatorJsDecorator('dataURI')(undefined, options);
|
|
416
504
|
/**
|
|
417
|
-
*
|
|
505
|
+
* Validates that the decorated field is a date string.
|
|
418
506
|
*
|
|
419
|
-
* @param options
|
|
507
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
508
|
+
* @returns A field decorator that registers a date-string rule.
|
|
420
509
|
*/
|
|
421
510
|
export const IsDateString = options => createValidatorJsDecorator('dateString')(undefined, options);
|
|
422
511
|
/**
|
|
423
|
-
*
|
|
512
|
+
* Validates that the decorated field is a decimal string.
|
|
424
513
|
*
|
|
425
|
-
* @param options
|
|
514
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
515
|
+
* @returns A field decorator that registers a decimal-string rule.
|
|
426
516
|
*/
|
|
427
517
|
export const IsDecimal = options => createValidatorJsDecorator('decimal')(undefined, options);
|
|
428
518
|
/**
|
|
429
|
-
*
|
|
519
|
+
* Validates that the decorated field is an email address.
|
|
430
520
|
*
|
|
431
|
-
* @param options
|
|
521
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
522
|
+
* @returns A field decorator that registers an email-address rule.
|
|
432
523
|
*/
|
|
433
524
|
export const IsEmail = options => createValidatorJsDecorator('email')(undefined, options);
|
|
434
525
|
/**
|
|
435
|
-
*
|
|
526
|
+
* Validates that the decorated field is a fully qualified domain name.
|
|
436
527
|
*
|
|
437
|
-
* @param options
|
|
528
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
529
|
+
* @returns A field decorator that registers an FQDN rule.
|
|
438
530
|
*/
|
|
439
531
|
export const IsFQDN = options => createValidatorJsDecorator('fqdn')(undefined, options);
|
|
440
532
|
/**
|
|
441
|
-
*
|
|
533
|
+
* Validates that the decorated field is a hexadecimal color string.
|
|
442
534
|
*
|
|
443
|
-
* @param options
|
|
535
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
536
|
+
* @returns A field decorator that registers a hex-color rule.
|
|
444
537
|
*/
|
|
445
538
|
export const IsHexColor = options => createValidatorJsDecorator('hexColor')(undefined, options);
|
|
446
539
|
/**
|
|
447
|
-
*
|
|
540
|
+
* Validates that the decorated field is a hexadecimal string.
|
|
448
541
|
*
|
|
449
|
-
* @param options
|
|
542
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
543
|
+
* @returns A field decorator that registers a hexadecimal string rule.
|
|
450
544
|
*/
|
|
451
545
|
export const IsHexadecimal = options => createValidatorJsDecorator('hexadecimal')(undefined, options);
|
|
452
546
|
/**
|
|
453
|
-
*
|
|
547
|
+
* Validates that the decorated field is a JSON string.
|
|
454
548
|
*
|
|
455
|
-
* @param options
|
|
549
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
550
|
+
* @returns A field decorator that registers a JSON-string rule.
|
|
456
551
|
*/
|
|
457
552
|
export const IsJSON = options => createValidatorJsDecorator('json')(undefined, options);
|
|
458
553
|
/**
|
|
459
|
-
*
|
|
554
|
+
* Validates that the decorated field is a JSON Web Token string.
|
|
460
555
|
*
|
|
461
|
-
* @param options
|
|
556
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
557
|
+
* @returns A field decorator that registers a JWT-string rule.
|
|
462
558
|
*/
|
|
463
559
|
export const IsJWT = options => createValidatorJsDecorator('jwt')(undefined, options);
|
|
464
560
|
/**
|
|
465
|
-
*
|
|
561
|
+
* Validates that the decorated field is a locale identifier.
|
|
466
562
|
*
|
|
467
|
-
* @param options
|
|
563
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
564
|
+
* @returns A field decorator that registers a locale-string rule.
|
|
468
565
|
*/
|
|
469
566
|
export const IsLocale = options => createValidatorJsDecorator('locale')(undefined, options);
|
|
470
567
|
/**
|
|
471
|
-
*
|
|
568
|
+
* Validates that the decorated field is lowercase.
|
|
472
569
|
*
|
|
473
|
-
* @param options
|
|
570
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
571
|
+
* @returns A field decorator that registers a lowercase-string rule.
|
|
474
572
|
*/
|
|
475
573
|
export const IsLowercase = options => createValidatorJsDecorator('lowercase')(undefined, options);
|
|
476
574
|
/**
|
|
477
|
-
*
|
|
575
|
+
* Validates that the decorated field is a magnet URI string.
|
|
478
576
|
*
|
|
479
|
-
* @param options
|
|
577
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
578
|
+
* @returns A field decorator that registers a magnet URI rule.
|
|
480
579
|
*/
|
|
481
580
|
export const IsMagnetURI = options => createValidatorJsDecorator('magnetURI')(undefined, options);
|
|
482
581
|
/**
|
|
483
|
-
*
|
|
582
|
+
* Validates that the decorated field is a MIME type string.
|
|
484
583
|
*
|
|
485
|
-
* @param options
|
|
584
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
585
|
+
* @returns A field decorator that registers a MIME type rule.
|
|
486
586
|
*/
|
|
487
587
|
export const IsMimeType = options => createValidatorJsDecorator('mimeType')(undefined, options);
|
|
488
588
|
/**
|
|
489
|
-
*
|
|
589
|
+
* Validates that the decorated field is a MongoDB object ID string.
|
|
490
590
|
*
|
|
491
|
-
* @param options
|
|
591
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
592
|
+
* @returns A field decorator that registers a MongoDB object ID rule.
|
|
492
593
|
*/
|
|
493
594
|
export const IsMongoId = options => createValidatorJsDecorator('mongoId')(undefined, options);
|
|
494
595
|
/**
|
|
495
|
-
*
|
|
596
|
+
* Validates that the decorated field is a numeric string.
|
|
496
597
|
*
|
|
497
|
-
* @param options
|
|
598
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
599
|
+
* @returns A field decorator that registers a numeric-string rule.
|
|
498
600
|
*/
|
|
499
601
|
export const IsNumberString = options => createValidatorJsDecorator('numberString')(undefined, options);
|
|
500
602
|
/**
|
|
501
|
-
*
|
|
603
|
+
* Validates that the decorated field is a network port string.
|
|
502
604
|
*
|
|
503
|
-
* @param options
|
|
605
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
606
|
+
* @returns A field decorator that registers a port-string rule.
|
|
504
607
|
*/
|
|
505
608
|
export const IsPort = options => createValidatorJsDecorator('port')(undefined, options);
|
|
506
609
|
/**
|
|
507
|
-
*
|
|
610
|
+
* Validates that the decorated field is an RFC 3339 date-time string.
|
|
508
611
|
*
|
|
509
|
-
* @param options
|
|
612
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
613
|
+
* @returns A field decorator that registers an RFC 3339 string rule.
|
|
510
614
|
*/
|
|
511
615
|
export const IsRFC3339 = options => createValidatorJsDecorator('rfc3339')(undefined, options);
|
|
512
616
|
/**
|
|
513
|
-
*
|
|
617
|
+
* Validates that the decorated field is a semantic version string.
|
|
514
618
|
*
|
|
515
|
-
* @param options
|
|
619
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
620
|
+
* @returns A field decorator that registers a semantic-version rule.
|
|
516
621
|
*/
|
|
517
622
|
export const IsSemVer = options => createValidatorJsDecorator('semVer')(undefined, options);
|
|
518
623
|
/**
|
|
519
|
-
*
|
|
624
|
+
* Validates that the decorated field is uppercase.
|
|
520
625
|
*
|
|
521
|
-
* @param options
|
|
626
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
627
|
+
* @returns A field decorator that registers an uppercase-string rule.
|
|
522
628
|
*/
|
|
523
629
|
export const IsUppercase = options => createValidatorJsDecorator('uppercase')(undefined, options);
|
|
524
630
|
/**
|
|
525
|
-
*
|
|
631
|
+
* Validates that the decorated field is an ISO 8601 date-time string.
|
|
526
632
|
*
|
|
527
|
-
* @param options
|
|
633
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
634
|
+
* @returns A field decorator that registers an ISO 8601 string rule.
|
|
528
635
|
*/
|
|
529
636
|
export const IsISO8601 = options => createValidatorJsDecorator('iso8601')(undefined, options);
|
|
530
637
|
/**
|
|
531
|
-
*
|
|
638
|
+
* Validates that the decorated field is a latitude value.
|
|
532
639
|
*
|
|
533
|
-
* @param options
|
|
640
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
641
|
+
* @returns A field decorator that registers a latitude rule.
|
|
534
642
|
*/
|
|
535
643
|
export const IsLatitude = options => createValidatorJsDecorator('latitude')(undefined, options);
|
|
536
644
|
/**
|
|
537
|
-
*
|
|
645
|
+
* Validates that the decorated field is a longitude value.
|
|
538
646
|
*
|
|
539
|
-
* @param options
|
|
647
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
648
|
+
* @returns A field decorator that registers a longitude rule.
|
|
540
649
|
*/
|
|
541
650
|
export const IsLongitude = options => createValidatorJsDecorator('longitude')(undefined, options);
|
|
542
651
|
/**
|
|
543
|
-
*
|
|
652
|
+
* Validates that the decorated field is a latitude/longitude coordinate string.
|
|
544
653
|
*
|
|
545
|
-
* @param options
|
|
654
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
655
|
+
* @returns A field decorator that registers a latitude/longitude rule.
|
|
546
656
|
*/
|
|
547
657
|
export const IsLatLong = options => createValidatorJsDecorator('latLong')(undefined, options);
|
|
548
658
|
|
|
@@ -643,7 +753,11 @@ export function IsCurrency(options) {
|
|
|
643
753
|
}
|
|
644
754
|
|
|
645
755
|
/**
|
|
646
|
-
*
|
|
756
|
+
* Validates that the decorated array contains all required values.
|
|
757
|
+
*
|
|
758
|
+
* @param values Required values that must be present in the array.
|
|
759
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
760
|
+
* @returns A field decorator that registers an array-contains rule.
|
|
647
761
|
*/
|
|
648
762
|
export const ArrayContains = createArrayValidationDecorator((values, options) => ({
|
|
649
763
|
kind: 'arrayContains',
|
|
@@ -651,7 +765,11 @@ export const ArrayContains = createArrayValidationDecorator((values, options) =>
|
|
|
651
765
|
...options
|
|
652
766
|
}));
|
|
653
767
|
/**
|
|
654
|
-
*
|
|
768
|
+
* Validates that the decorated array excludes all forbidden values.
|
|
769
|
+
*
|
|
770
|
+
* @param values Forbidden values that must not be present in the array.
|
|
771
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
772
|
+
* @returns A field decorator that registers an array-exclusion rule.
|
|
655
773
|
*/
|
|
656
774
|
export const ArrayNotContains = createArrayValidationDecorator((values, options) => ({
|
|
657
775
|
kind: 'arrayNotContains',
|
|
@@ -659,14 +777,21 @@ export const ArrayNotContains = createArrayValidationDecorator((values, options)
|
|
|
659
777
|
...options
|
|
660
778
|
}));
|
|
661
779
|
/**
|
|
662
|
-
*
|
|
780
|
+
* Validates that the decorated array is not empty.
|
|
781
|
+
*
|
|
782
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
783
|
+
* @returns A field decorator that registers a non-empty-array rule.
|
|
663
784
|
*/
|
|
664
785
|
export const ArrayNotEmpty = createFlagValidationDecorator(options => ({
|
|
665
786
|
kind: 'arrayNotEmpty',
|
|
666
787
|
...options
|
|
667
788
|
}));
|
|
668
789
|
/**
|
|
669
|
-
*
|
|
790
|
+
* Validates that the decorated array has at least the given size.
|
|
791
|
+
*
|
|
792
|
+
* @param value Inclusive minimum array length.
|
|
793
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
794
|
+
* @returns A field decorator that registers a minimum-array-size rule.
|
|
670
795
|
*/
|
|
671
796
|
export const ArrayMinSize = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
672
797
|
kind: 'arrayMinSize',
|
|
@@ -674,7 +799,11 @@ export const ArrayMinSize = createValidationOptionsWithConfigDecorator((value, o
|
|
|
674
799
|
...options
|
|
675
800
|
}));
|
|
676
801
|
/**
|
|
677
|
-
*
|
|
802
|
+
* Validates that the decorated array has at most the given size.
|
|
803
|
+
*
|
|
804
|
+
* @param value Inclusive maximum array length.
|
|
805
|
+
* @param options Optional validation behavior (`message`, `groups`, `always`, `each`).
|
|
806
|
+
* @returns A field decorator that registers a maximum-array-size rule.
|
|
678
807
|
*/
|
|
679
808
|
export const ArrayMaxSize = createValidationOptionsWithConfigDecorator((value, options) => ({
|
|
680
809
|
kind: 'arrayMaxSize',
|