koatty_validation 1.0.12 → 1.2.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/.vscode/launch.json +81 -0
- package/CHANGELOG.md +4 -4
- package/README.md +34 -28
- package/dist/LICENSE +29 -0
- package/dist/README.md +112 -0
- package/dist/index.d.ts +422 -9
- package/dist/index.js +1379 -21
- package/dist/index.mjs +1320 -0
- package/dist/package.json +90 -0
- package/jest-html-reporters-attach/index.js +58 -0
- package/jest-html-reporters-attach/result.js +1 -0
- package/package.json +24 -20
- package/.eslintignore +0 -9
- package/.eslintrc.js +0 -43
- package/babel.config.js +0 -21
- package/commitlint.config.js +0 -14
- package/dist/decorator.d.ts +0 -237
- package/dist/decorator.js +0 -681
- package/dist/decorator.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/rule.d.ts +0 -83
- package/dist/rule.js +0 -291
- package/dist/rule.js.map +0 -1
- package/dist/util.d.ts +0 -108
- package/dist/util.js +0 -422
- package/dist/util.js.map +0 -1
- package/jest.config.js +0 -36
- package/jest_html_reporters.html +0 -60
- package/tsconfig.json +0 -67
package/dist/decorator.js
DELETED
|
@@ -1,681 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsHash = exports.IsUrl = exports.IsPhoneNumber = exports.IsIP = exports.IsEmail = exports.Length = exports.Max = exports.Min = exports.IsDate = exports.IsNotIn = exports.IsIn = exports.Contains = exports.NotEquals = exports.Equals = exports.IsNotEmpty = exports.IsPlateNumber = exports.IsMobile = exports.IsZipCode = exports.IsIdNumber = exports.IsCnName = exports.IsDefined = exports.Expose = exports.Validated = exports.Valid = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/*
|
|
6
|
-
* @Description:
|
|
7
|
-
* @Usage:
|
|
8
|
-
* @Author: richen
|
|
9
|
-
* @Date: 2021-11-25 10:46:57
|
|
10
|
-
* @LastEditTime: 2021-11-25 11:07:49
|
|
11
|
-
*/
|
|
12
|
-
const helper = (0, tslib_1.__importStar)(require("koatty_lib"));
|
|
13
|
-
const koatty_container_1 = require("koatty_container");
|
|
14
|
-
const rule_1 = require("./rule");
|
|
15
|
-
const util_1 = require("./util");
|
|
16
|
-
const class_validator_1 = require("class-validator");
|
|
17
|
-
/**
|
|
18
|
-
* Validation parameter's type and values.
|
|
19
|
-
*
|
|
20
|
-
* @export
|
|
21
|
-
* @param {(ValidRules | ValidRules[] | Function)} rule
|
|
22
|
-
* @param {string} [message]
|
|
23
|
-
* @returns {ParameterDecorator}
|
|
24
|
-
*/
|
|
25
|
-
function Valid(rule, message) {
|
|
26
|
-
let rules = [];
|
|
27
|
-
if (helper.isString(rule)) {
|
|
28
|
-
rules = rule.split(",");
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
rules = rule;
|
|
32
|
-
}
|
|
33
|
-
return (target, propertyKey, descriptor) => {
|
|
34
|
-
// 获取成员参数类型
|
|
35
|
-
const paramTypes = Reflect.getMetadata("design:paramtypes", target, propertyKey);
|
|
36
|
-
const type = (paramTypes[descriptor] && paramTypes[descriptor].name) ? paramTypes[descriptor].name : "object";
|
|
37
|
-
koatty_container_1.IOCContainer.attachPropertyData(rule_1.PARAM_RULE_KEY, {
|
|
38
|
-
name: propertyKey,
|
|
39
|
-
rule: rules,
|
|
40
|
-
message,
|
|
41
|
-
index: descriptor,
|
|
42
|
-
type
|
|
43
|
-
}, target, propertyKey);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.Valid = Valid;
|
|
47
|
-
/**
|
|
48
|
-
* Validation parameter's type and values from DTO class.
|
|
49
|
-
*
|
|
50
|
-
* @export
|
|
51
|
-
* @returns {MethodDecorator}
|
|
52
|
-
*/
|
|
53
|
-
function Validated() {
|
|
54
|
-
return (target, propertyKey, descriptor) => {
|
|
55
|
-
//
|
|
56
|
-
koatty_container_1.IOCContainer.savePropertyData(rule_1.PARAM_CHECK_KEY, {
|
|
57
|
-
dtoCheck: 1
|
|
58
|
-
}, target, propertyKey);
|
|
59
|
-
// 获取成员参数类型
|
|
60
|
-
// const paramTypes = Reflect.getMetadata("design:paramtypes", target, propertyKey) || [];
|
|
61
|
-
// const { value, configurable, enumerable } = descriptor;
|
|
62
|
-
// descriptor = {
|
|
63
|
-
// configurable,
|
|
64
|
-
// enumerable,
|
|
65
|
-
// writable: true,
|
|
66
|
-
// value: async function valid(...props: any[]) {
|
|
67
|
-
// const ps: any[] = [];
|
|
68
|
-
// // tslint:disable-next-line: no-unused-expression
|
|
69
|
-
// (props || []).map((value: any, index: number) => {
|
|
70
|
-
// const type = (paramTypes[index] && paramTypes[index].name) ? paramTypes[index].name : "any";
|
|
71
|
-
// if (!paramterTypes[type]) {
|
|
72
|
-
// ps.push(ClassValidator.valid(paramTypes[index], value, true));
|
|
73
|
-
// } else {
|
|
74
|
-
// ps.push(Promise.resolve(value));
|
|
75
|
-
// }
|
|
76
|
-
// });
|
|
77
|
-
// if (ps.length > 0) {
|
|
78
|
-
// props = await Promise.all(ps);
|
|
79
|
-
// }
|
|
80
|
-
// // tslint:disable-next-line: no-invalid-this
|
|
81
|
-
// return value.apply(this, props);
|
|
82
|
-
// }
|
|
83
|
-
// };
|
|
84
|
-
// return descriptor;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
exports.Validated = Validated;
|
|
88
|
-
/**
|
|
89
|
-
* Marks property as included in the process of transformation.
|
|
90
|
-
*
|
|
91
|
-
* @export
|
|
92
|
-
* @returns {PropertyDecorator}
|
|
93
|
-
*/
|
|
94
|
-
function Expose() {
|
|
95
|
-
return function (object, propertyName) {
|
|
96
|
-
const types = Reflect.getMetadata("design:type", object, propertyName);
|
|
97
|
-
if (types) {
|
|
98
|
-
const originMap = (0, util_1.getOriginMetadata)(rule_1.PARAM_TYPE_KEY, object);
|
|
99
|
-
originMap.set(propertyName, types.name);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
exports.Expose = Expose;
|
|
104
|
-
/**
|
|
105
|
-
* Identifies that the field needs to be defined
|
|
106
|
-
*
|
|
107
|
-
* @export
|
|
108
|
-
* @returns {PropertyDecorator}
|
|
109
|
-
*/
|
|
110
|
-
function IsDefined() {
|
|
111
|
-
return function (object, propertyName) {
|
|
112
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
exports.IsDefined = IsDefined;
|
|
116
|
-
/**
|
|
117
|
-
* Checks if value is a chinese name.
|
|
118
|
-
*
|
|
119
|
-
* @export
|
|
120
|
-
* @param {string} property
|
|
121
|
-
* @param {ValidationOptions} [validationOptions]
|
|
122
|
-
* @returns {PropertyDecorator}
|
|
123
|
-
*/
|
|
124
|
-
function IsCnName(validationOptions) {
|
|
125
|
-
return function (object, propertyName) {
|
|
126
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
127
|
-
(0, class_validator_1.registerDecorator)({
|
|
128
|
-
name: "IsCnName",
|
|
129
|
-
target: object.constructor,
|
|
130
|
-
propertyName,
|
|
131
|
-
options: validationOptions,
|
|
132
|
-
validator: {
|
|
133
|
-
validate(value, args) {
|
|
134
|
-
return (0, util_1.cnName)(value);
|
|
135
|
-
},
|
|
136
|
-
defaultMessage(args) {
|
|
137
|
-
return "invalid parameter ($property).";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
exports.IsCnName = IsCnName;
|
|
144
|
-
/**
|
|
145
|
-
* Checks if value is a idCard number(chinese).
|
|
146
|
-
*
|
|
147
|
-
* @export
|
|
148
|
-
* @param {string} property
|
|
149
|
-
* @param {ValidationOptions} [validationOptions]
|
|
150
|
-
* @returns {PropertyDecorator}
|
|
151
|
-
*/
|
|
152
|
-
function IsIdNumber(validationOptions) {
|
|
153
|
-
return function (object, propertyName) {
|
|
154
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
155
|
-
(0, class_validator_1.registerDecorator)({
|
|
156
|
-
name: "IsIdNumber",
|
|
157
|
-
target: object.constructor,
|
|
158
|
-
propertyName,
|
|
159
|
-
options: validationOptions,
|
|
160
|
-
validator: {
|
|
161
|
-
validate(value, args) {
|
|
162
|
-
return (0, util_1.idNumber)(value);
|
|
163
|
-
},
|
|
164
|
-
defaultMessage(args) {
|
|
165
|
-
return "invalid parameter ($property).";
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
exports.IsIdNumber = IsIdNumber;
|
|
172
|
-
/**
|
|
173
|
-
* Checks if value is a zipCode(chinese).
|
|
174
|
-
*
|
|
175
|
-
* @export
|
|
176
|
-
* @param {string} property
|
|
177
|
-
* @param {ValidationOptions} [validationOptions]
|
|
178
|
-
* @returns {PropertyDecorator}
|
|
179
|
-
*/
|
|
180
|
-
function IsZipCode(validationOptions) {
|
|
181
|
-
return function (object, propertyName) {
|
|
182
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
183
|
-
(0, class_validator_1.registerDecorator)({
|
|
184
|
-
name: "IsZipCode",
|
|
185
|
-
target: object.constructor,
|
|
186
|
-
propertyName,
|
|
187
|
-
options: validationOptions,
|
|
188
|
-
validator: {
|
|
189
|
-
validate(value, args) {
|
|
190
|
-
return (0, util_1.zipCode)(value);
|
|
191
|
-
},
|
|
192
|
-
defaultMessage(args) {
|
|
193
|
-
return "invalid parameter ($property).";
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
exports.IsZipCode = IsZipCode;
|
|
200
|
-
/**
|
|
201
|
-
* Checks if value is a mobile phone number(chinese).
|
|
202
|
-
*
|
|
203
|
-
* @export
|
|
204
|
-
* @param {string} property
|
|
205
|
-
* @param {ValidationOptions} [validationOptions]
|
|
206
|
-
* @returns {PropertyDecorator}
|
|
207
|
-
*/
|
|
208
|
-
function IsMobile(validationOptions) {
|
|
209
|
-
return function (object, propertyName) {
|
|
210
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
211
|
-
(0, class_validator_1.registerDecorator)({
|
|
212
|
-
name: "IsMobile",
|
|
213
|
-
target: object.constructor,
|
|
214
|
-
propertyName,
|
|
215
|
-
options: validationOptions,
|
|
216
|
-
validator: {
|
|
217
|
-
validate(value, args) {
|
|
218
|
-
return (0, util_1.mobile)(value);
|
|
219
|
-
},
|
|
220
|
-
defaultMessage(args) {
|
|
221
|
-
return "invalid parameter ($property).";
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
exports.IsMobile = IsMobile;
|
|
228
|
-
/**
|
|
229
|
-
* Checks if value is a plate number(chinese).
|
|
230
|
-
*
|
|
231
|
-
* @export
|
|
232
|
-
* @param {string} property
|
|
233
|
-
* @param {ValidationOptions} [validationOptions]
|
|
234
|
-
* @returns {PropertyDecorator}
|
|
235
|
-
*/
|
|
236
|
-
function IsPlateNumber(validationOptions) {
|
|
237
|
-
return function (object, propertyName) {
|
|
238
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
239
|
-
(0, class_validator_1.registerDecorator)({
|
|
240
|
-
name: "IsPlateNumber",
|
|
241
|
-
target: object.constructor,
|
|
242
|
-
propertyName,
|
|
243
|
-
options: validationOptions,
|
|
244
|
-
validator: {
|
|
245
|
-
validate(value, args) {
|
|
246
|
-
return (0, util_1.plateNumber)(value);
|
|
247
|
-
},
|
|
248
|
-
defaultMessage(args) {
|
|
249
|
-
return "invalid parameter ($property).";
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
exports.IsPlateNumber = IsPlateNumber;
|
|
256
|
-
/**
|
|
257
|
-
* Checks value is not empty, undefined, null, '', NaN, [], {} and any empty string(including spaces, tabs, formfeeds, etc.), returns false.
|
|
258
|
-
*
|
|
259
|
-
* @export
|
|
260
|
-
* @param {ValidationOptions} [validationOptions]
|
|
261
|
-
* @returns {PropertyDecorator}
|
|
262
|
-
*/
|
|
263
|
-
function IsNotEmpty(validationOptions) {
|
|
264
|
-
return function (object, propertyName) {
|
|
265
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
266
|
-
(0, class_validator_1.registerDecorator)({
|
|
267
|
-
name: "IsNotEmpty",
|
|
268
|
-
target: object.constructor,
|
|
269
|
-
propertyName,
|
|
270
|
-
options: validationOptions,
|
|
271
|
-
validator: {
|
|
272
|
-
validate(value, args) {
|
|
273
|
-
return !helper.isEmpty(value);
|
|
274
|
-
},
|
|
275
|
-
defaultMessage(args) {
|
|
276
|
-
return "invalid parameter ($property).";
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
exports.IsNotEmpty = IsNotEmpty;
|
|
283
|
-
/**
|
|
284
|
-
* Checks if value matches ("===") the comparison.
|
|
285
|
-
*
|
|
286
|
-
* @export
|
|
287
|
-
* @param {*} comparison
|
|
288
|
-
* @param {ValidationOptions} [validationOptions]
|
|
289
|
-
* @returns {PropertyDecorator}
|
|
290
|
-
*/
|
|
291
|
-
function Equals(comparison, validationOptions) {
|
|
292
|
-
return function (object, propertyName) {
|
|
293
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
294
|
-
(0, class_validator_1.registerDecorator)({
|
|
295
|
-
name: "vEquals",
|
|
296
|
-
target: object.constructor,
|
|
297
|
-
propertyName,
|
|
298
|
-
options: validationOptions,
|
|
299
|
-
validator: {
|
|
300
|
-
validate(value, args) {
|
|
301
|
-
return (0, class_validator_1.equals)(value, comparison);
|
|
302
|
-
},
|
|
303
|
-
defaultMessage(args) {
|
|
304
|
-
return `invalid parameter, ($property) must be equals ${comparison}.`;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
exports.Equals = Equals;
|
|
311
|
-
/**
|
|
312
|
-
* Checks if value does not match ("!==") the comparison.
|
|
313
|
-
*
|
|
314
|
-
* @export
|
|
315
|
-
* @param {*} comparison
|
|
316
|
-
* @param {ValidationOptions} [validationOptions]
|
|
317
|
-
* @returns {PropertyDecorator}
|
|
318
|
-
*/
|
|
319
|
-
function NotEquals(comparison, validationOptions) {
|
|
320
|
-
return function (object, propertyName) {
|
|
321
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
322
|
-
(0, class_validator_1.registerDecorator)({
|
|
323
|
-
name: "vNotEquals",
|
|
324
|
-
target: object.constructor,
|
|
325
|
-
propertyName,
|
|
326
|
-
options: validationOptions,
|
|
327
|
-
validator: {
|
|
328
|
-
validate(value, args) {
|
|
329
|
-
return (0, class_validator_1.notEquals)(value, comparison);
|
|
330
|
-
},
|
|
331
|
-
defaultMessage(args) {
|
|
332
|
-
return `invalid parameter, ($property) must be not equals ${comparison}.`;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
exports.NotEquals = NotEquals;
|
|
339
|
-
/**
|
|
340
|
-
* Checks if the string contains the seed.
|
|
341
|
-
*
|
|
342
|
-
* @export
|
|
343
|
-
* @param {string} seed
|
|
344
|
-
* @param {ValidationOptions} [validationOptions]
|
|
345
|
-
* @returns {PropertyDecorator}
|
|
346
|
-
*/
|
|
347
|
-
function Contains(seed, validationOptions) {
|
|
348
|
-
return function (object, propertyName) {
|
|
349
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
350
|
-
(0, class_validator_1.registerDecorator)({
|
|
351
|
-
name: "vContains",
|
|
352
|
-
target: object.constructor,
|
|
353
|
-
propertyName,
|
|
354
|
-
options: validationOptions,
|
|
355
|
-
validator: {
|
|
356
|
-
validate(value, args) {
|
|
357
|
-
return (0, class_validator_1.contains)(value, seed);
|
|
358
|
-
// return typeof value === "string" && (value.indexOf(seed) > -1);
|
|
359
|
-
},
|
|
360
|
-
defaultMessage(args) {
|
|
361
|
-
return `invalid parameter, ($property) must be contains ${seed}.`;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
exports.Contains = Contains;
|
|
368
|
-
/**
|
|
369
|
-
* Checks if given value is in a array of allowed values.
|
|
370
|
-
*
|
|
371
|
-
* @export
|
|
372
|
-
* @param {any[]} possibleValues
|
|
373
|
-
* @param {ValidationOptions} [validationOptions]
|
|
374
|
-
* @returns {PropertyDecorator}
|
|
375
|
-
*/
|
|
376
|
-
function IsIn(possibleValues, validationOptions) {
|
|
377
|
-
return function (object, propertyName) {
|
|
378
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
379
|
-
(0, class_validator_1.registerDecorator)({
|
|
380
|
-
name: "vIsIn",
|
|
381
|
-
target: object.constructor,
|
|
382
|
-
propertyName,
|
|
383
|
-
options: validationOptions,
|
|
384
|
-
validator: {
|
|
385
|
-
validate(value, args) {
|
|
386
|
-
return (0, class_validator_1.isIn)(value, possibleValues);
|
|
387
|
-
},
|
|
388
|
-
defaultMessage(args) {
|
|
389
|
-
return `invalid parameter ($property).`;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
exports.IsIn = IsIn;
|
|
396
|
-
/**
|
|
397
|
-
* Checks if given value not in a array of allowed values.
|
|
398
|
-
*
|
|
399
|
-
* @export
|
|
400
|
-
* @param {any[]} possibleValues
|
|
401
|
-
* @param {ValidationOptions} [validationOptions]
|
|
402
|
-
* @returns {PropertyDecorator}
|
|
403
|
-
*/
|
|
404
|
-
function IsNotIn(possibleValues, validationOptions) {
|
|
405
|
-
return function (object, propertyName) {
|
|
406
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
407
|
-
(0, class_validator_1.registerDecorator)({
|
|
408
|
-
name: "vIsNotIn",
|
|
409
|
-
target: object.constructor,
|
|
410
|
-
propertyName,
|
|
411
|
-
options: validationOptions,
|
|
412
|
-
validator: {
|
|
413
|
-
validate(value, args) {
|
|
414
|
-
return (0, class_validator_1.isNotIn)(value, possibleValues);
|
|
415
|
-
},
|
|
416
|
-
defaultMessage(args) {
|
|
417
|
-
return `invalid parameter ($property).`;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
exports.IsNotIn = IsNotIn;
|
|
424
|
-
/**
|
|
425
|
-
* Checks if a given value is a real date.
|
|
426
|
-
*
|
|
427
|
-
* @export
|
|
428
|
-
* @param {ValidationOptions} [validationOptions]
|
|
429
|
-
* @returns {PropertyDecorator}
|
|
430
|
-
*/
|
|
431
|
-
function IsDate(validationOptions) {
|
|
432
|
-
return function (object, propertyName) {
|
|
433
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
434
|
-
(0, class_validator_1.registerDecorator)({
|
|
435
|
-
name: "vIsDate",
|
|
436
|
-
target: object.constructor,
|
|
437
|
-
propertyName,
|
|
438
|
-
options: validationOptions,
|
|
439
|
-
validator: {
|
|
440
|
-
validate(value, args) {
|
|
441
|
-
return (0, class_validator_1.isDate)(value);
|
|
442
|
-
},
|
|
443
|
-
defaultMessage(args) {
|
|
444
|
-
return `invalid parameter ($property).`;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
exports.IsDate = IsDate;
|
|
451
|
-
/**
|
|
452
|
-
* Checks if the first number is greater than or equal to the min value.
|
|
453
|
-
*
|
|
454
|
-
* @export
|
|
455
|
-
* @param {number} min
|
|
456
|
-
* @param {ValidationOptions} [validationOptions]
|
|
457
|
-
* @returns {PropertyDecorator}
|
|
458
|
-
*/
|
|
459
|
-
function Min(min, validationOptions) {
|
|
460
|
-
return function (object, propertyName) {
|
|
461
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
462
|
-
(0, class_validator_1.registerDecorator)({
|
|
463
|
-
name: "vMin",
|
|
464
|
-
target: object.constructor,
|
|
465
|
-
propertyName,
|
|
466
|
-
options: validationOptions,
|
|
467
|
-
validator: {
|
|
468
|
-
validate(value, args) {
|
|
469
|
-
return helper.toNumber(value) >= min;
|
|
470
|
-
},
|
|
471
|
-
defaultMessage(args) {
|
|
472
|
-
return `invalid parameter ($property).`;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
exports.Min = Min;
|
|
479
|
-
/**
|
|
480
|
-
* Checks if the first number is less than or equal to the max value.
|
|
481
|
-
*
|
|
482
|
-
* @export
|
|
483
|
-
* @param {number} max
|
|
484
|
-
* @param {ValidationOptions} [validationOptions]
|
|
485
|
-
* @returns {PropertyDecorator}
|
|
486
|
-
*/
|
|
487
|
-
function Max(max, validationOptions) {
|
|
488
|
-
return function (object, propertyName) {
|
|
489
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
490
|
-
(0, class_validator_1.registerDecorator)({
|
|
491
|
-
name: "vMax",
|
|
492
|
-
target: object.constructor,
|
|
493
|
-
propertyName,
|
|
494
|
-
options: validationOptions,
|
|
495
|
-
validator: {
|
|
496
|
-
validate(value, args) {
|
|
497
|
-
return helper.toNumber(value) <= max;
|
|
498
|
-
},
|
|
499
|
-
defaultMessage(args) {
|
|
500
|
-
return `invalid parameter ($property).`;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
exports.Max = Max;
|
|
507
|
-
/**
|
|
508
|
-
* Checks if the string's length falls in a range. Note: this function takes into account surrogate pairs.
|
|
509
|
-
* If given value is not a string, then it returns false.
|
|
510
|
-
*
|
|
511
|
-
* @export
|
|
512
|
-
* @param {number} min
|
|
513
|
-
* @param {number} [max]
|
|
514
|
-
* @param {ValidationOptions} [validationOptions]
|
|
515
|
-
* @returns {PropertyDecorator}
|
|
516
|
-
*/
|
|
517
|
-
function Length(min, max, validationOptions) {
|
|
518
|
-
return function (object, propertyName) {
|
|
519
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
520
|
-
(0, class_validator_1.registerDecorator)({
|
|
521
|
-
name: "vLength",
|
|
522
|
-
target: object.constructor,
|
|
523
|
-
propertyName,
|
|
524
|
-
options: validationOptions,
|
|
525
|
-
validator: {
|
|
526
|
-
validate(value, args) {
|
|
527
|
-
return (0, class_validator_1.length)(value, min, max);
|
|
528
|
-
},
|
|
529
|
-
defaultMessage(args) {
|
|
530
|
-
return `invalid parameter ($property).`;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
exports.Length = Length;
|
|
537
|
-
/**
|
|
538
|
-
* Checks if the string is an email. If given value is not a string, then it returns false.
|
|
539
|
-
*
|
|
540
|
-
* @export
|
|
541
|
-
* @param {IsEmailOptions} [options]
|
|
542
|
-
* @param {ValidationOptions} [validationOptions]
|
|
543
|
-
* @returns {PropertyDecorator}
|
|
544
|
-
*/
|
|
545
|
-
function IsEmail(options, validationOptions) {
|
|
546
|
-
return function (object, propertyName) {
|
|
547
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
548
|
-
(0, class_validator_1.registerDecorator)({
|
|
549
|
-
name: "vIsEmail",
|
|
550
|
-
target: object.constructor,
|
|
551
|
-
propertyName,
|
|
552
|
-
options: validationOptions,
|
|
553
|
-
validator: {
|
|
554
|
-
validate(value, args) {
|
|
555
|
-
return (0, class_validator_1.isEmail)(value);
|
|
556
|
-
},
|
|
557
|
-
defaultMessage(args) {
|
|
558
|
-
return `invalid parameter ($property).`;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
exports.IsEmail = IsEmail;
|
|
565
|
-
/**
|
|
566
|
-
* Checks if the string is an IP (version 4 or 6). If given value is not a string, then it returns false.
|
|
567
|
-
*
|
|
568
|
-
* @export
|
|
569
|
-
* @param {number} [version]
|
|
570
|
-
* @param {ValidationOptions} [validationOptions]
|
|
571
|
-
* @returns {PropertyDecorator}
|
|
572
|
-
*/
|
|
573
|
-
function IsIP(version, validationOptions) {
|
|
574
|
-
return function (object, propertyName) {
|
|
575
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
576
|
-
(0, class_validator_1.registerDecorator)({
|
|
577
|
-
name: "vIsIP",
|
|
578
|
-
target: object.constructor,
|
|
579
|
-
propertyName,
|
|
580
|
-
options: validationOptions,
|
|
581
|
-
validator: {
|
|
582
|
-
validate(value, args) {
|
|
583
|
-
return (0, class_validator_1.isIP)(value, version);
|
|
584
|
-
},
|
|
585
|
-
defaultMessage(args) {
|
|
586
|
-
return `invalid parameter ($property).`;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
});
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
exports.IsIP = IsIP;
|
|
593
|
-
/**
|
|
594
|
-
* Checks if the string is a valid phone number.
|
|
595
|
-
*
|
|
596
|
-
* @export
|
|
597
|
-
* @param {string} {string} region 2 characters uppercase country code (e.g. DE, US, CH).
|
|
598
|
-
* If users must enter the intl. prefix (e.g. +41), then you may pass "ZZ" or null as region.
|
|
599
|
-
* See [google-libphonenumber, metadata.js:countryCodeToRegionCodeMap on github]
|
|
600
|
-
* {@link https://github.com/ruimarinho/google-libphonenumber/blob/1e46138878cff479aafe2ce62175c6c49cb58720/src/metadata.js#L33}
|
|
601
|
-
* @param {ValidationOptions} [validationOptions]
|
|
602
|
-
* @returns {PropertyDecorator}
|
|
603
|
-
*/
|
|
604
|
-
function IsPhoneNumber(region, validationOptions) {
|
|
605
|
-
return function (object, propertyName) {
|
|
606
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
607
|
-
(0, class_validator_1.registerDecorator)({
|
|
608
|
-
name: "vIsPhoneNumber",
|
|
609
|
-
target: object.constructor,
|
|
610
|
-
propertyName,
|
|
611
|
-
options: validationOptions,
|
|
612
|
-
validator: {
|
|
613
|
-
validate(value, args) {
|
|
614
|
-
return (0, class_validator_1.isPhoneNumber)(value, region);
|
|
615
|
-
},
|
|
616
|
-
defaultMessage(args) {
|
|
617
|
-
return `invalid parameter ($property).`;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
exports.IsPhoneNumber = IsPhoneNumber;
|
|
624
|
-
/**
|
|
625
|
-
* Checks if the string is an url.
|
|
626
|
-
*
|
|
627
|
-
* @export
|
|
628
|
-
* @param {IsURLOptions} [options]
|
|
629
|
-
* @param {ValidationOptions} [validationOptions]
|
|
630
|
-
* @returns {PropertyDecorator}
|
|
631
|
-
*/
|
|
632
|
-
function IsUrl(options, validationOptions) {
|
|
633
|
-
return function (object, propertyName) {
|
|
634
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
635
|
-
(0, class_validator_1.registerDecorator)({
|
|
636
|
-
name: "vIsUrl",
|
|
637
|
-
target: object.constructor,
|
|
638
|
-
propertyName,
|
|
639
|
-
options: validationOptions,
|
|
640
|
-
validator: {
|
|
641
|
-
validate(value, args) {
|
|
642
|
-
return (0, class_validator_1.isURL)(value, options);
|
|
643
|
-
},
|
|
644
|
-
defaultMessage(args) {
|
|
645
|
-
return `invalid parameter ($property).`;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
exports.IsUrl = IsUrl;
|
|
652
|
-
/**
|
|
653
|
-
* check if the string is a hash of type algorithm. Algorithm is one of ['md4', 'md5', 'sha1', 'sha256',
|
|
654
|
-
* 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b']
|
|
655
|
-
*
|
|
656
|
-
* @export
|
|
657
|
-
* @param {HashAlgorithm} algorithm
|
|
658
|
-
* @param {ValidationOptions} [validationOptions]
|
|
659
|
-
* @returns {PropertyDecorator}
|
|
660
|
-
*/
|
|
661
|
-
function IsHash(algorithm, validationOptions) {
|
|
662
|
-
return function (object, propertyName) {
|
|
663
|
-
(0, util_1.setExpose)(object, propertyName);
|
|
664
|
-
(0, class_validator_1.registerDecorator)({
|
|
665
|
-
name: "vIsHash",
|
|
666
|
-
target: object.constructor,
|
|
667
|
-
propertyName,
|
|
668
|
-
options: validationOptions,
|
|
669
|
-
validator: {
|
|
670
|
-
validate(value, args) {
|
|
671
|
-
return (0, class_validator_1.isHash)(value, algorithm);
|
|
672
|
-
},
|
|
673
|
-
defaultMessage(args) {
|
|
674
|
-
return `invalid parameter, ($property) must be is an ${algorithm} Hash string.`;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
exports.IsHash = IsHash;
|
|
681
|
-
//# sourceMappingURL=decorator.js.map
|
package/dist/decorator.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../src/decorator.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,gEAAqC;AAErC,uDAAgD;AAChD,iCAAqF;AACrF,iCAAsG;AACtG,qDAAkN;AA6BlN;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,IAA0C,EAAE,OAAgB;IAC9E,IAAI,KAAK,GAAQ,EAAE,CAAC;IACpB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACvB,KAAK,GAAY,IAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACrC;SAAM;QACH,KAAK,GAAG,IAAI,CAAC;KAChB;IACD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,UAAe,EAAE,EAAE;QACzD,WAAW;QACX,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACjF,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC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