@nest-omni/core 1.0.56-0 → 1.0.56-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/common/utils.js +4 -3
- package/decorators/api-page-ok-response.decorator.js +2 -1
- package/decorators/auth-user.decorator.js +2 -1
- package/decorators/controller.decorator.js +2 -1
- package/decorators/field.decorators.js +38 -37
- package/decorators/http.decorators.js +2 -1
- package/decorators/property.decorators.js +7 -6
- package/decorators/swagger.schema.js +2 -1
- package/decorators/timestamp-column.decorator.js +2 -1
- package/decorators/transform.decorators.js +9 -8
- package/decorators/translate.decorator.js +3 -3
- package/decorators/use-dto.decorator.js +2 -1
- package/decorators/user-check.decorator.js +2 -2
- package/decorators/user.decorator.js +2 -2
- package/decorators/user_auth.decorator.js +2 -1
- package/decorators/validator.decorators.js +8 -7
- package/helpers/common.helper.js +3 -3
- package/helpers/date.helper.js +7 -6
- package/interceptors/language-interceptor.service.js +2 -2
- package/interfaces/IFile.d.ts +1 -0
- package/package.json +4 -2
- package/setup/bootstrap.setup.d.ts +3 -0
- package/setup/bootstrap.setup.js +4 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/validator-json/decorators.js +3 -2
- package/validator-json/default.js +3 -3
- package/validators/is-exists.validator.js +2 -2
- package/validators/is-unique.validator.js +2 -2
- package/validators/phone-country-code.validator.js +2 -1
- package/validators/same-as.validator.js +2 -1
- package/validators/skip-empty.validator.js +2 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JSONSchema =
|
|
4
|
-
exports.getMetadataSchema = getMetadataSchema;
|
|
3
|
+
exports.getMetadataSchema = exports.JSONSchema = void 0;
|
|
5
4
|
require("reflect-metadata");
|
|
6
5
|
const SCHEMA_KEY = Symbol('class-validator-jsonschema:JSONSchema');
|
|
7
6
|
function JSONSchema(schema) {
|
|
@@ -14,9 +13,11 @@ function JSONSchema(schema) {
|
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
15
|
}
|
|
16
|
+
exports.JSONSchema = JSONSchema;
|
|
17
17
|
function getMetadataSchema(target, key) {
|
|
18
18
|
return Reflect.getMetadata(SCHEMA_KEY, target.constructor, key) || {};
|
|
19
19
|
}
|
|
20
|
+
exports.getMetadataSchema = getMetadataSchema;
|
|
20
21
|
function setMetadataSchema(value, target, key) {
|
|
21
22
|
return Reflect.defineMetadata(SCHEMA_KEY, value, target, key);
|
|
22
23
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JSONSchema = void 0;
|
|
4
|
-
exports.validationMetadataArrayToSchemas = validationMetadataArrayToSchemas;
|
|
5
|
-
exports.targetConstructorToSchema = targetConstructorToSchema;
|
|
3
|
+
exports.targetConstructorToSchema = exports.validationMetadataArrayToSchemas = exports.JSONSchema = void 0;
|
|
6
4
|
const cv = require("class-validator");
|
|
7
5
|
const lodash_1 = require("lodash");
|
|
8
6
|
const defaultConverters_1 = require("./defaultConverters");
|
|
@@ -36,6 +34,7 @@ function validationMetadataArrayToSchemas(metadatas, i18n, userOptions) {
|
|
|
36
34
|
});
|
|
37
35
|
return rules;
|
|
38
36
|
}
|
|
37
|
+
exports.validationMetadataArrayToSchemas = validationMetadataArrayToSchemas;
|
|
39
38
|
function getFirstNonNullDataType(data) {
|
|
40
39
|
for (const item of data) {
|
|
41
40
|
const dataType = item.dataType;
|
|
@@ -53,6 +52,7 @@ function targetConstructorToSchema(targetConstructor, i18n, userOptions) {
|
|
|
53
52
|
metadatas = populateMetadatasWithConstraints(storage, metadatas);
|
|
54
53
|
return validationMetadataArrayToSchemas(metadatas, i18n, userOptions);
|
|
55
54
|
}
|
|
55
|
+
exports.targetConstructorToSchema = targetConstructorToSchema;
|
|
56
56
|
function populateMetadatasWithConstraints(storage, metadatas) {
|
|
57
57
|
return metadatas.map((meta) => {
|
|
58
58
|
if (meta.constraintCls) {
|
|
@@ -18,8 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.IsExistsValidator = void 0;
|
|
22
|
-
exports.IsExists = IsExists;
|
|
21
|
+
exports.IsExists = exports.IsExistsValidator = void 0;
|
|
23
22
|
const class_validator_1 = require("class-validator");
|
|
24
23
|
const typeorm_1 = require("typeorm");
|
|
25
24
|
const typeorm_transactional_1 = require("typeorm-transactional");
|
|
@@ -60,3 +59,4 @@ function IsExists(constraints, validationOptions) {
|
|
|
60
59
|
});
|
|
61
60
|
};
|
|
62
61
|
}
|
|
62
|
+
exports.IsExists = IsExists;
|
|
@@ -18,8 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.IsUniqueValidator = void 0;
|
|
22
|
-
exports.IsUnique = IsUnique;
|
|
21
|
+
exports.IsUnique = exports.IsUniqueValidator = void 0;
|
|
23
22
|
const class_validator_1 = require("class-validator");
|
|
24
23
|
const typeorm_1 = require("typeorm");
|
|
25
24
|
const typeorm_transactional_1 = require("typeorm-transactional");
|
|
@@ -91,3 +90,4 @@ function IsUnique(constraints, validationOptions) {
|
|
|
91
90
|
});
|
|
92
91
|
};
|
|
93
92
|
}
|
|
93
|
+
exports.IsUnique = IsUnique;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsPhoneNumberWithCountryCode =
|
|
3
|
+
exports.IsPhoneNumberWithCountryCode = void 0;
|
|
4
4
|
const class_validator_1 = require("class-validator");
|
|
5
5
|
function IsPhoneNumberWithCountryCode(validationOptions) {
|
|
6
6
|
return function (object, propertyName) {
|
|
@@ -27,3 +27,4 @@ function IsPhoneNumberWithCountryCode(validationOptions) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
exports.IsPhoneNumberWithCountryCode = IsPhoneNumberWithCountryCode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SameAs =
|
|
3
|
+
exports.SameAs = void 0;
|
|
4
4
|
const class_validator_1 = require("class-validator");
|
|
5
5
|
function SameAs(property, validationOptions) {
|
|
6
6
|
return function (object, propertyName) {
|
|
@@ -22,3 +22,4 @@ function SameAs(property, validationOptions) {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
+
exports.SameAs = SameAs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SkipEmpty =
|
|
3
|
+
exports.SkipEmpty = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const swagger_1 = require("@nestjs/swagger");
|
|
6
6
|
const class_validator_1 = require("class-validator");
|
|
@@ -15,3 +15,4 @@ function SkipEmpty(field) {
|
|
|
15
15
|
((0, lodash_1.isString)(value) && value.trim() === ''));
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
|
+
exports.SkipEmpty = SkipEmpty;
|