@nest-yalc-2/field-middleware 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +9 -0
- package/package.json +29 -0
- package/src/__tests__/class-transformer.helper.spec.ts +337 -0
- package/src/__tests__/decimal-middleware.helper.spec.ts +35 -0
- package/src/__tests__/field-error.enum.spec.ts +7 -0
- package/src/__tests__/fields-error.enum.spec.ts +17 -0
- package/src/__tests__/nullable-timestamp-middleware.helper.spec.ts +36 -0
- package/src/__tests__/string-format.enum.spec.ts +17 -0
- package/src/__tests__/transformer.helper.spec.ts +38 -0
- package/src/__tests__/tsconfig.json +3 -0
- package/src/__tests__/typeorm-transformer.helper.spec.ts +51 -0
- package/src/__tests__/validator.decorator.spec.ts +57 -0
- package/src/__tests__/validator.helper.spec.ts +92 -0
- package/src/__tests__/validator.interface.spec.ts +42 -0
- package/src/class-transformer.helper.d.ts +10 -0
- package/src/class-transformer.helper.js +63 -0
- package/src/class-transformer.helper.js.map +1 -0
- package/src/class-transformer.helper.ts +69 -0
- package/src/decimal-middleware.helper.d.ts +2 -0
- package/src/decimal-middleware.helper.js +8 -0
- package/src/decimal-middleware.helper.js.map +1 -0
- package/src/decimal-middleware.helper.ts +12 -0
- package/src/field-error.enum.d.ts +3 -0
- package/src/field-error.enum.js +8 -0
- package/src/field-error.enum.js.map +1 -0
- package/src/field-error.enum.ts +3 -0
- package/src/fields-error.enum.d.ts +3 -0
- package/src/fields-error.enum.js +8 -0
- package/src/fields-error.enum.js.map +1 -0
- package/src/fields-error.enum.ts +3 -0
- package/src/index.d.ts +9 -0
- package/src/index.js +26 -0
- package/src/index.js.map +1 -0
- package/src/index.ts +9 -0
- package/src/nullable-timestamp-middleware.helper.d.ts +2 -0
- package/src/nullable-timestamp-middleware.helper.js +9 -0
- package/src/nullable-timestamp-middleware.helper.js.map +1 -0
- package/src/nullable-timestamp-middleware.helper.ts +12 -0
- package/src/string-format.enum.d.ts +3 -0
- package/src/string-format.enum.js +8 -0
- package/src/string-format.enum.js.map +1 -0
- package/src/string-format.enum.ts +3 -0
- package/src/transformer.helper.d.ts +6 -0
- package/src/transformer.helper.js +29 -0
- package/src/transformer.helper.js.map +1 -0
- package/src/transformer.helper.ts +39 -0
- package/src/typeorm-transformer.helper.d.ts +6 -0
- package/src/typeorm-transformer.helper.js +29 -0
- package/src/typeorm-transformer.helper.js.map +1 -0
- package/src/typeorm-transformer.helper.ts +36 -0
- package/src/validator.decorator.d.ts +10 -0
- package/src/validator.decorator.js +53 -0
- package/src/validator.decorator.js.map +1 -0
- package/src/validator.decorator.ts +56 -0
- package/src/validator.helper.d.ts +7 -0
- package/src/validator.helper.js +53 -0
- package/src/validator.helper.js.map +1 -0
- package/src/validator.helper.ts +61 -0
- package/src/validator.interface.d.ts +17 -0
- package/src/validator.interface.js +9 -0
- package/src/validator.interface.js.map +1 -0
- package/src/validator.interface.ts +19 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateValidatorFactory = exports.stringFormatMatchValidatorFactory = void 0;
|
|
4
|
+
exports.StringFormatMatchValidation = StringFormatMatchValidation;
|
|
5
|
+
exports.DateValidation = DateValidation;
|
|
6
|
+
const class_validator_1 = require("class-validator");
|
|
7
|
+
const string_format_enum_js_1 = require("./string-format.enum.js");
|
|
8
|
+
const validator_helper_js_1 = require("./validator.helper.js");
|
|
9
|
+
const stringFormatMatchValidatorFactory = (stringMatchOptions) => {
|
|
10
|
+
return {
|
|
11
|
+
validate(string) {
|
|
12
|
+
const result = (0, validator_helper_js_1.validateStringFormat)(string, stringMatchOptions.pattern);
|
|
13
|
+
return stringMatchOptions.toMatch ? result : !result;
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.stringFormatMatchValidatorFactory = stringFormatMatchValidatorFactory;
|
|
18
|
+
const dateValidatorFactory = () => {
|
|
19
|
+
return {
|
|
20
|
+
validate(date) {
|
|
21
|
+
return (0, validator_helper_js_1.validateDate)(date);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.dateValidatorFactory = dateValidatorFactory;
|
|
26
|
+
function StringFormatMatchValidation(validationOptions, stringMatchOptions = {
|
|
27
|
+
toMatch: true,
|
|
28
|
+
pattern: string_format_enum_js_1.StringFormatEnum.ALL,
|
|
29
|
+
}) {
|
|
30
|
+
return function (object, propertyName) {
|
|
31
|
+
(0, class_validator_1.registerDecorator)({
|
|
32
|
+
name: 'stringFormatMatchValidation',
|
|
33
|
+
target: object.constructor,
|
|
34
|
+
propertyName: propertyName,
|
|
35
|
+
constraints: [],
|
|
36
|
+
options: validationOptions,
|
|
37
|
+
validator: (0, exports.stringFormatMatchValidatorFactory)(stringMatchOptions),
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function DateValidation(validationOptions = {}) {
|
|
42
|
+
return function (object, propertyName) {
|
|
43
|
+
(0, class_validator_1.registerDecorator)({
|
|
44
|
+
name: 'dateValidation',
|
|
45
|
+
target: object.constructor,
|
|
46
|
+
propertyName: propertyName,
|
|
47
|
+
constraints: [],
|
|
48
|
+
options: validationOptions,
|
|
49
|
+
validator: (0, exports.dateValidatorFactory)(),
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=validator.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.decorator.js","sourceRoot":"","sources":["validator.decorator.ts"],"names":[],"mappings":";;;AAyBA,kEAiBC;AAED,wCAWC;AAvDD,qDAAuE;AACvE,mEAA2D;AAC3D,+DAA2E;AAGpE,MAAM,iCAAiC,GAAG,CAC/C,kBAAkD,EAClD,EAAE;IACF,OAAO;QACL,QAAQ,CAAC,MAAc;YACrB,MAAM,MAAM,GAAG,IAAA,0CAAoB,EAAC,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+
import { StringFormatEnum } from './string-format.enum.js';
|
|
3
|
+
import { validateDate, validateStringFormat } from './validator.helper.js';
|
|
4
|
+
import { IStringFormatMatchCheckOptions } from './validator.interface.js';
|
|
5
|
+
|
|
6
|
+
export const stringFormatMatchValidatorFactory = (
|
|
7
|
+
stringMatchOptions: IStringFormatMatchCheckOptions,
|
|
8
|
+
) => {
|
|
9
|
+
return {
|
|
10
|
+
validate(string: string) {
|
|
11
|
+
const result = validateStringFormat(string, stringMatchOptions.pattern);
|
|
12
|
+
return stringMatchOptions.toMatch ? result : !result;
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const dateValidatorFactory = () => {
|
|
18
|
+
return {
|
|
19
|
+
validate(date: Date | string) {
|
|
20
|
+
return validateDate(date);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//Decoratos
|
|
26
|
+
export function StringFormatMatchValidation(
|
|
27
|
+
validationOptions?: ValidationOptions,
|
|
28
|
+
stringMatchOptions: IStringFormatMatchCheckOptions = {
|
|
29
|
+
toMatch: true,
|
|
30
|
+
pattern: StringFormatEnum.ALL,
|
|
31
|
+
},
|
|
32
|
+
) {
|
|
33
|
+
return function (object: any, propertyName: string) {
|
|
34
|
+
registerDecorator({
|
|
35
|
+
name: 'stringFormatMatchValidation',
|
|
36
|
+
target: object.constructor,
|
|
37
|
+
propertyName: propertyName,
|
|
38
|
+
constraints: [],
|
|
39
|
+
options: validationOptions,
|
|
40
|
+
validator: stringFormatMatchValidatorFactory(stringMatchOptions),
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function DateValidation(validationOptions: ValidationOptions = {}) {
|
|
46
|
+
return function (object: any, propertyName: string) {
|
|
47
|
+
registerDecorator({
|
|
48
|
+
name: 'dateValidation',
|
|
49
|
+
target: object.constructor,
|
|
50
|
+
propertyName: propertyName,
|
|
51
|
+
constraints: [],
|
|
52
|
+
options: validationOptions,
|
|
53
|
+
validator: dateValidatorFactory(),
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function errorTrhow(value: string | Date, message?: string): void;
|
|
2
|
+
export declare function convertIfStringToDate(date: Date | string): Date;
|
|
3
|
+
export declare function stringIsInEnumOrThrow<T extends Record<string, string | number>>(toCheck: string, enumName: T, message?: string): true | void;
|
|
4
|
+
export declare function stringIsInEnum<T extends Record<string, string | number>>(toCheck: string, enumName: T): boolean;
|
|
5
|
+
export declare function validateDate(date: Date | string): boolean;
|
|
6
|
+
export declare function validateDateOrThrow(date: Date | string, message?: string): true | void;
|
|
7
|
+
export declare function validateStringFormat(str: string, stringFormat: string): boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errorTrhow = errorTrhow;
|
|
4
|
+
exports.convertIfStringToDate = convertIfStringToDate;
|
|
5
|
+
exports.stringIsInEnumOrThrow = stringIsInEnumOrThrow;
|
|
6
|
+
exports.stringIsInEnum = stringIsInEnum;
|
|
7
|
+
exports.validateDate = validateDate;
|
|
8
|
+
exports.validateDateOrThrow = validateDateOrThrow;
|
|
9
|
+
exports.validateStringFormat = validateStringFormat;
|
|
10
|
+
const fields_error_enum_js_1 = require("./fields-error.enum.js");
|
|
11
|
+
function errorTrhow(value, message) {
|
|
12
|
+
const err = message ? message : `${fields_error_enum_js_1.FieldErrorsEnum.INVALID_VALUE} ${value}`;
|
|
13
|
+
throw new Error(err);
|
|
14
|
+
}
|
|
15
|
+
function convertIfStringToDate(date) {
|
|
16
|
+
if (typeof date === 'string') {
|
|
17
|
+
date = new Date(date);
|
|
18
|
+
}
|
|
19
|
+
return date;
|
|
20
|
+
}
|
|
21
|
+
function stringIsInEnumOrThrow(toCheck, enumName, message) {
|
|
22
|
+
if (stringIsInEnum(toCheck, enumName)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
errorTrhow(toCheck, message);
|
|
26
|
+
}
|
|
27
|
+
function stringIsInEnum(toCheck, enumName) {
|
|
28
|
+
for (const enumProperty of Object.values(enumName)) {
|
|
29
|
+
if (`${enumProperty}`.toLowerCase() === toCheck.toLowerCase()) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
function validateDate(date) {
|
|
36
|
+
date = convertIfStringToDate(date);
|
|
37
|
+
if (Object.prototype.toString.call(date) === '[object Date]') {
|
|
38
|
+
if (!isNaN(date.getTime())) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
function validateDateOrThrow(date, message) {
|
|
45
|
+
if (validateDate(date)) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
errorTrhow(date, message);
|
|
49
|
+
}
|
|
50
|
+
function validateStringFormat(str, stringFormat) {
|
|
51
|
+
return str.match(stringFormat) !== null;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=validator.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.helper.js","sourceRoot":"","sources":["validator.helper.ts"],"names":[],"mappings":";;AAEA,gCAGC;AAED,sDAKC;AAED,sDAOC;AAED,wCAUC;AAED,oCAQC;AAED,kDAQC;AAED,oDAKC;AA5DD,iEAAyD;AAEzD,SAAgB,UAAU,CAAC,KAAoB,EAAE,OAAgB;IAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,sCAAe,CAAC,aAAa,IAAI,KAAK,EAAE,CAAC;IAC5E,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,SAAgB,qBAAqB,CAAC,IAAmB;IACvD,IAAI,OAA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,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { FieldErrorsEnum } from './fields-error.enum.js';
|
|
2
|
+
|
|
3
|
+
export function errorTrhow(value: string | Date, message?: string) {
|
|
4
|
+
const err = message ? message : `${FieldErrorsEnum.INVALID_VALUE} ${value}`;
|
|
5
|
+
throw new Error(err);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function convertIfStringToDate(date: Date | string): Date {
|
|
9
|
+
if (typeof date === 'string') {
|
|
10
|
+
date = new Date(date);
|
|
11
|
+
}
|
|
12
|
+
return date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function stringIsInEnumOrThrow<
|
|
16
|
+
T extends Record<string, string | number>,
|
|
17
|
+
>(toCheck: string, enumName: T, message?: string): true | void {
|
|
18
|
+
if (stringIsInEnum(toCheck, enumName)) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
errorTrhow(toCheck, message);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function stringIsInEnum<T extends Record<string, string | number>>(
|
|
25
|
+
toCheck: string,
|
|
26
|
+
enumName: T,
|
|
27
|
+
): boolean {
|
|
28
|
+
for (const enumProperty of Object.values(enumName)) {
|
|
29
|
+
if (`${enumProperty}`.toLowerCase() === toCheck.toLowerCase()) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function validateDate(date: Date | string): boolean {
|
|
37
|
+
date = convertIfStringToDate(date);
|
|
38
|
+
if (Object.prototype.toString.call(date) === '[object Date]') {
|
|
39
|
+
if (!isNaN(date.getTime())) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function validateDateOrThrow(
|
|
47
|
+
date: Date | string,
|
|
48
|
+
message?: string,
|
|
49
|
+
): true | void {
|
|
50
|
+
if (validateDate(date)) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
errorTrhow(date, message);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function validateStringFormat(
|
|
57
|
+
str: string,
|
|
58
|
+
stringFormat: string,
|
|
59
|
+
): boolean {
|
|
60
|
+
return str.match(stringFormat) !== null;
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum DateCheckTypeEnum {
|
|
2
|
+
MAX = "max",
|
|
3
|
+
MIN = "min"
|
|
4
|
+
}
|
|
5
|
+
export interface IDate {
|
|
6
|
+
year: number;
|
|
7
|
+
month: number;
|
|
8
|
+
date: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IDateCheck {
|
|
11
|
+
checkType: DateCheckTypeEnum;
|
|
12
|
+
dateToAdd: IDate;
|
|
13
|
+
}
|
|
14
|
+
export interface IStringFormatMatchCheckOptions {
|
|
15
|
+
toMatch: boolean;
|
|
16
|
+
pattern: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateCheckTypeEnum = void 0;
|
|
4
|
+
var DateCheckTypeEnum;
|
|
5
|
+
(function (DateCheckTypeEnum) {
|
|
6
|
+
DateCheckTypeEnum["MAX"] = "max";
|
|
7
|
+
DateCheckTypeEnum["MIN"] = "min";
|
|
8
|
+
})(DateCheckTypeEnum || (exports.DateCheckTypeEnum = DateCheckTypeEnum = {}));
|
|
9
|
+
//# sourceMappingURL=validator.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.interface.js","sourceRoot":"","sources":["validator.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,gCAAW,CAAA;IACX,gCAAW,CAAA;AACb,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export enum DateCheckTypeEnum {
|
|
2
|
+
MAX = 'max',
|
|
3
|
+
MIN = 'min',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface IDate {
|
|
7
|
+
year: number;
|
|
8
|
+
month: number;
|
|
9
|
+
date: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IDateCheck {
|
|
13
|
+
checkType: DateCheckTypeEnum;
|
|
14
|
+
dateToAdd: IDate;
|
|
15
|
+
}
|
|
16
|
+
export interface IStringFormatMatchCheckOptions {
|
|
17
|
+
toMatch: boolean;
|
|
18
|
+
pattern: string;
|
|
19
|
+
}
|