@nest-omni/core 1.0.25 → 1.0.27
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/dto/bulk-id.dto.d.ts +1 -1
- package/common/dto/bulk-id.dto.js +2 -2
- package/decorators/field.decorators.js +3 -5
- package/middlewares/index.d.ts +1 -0
- package/middlewares/index.js +1 -0
- package/middlewares/xml.middleware.d.ts +4 -0
- package/middlewares/xml.middleware.js +24 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -17,10 +17,10 @@ class BulkIdDto {
|
|
|
17
17
|
exports.BulkIdDto = BulkIdDto;
|
|
18
18
|
__decorate([
|
|
19
19
|
(0, swagger_1.ApiProperty)({
|
|
20
|
-
type: '
|
|
20
|
+
type: 'string',
|
|
21
21
|
description: 'ID',
|
|
22
22
|
isArray: true,
|
|
23
|
-
required:
|
|
23
|
+
required: true,
|
|
24
24
|
}),
|
|
25
25
|
(0, class_validator_1.IsArray)(),
|
|
26
26
|
__metadata("design:type", Array)
|
|
@@ -242,7 +242,7 @@ function ClassField(getClass, options = {}) {
|
|
|
242
242
|
decorators.push((0, class_validator_1.NotEquals)(null));
|
|
243
243
|
}
|
|
244
244
|
if (options.swagger !== false) {
|
|
245
|
-
decorators.push((0, swagger_1.ApiProperty)(Object.assign({ type: () => classValue }, options)));
|
|
245
|
+
decorators.push((0, swagger_1.ApiProperty)(Object.assign({ type: () => classValue, isArray: options.each }, options)));
|
|
246
246
|
}
|
|
247
247
|
if (options.each) {
|
|
248
248
|
decorators.push((0, transform_decorators_1.ToArray)());
|
|
@@ -261,9 +261,7 @@ exports.ClassFieldOptional = ClassFieldOptional;
|
|
|
261
261
|
function EmailField(options = {}) {
|
|
262
262
|
var _a;
|
|
263
263
|
const decorators = [
|
|
264
|
-
(0, class_validator_1.IsEmail)(options.emailOptions, {
|
|
265
|
-
message: (_a = options.message) !== null && _a !== void 0 ? _a : (0, nestjs_i18n_1.i18nValidationMessage)('validation.INVALID_EMAIL'),
|
|
266
|
-
}),
|
|
264
|
+
(0, class_validator_1.IsEmail)(options.emailOptions, Object.assign({ message: (_a = options.message) !== null && _a !== void 0 ? _a : (0, nestjs_i18n_1.i18nValidationMessage)('validation.INVALID_EMAIL') }, options)),
|
|
267
265
|
StringField(Object.assign({ toLowerCase: true }, options)),
|
|
268
266
|
];
|
|
269
267
|
if (options.nullable) {
|
|
@@ -438,7 +436,7 @@ function ObjectField(options) {
|
|
|
438
436
|
decorators.push((0, class_validator_1.NotEquals)(null, { each: options.each }));
|
|
439
437
|
}
|
|
440
438
|
if (options.swagger !== false) {
|
|
441
|
-
decorators.push((0, swagger_1.ApiProperty)(Object.assign({ type: 'object' }, options)));
|
|
439
|
+
decorators.push((0, swagger_1.ApiProperty)(Object.assign({ type: 'object', isArray: options.each }, options)));
|
|
442
440
|
}
|
|
443
441
|
return (0, common_1.applyDecorators)(...decorators);
|
|
444
442
|
}
|
package/middlewares/index.d.ts
CHANGED
package/middlewares/index.js
CHANGED
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./request-id.middleware"), exports);
|
|
18
18
|
__exportStar(require("./powerby.middleware"), exports);
|
|
19
19
|
__exportStar(require("./omni-auth.middleware"), exports);
|
|
20
|
+
__exportStar(require("./xml.middleware"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.XMLMiddleware = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const bodyParser = require("body-parser");
|
|
12
|
+
const bodyParserMiddleware = bodyParser.text({
|
|
13
|
+
limit: '1024kb',
|
|
14
|
+
type: 'application/xml',
|
|
15
|
+
});
|
|
16
|
+
let XMLMiddleware = class XMLMiddleware {
|
|
17
|
+
use(req, res, next) {
|
|
18
|
+
bodyParserMiddleware(req, res, next);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.XMLMiddleware = XMLMiddleware;
|
|
22
|
+
exports.XMLMiddleware = XMLMiddleware = __decorate([
|
|
23
|
+
(0, common_1.Injectable)()
|
|
24
|
+
], XMLMiddleware);
|