Skip to content

Commit 0d5972c

Browse files
build(@nestjs) force compilation (new bundle)
1 parent 394d7f2 commit 0d5972c

48 files changed

Lines changed: 3010 additions & 3093 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { HttpException } from './http.exception';
2+
/**
3+
* Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot".
4+
* The resulting entity body MAY be short and stout.
5+
*
6+
* http://save418.com/
7+
*/
8+
export declare class ImATeapotException extends HttpException {
9+
constructor(message?: string | object | any, error?: string);
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
const http_exception_1 = require("./http.exception");
4+
const http_status_enum_1 = require("../enums/http-status.enum");
5+
const http_exception_body_util_1 = require("../utils/http-exception-body.util");
6+
/**
7+
* Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot".
8+
* The resulting entity body MAY be short and stout.
9+
*
10+
* http://save418.com/
11+
*/
12+
class ImATeapotException extends http_exception_1.HttpException {
13+
constructor(message, error = 'I\'m a teapot') {
14+
super(http_exception_body_util_1.createHttpExceptionBody(message, error, http_status_enum_1.HttpStatus.I_AM_A_TEAPOT), http_status_enum_1.HttpStatus.I_AM_A_TEAPOT);
15+
}
16+
}
17+
exports.ImATeapotException = ImATeapotException;

bundle/common/exceptions/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ export * from './not-implemented.exception';
1616
export * from './bad-gateway.exception';
1717
export * from './service-unavailable.exception';
1818
export * from './gateway-timeout.exception';
19+
export * from './im-a-teapot.exception';

bundle/common/exceptions/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ __export(require("./not-implemented.exception"));
2121
__export(require("./bad-gateway.exception"));
2222
__export(require("./service-unavailable.exception"));
2323
__export(require("./gateway-timeout.exception"));
24+
__export(require("./im-a-teapot.exception"));
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const MULTER_MODULE_OPTIONS = "MULTER_MODULE_OPTIONS";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.MULTER_MODULE_OPTIONS = 'MULTER_MODULE_OPTIONS';

bundle/common/files/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './interceptors';
2+
export * from './interfaces';
3+
export * from './multer.module';

bundle/common/files/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"use strict";
2+
function __export(m) {
3+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4+
}
5+
Object.defineProperty(exports, "__esModule", { value: true });
6+
__export(require("./interceptors"));
7+
__export(require("./multer.module"));
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { MulterField, MulterOptions } from '../../interfaces/external/multer-options.interface';
2+
export declare function FileFieldsInterceptor(uploadFields: MulterField[], localOptions?: MulterOptions): any;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
var __metadata = (this && this.__metadata) || function (k, v) {
9+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10+
};
11+
var __param = (this && this.__param) || function (paramIndex, decorator) {
12+
return function (target, key) { decorator(target, key, paramIndex); }
13+
};
14+
Object.defineProperty(exports, "__esModule", { value: true });
15+
const multer = require("multer");
16+
const decorators_1 = require("../../decorators");
17+
const component_decorator_1 = require("../../decorators/core/component.decorator");
18+
const files_constants_1 = require("./../files.constants");
19+
const multer_utils_1 = require("./../multer/multer.utils");
20+
function FileFieldsInterceptor(uploadFields, localOptions) {
21+
let MixinInterceptor = class MixinInterceptor {
22+
constructor(options = {}) {
23+
this.upload = multer(Object.assign({}, options, localOptions));
24+
}
25+
async intercept(context, call$) {
26+
const ctx = context.switchToHttp();
27+
await new Promise((resolve, reject) => this.upload.fields(uploadFields)(ctx.getRequest(), ctx.getResponse(), err => {
28+
if (err) {
29+
const error = multer_utils_1.transformException(err);
30+
return reject(error);
31+
}
32+
resolve();
33+
}));
34+
return call$;
35+
}
36+
};
37+
MixinInterceptor = __decorate([
38+
__param(0, decorators_1.Optional()),
39+
__param(0, decorators_1.Inject(files_constants_1.MULTER_MODULE_OPTIONS)),
40+
__metadata("design:paramtypes", [Object])
41+
], MixinInterceptor);
42+
const Interceptor = component_decorator_1.mixin(MixinInterceptor);
43+
return Interceptor;
44+
}
45+
exports.FileFieldsInterceptor = FileFieldsInterceptor;

0 commit comments

Comments
 (0)