@tsed/platform-koa 7.0.0-alpha.2 → 7.0.0-beta.11
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/lib/cjs/components/PlatformKoa.js +145 -0
- package/lib/cjs/components/PlatformKoa.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/caseSensitive.js +1 -1
- package/lib/cjs/decorators/caseSensitive.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/ctx.js +1 -1
- package/lib/cjs/decorators/ctx.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/routerSettings.js +1 -1
- package/lib/cjs/decorators/routerSettings.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/state.js +0 -0
- package/lib/cjs/decorators/state.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/strict.js +1 -1
- package/lib/cjs/decorators/strict.js.map +1 -0
- package/lib/cjs/exports.js +7 -0
- package/lib/cjs/exports.js.map +1 -0
- package/lib/cjs/index.js +22 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/PlatformKoaSettings.js +0 -0
- package/lib/cjs/interfaces/PlatformKoaSettings.js.map +1 -0
- package/lib/{interfaces/index.js → cjs/interfaces/interfaces.js} +1 -1
- package/lib/cjs/interfaces/interfaces.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/resourceNotFoundMiddleware.js +2 -2
- package/lib/cjs/middlewares/resourceNotFoundMiddleware.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/staticsMiddleware.js +1 -1
- package/lib/cjs/middlewares/staticsMiddleware.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/{services → cjs/services}/PlatformKoaHandler.js +0 -0
- package/lib/cjs/services/PlatformKoaHandler.js.map +1 -0
- package/lib/cjs/services/PlatformKoaRequest.js +44 -0
- package/lib/cjs/services/PlatformKoaRequest.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformKoaResponse.js +10 -10
- package/lib/cjs/services/PlatformKoaResponse.js.map +1 -0
- package/lib/cjs/utils/multer.js +80 -0
- package/lib/cjs/utils/multer.js.map +1 -0
- package/lib/esm/components/PlatformKoa.js +140 -0
- package/lib/esm/components/PlatformKoa.js.map +1 -0
- package/lib/esm/decorators/caseSensitive.js +26 -0
- package/lib/esm/decorators/caseSensitive.js.map +1 -0
- package/lib/esm/decorators/ctx.js +27 -0
- package/lib/esm/decorators/ctx.js.map +1 -0
- package/lib/esm/decorators/routerSettings.js +27 -0
- package/lib/esm/decorators/routerSettings.js.map +1 -0
- package/lib/esm/decorators/state.js +5 -0
- package/lib/esm/decorators/state.js.map +1 -0
- package/lib/esm/decorators/strict.js +27 -0
- package/lib/esm/decorators/strict.js.map +1 -0
- package/lib/esm/exports.js +5 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +19 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/interfaces/PlatformKoaSettings.js +2 -0
- package/lib/esm/interfaces/PlatformKoaSettings.js.map +1 -0
- package/lib/esm/interfaces/interfaces.js +2 -0
- package/lib/esm/interfaces/interfaces.js.map +1 -0
- package/lib/esm/middlewares/resourceNotFoundMiddleware.js +16 -0
- package/lib/esm/middlewares/resourceNotFoundMiddleware.js.map +1 -0
- package/lib/esm/middlewares/staticsMiddleware.js +30 -0
- package/lib/esm/middlewares/staticsMiddleware.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/PlatformKoaHandler.js +56 -0
- package/lib/esm/services/PlatformKoaHandler.js.map +1 -0
- package/lib/esm/services/PlatformKoaRequest.js +40 -0
- package/lib/esm/services/PlatformKoaRequest.js.map +1 -0
- package/lib/esm/services/PlatformKoaResponse.js +101 -0
- package/lib/esm/services/PlatformKoaResponse.js.map +1 -0
- package/lib/{utils → esm/utils}/multer.js +6 -8
- package/lib/esm/utils/multer.js.map +1 -0
- package/lib/types/components/PlatformKoa.d.ts +67 -0
- package/lib/{decorators → types/decorators}/caseSensitive.d.ts +0 -0
- package/lib/{decorators → types/decorators}/ctx.d.ts +0 -0
- package/lib/{decorators → types/decorators}/routerSettings.d.ts +0 -0
- package/lib/{decorators → types/decorators}/state.d.ts +0 -0
- package/lib/{decorators → types/decorators}/strict.d.ts +0 -0
- package/lib/types/exports.d.ts +1 -0
- package/lib/types/index.d.ts +18 -0
- package/lib/types/interfaces/PlatformKoaSettings.d.ts +15 -0
- package/lib/{interfaces/index.d.ts → types/interfaces/interfaces.d.ts} +0 -0
- package/lib/{middlewares → types/middlewares}/resourceNotFoundMiddleware.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/staticsMiddleware.d.ts +0 -0
- package/lib/{services → types/services}/PlatformKoaHandler.d.ts +0 -0
- package/lib/{services → types/services}/PlatformKoaRequest.d.ts +1 -1
- package/lib/{services → types/services}/PlatformKoaResponse.d.ts +3 -3
- package/lib/{utils → types/utils}/multer.d.ts +0 -0
- package/package.json +70 -39
- package/readme.md +0 -2
- package/tsconfig.compile.esm.json +12 -0
- package/lib/components/PlatformKoa.d.ts +0 -32
- package/lib/components/PlatformKoa.js +0 -65
- package/lib/components/PlatformKoa.js.map +0 -1
- package/lib/decorators/caseSensitive.js.map +0 -1
- package/lib/decorators/ctx.js.map +0 -1
- package/lib/decorators/index.d.ts +0 -5
- package/lib/decorators/index.js +0 -9
- package/lib/decorators/index.js.map +0 -1
- package/lib/decorators/routerSettings.js.map +0 -1
- package/lib/decorators/state.js.map +0 -1
- package/lib/decorators/strict.js.map +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -16
- package/lib/index.js.map +0 -1
- package/lib/interfaces/PlatformKoaSettings.d.ts +0 -8
- package/lib/interfaces/PlatformKoaSettings.js.map +0 -1
- package/lib/interfaces/index.js.map +0 -1
- package/lib/middlewares/resourceNotFoundMiddleware.js.map +0 -1
- package/lib/middlewares/staticsMiddleware.js.map +0 -1
- package/lib/services/PlatformKoaApplication.d.ts +0 -22
- package/lib/services/PlatformKoaApplication.js +0 -31
- package/lib/services/PlatformKoaApplication.js.map +0 -1
- package/lib/services/PlatformKoaHandler.js.map +0 -1
- package/lib/services/PlatformKoaRequest.js +0 -44
- package/lib/services/PlatformKoaRequest.js.map +0 -1
- package/lib/services/PlatformKoaResponse.js.map +0 -1
- package/lib/services/PlatformKoaRouter.d.ts +0 -22
- package/lib/services/PlatformKoaRouter.js +0 -45
- package/lib/services/PlatformKoaRouter.js.map +0 -1
- package/lib/services/index.d.ts +0 -5
- package/lib/services/index.js +0 -9
- package/lib/services/index.js.map +0 -1
- package/lib/utils/multer.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="koa__router" />
|
|
2
|
-
import KoaRouter from "@koa/router";
|
|
3
|
-
import { Configuration, PlatformApplication, PlatformHandler } from "@tsed/common";
|
|
4
|
-
import Koa from "koa";
|
|
5
|
-
import { PlatformKoaRouter } from "./PlatformKoaRouter";
|
|
6
|
-
declare global {
|
|
7
|
-
namespace TsED {
|
|
8
|
-
interface Application extends Koa {
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @platform
|
|
14
|
-
* @express
|
|
15
|
-
*/
|
|
16
|
-
export declare class PlatformKoaApplication extends PlatformKoaRouter implements PlatformApplication<Koa, KoaRouter> {
|
|
17
|
-
app: Koa;
|
|
18
|
-
rawApp: Koa;
|
|
19
|
-
constructor(platformHandler: PlatformHandler, configuration: Configuration);
|
|
20
|
-
getApp(): Koa;
|
|
21
|
-
callback(): any;
|
|
22
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformKoaApplication = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@tsed/common");
|
|
6
|
-
const koa_1 = tslib_1.__importDefault(require("koa"));
|
|
7
|
-
const PlatformKoaRouter_1 = require("./PlatformKoaRouter");
|
|
8
|
-
const koaQs = require("koa-qs");
|
|
9
|
-
/**
|
|
10
|
-
* @platform
|
|
11
|
-
* @express
|
|
12
|
-
*/
|
|
13
|
-
let PlatformKoaApplication = class PlatformKoaApplication extends PlatformKoaRouter_1.PlatformKoaRouter {
|
|
14
|
-
constructor(platformHandler, configuration) {
|
|
15
|
-
super(platformHandler, configuration, {});
|
|
16
|
-
this.rawApp = configuration.get("koa.app") || new koa_1.default();
|
|
17
|
-
koaQs(this.rawApp, "extended");
|
|
18
|
-
}
|
|
19
|
-
getApp() {
|
|
20
|
-
return this.rawApp;
|
|
21
|
-
}
|
|
22
|
-
callback() {
|
|
23
|
-
return this.getApp().callback();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
PlatformKoaApplication = tslib_1.__decorate([
|
|
27
|
-
tslib_1.__param(0, common_1.Inject()), tslib_1.__param(1, common_1.Configuration()),
|
|
28
|
-
tslib_1.__metadata("design:paramtypes", [common_1.PlatformHandler, Object])
|
|
29
|
-
], PlatformKoaApplication);
|
|
30
|
-
exports.PlatformKoaApplication = PlatformKoaApplication;
|
|
31
|
-
//# sourceMappingURL=PlatformKoaApplication.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoaApplication.js","sourceRoot":"","sources":["../../src/services/PlatformKoaApplication.ts"],"names":[],"mappings":";;;;AACA,yCAAyF;AACzF,sDAAsB;AACtB,2DAAsD;AAEtD,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAQhC;;;GAGG;AACH,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,qCAAiB;IAI3D,YAAsB,eAAgC,EAAmB,aAA4B;QACnG,KAAK,CAAC,eAAe,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;QAE1C,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,aAAG,EAAE,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AAlBY,sBAAsB;IAIpB,mBAAA,eAAM,EAAE,CAAA,EAAoC,mBAAA,sBAAa,EAAE,CAAA;6CAAjC,wBAAe;GAJ3C,sBAAsB,CAkBlC;AAlBY,wDAAsB","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {Configuration, Inject, PlatformApplication, PlatformHandler} from \"@tsed/common\";\nimport Koa from \"koa\";\nimport {PlatformKoaRouter} from \"./PlatformKoaRouter\";\n\nconst koaQs = require(\"koa-qs\");\n\ndeclare global {\n namespace TsED {\n export interface Application extends Koa {}\n }\n}\n\n/**\n * @platform\n * @express\n */\nexport class PlatformKoaApplication extends PlatformKoaRouter implements PlatformApplication<Koa, KoaRouter> {\n app: Koa;\n rawApp: Koa;\n\n constructor(@Inject() platformHandler: PlatformHandler, @Configuration() configuration: Configuration) {\n super(platformHandler, configuration, {});\n\n this.rawApp = configuration.get(\"koa.app\") || new Koa();\n koaQs(this.rawApp, \"extended\");\n }\n\n getApp(): Koa {\n return this.rawApp;\n }\n\n callback(): any {\n return this.getApp().callback();\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoaHandler.js","sourceRoot":"","sources":["../../src/services/PlatformKoaHandler.ts"],"names":[],"mappings":";;;AAAA,yCAA8G;AAE9G,gCAA8B;AAE9B,MAAM,cAAc,GAAG,CAAC,oBAAW,CAAC,QAAQ,EAAE,oBAAW,CAAC,UAAU,EAAE,oBAAW,CAAC,cAAc,EAAE,oBAAW,CAAC,MAAM,CAAC,CAAC;AAEtH,MAAa,kBAAmB,SAAQ,wBAAe;IAC9C,KAAK,CAAC,KAAK,CAAC,IAAS,EAAE,GAAoB;QAChD,IAAI,IAAI,KAAK,SAAS,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE;YAChD,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC;SAC/B;QAED,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;IAES,gBAAgB,CAAC,QAAyB;QAClD,IAAI,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC9C,OAAO,KAAK,EAAE,GAAgB,EAAE,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,EAAC,CAAC,CAAC;SAC5F;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,cAAgC;QACxD,MAAM,EAAC,QAAQ,EAAE,IAAI,EAAC,GAAG,cAAc,CAAC;QAExC,IAAI,IAAI,CAAC,IAAI,YAAY,KAAK,EAAE;YAC9B,IAAI,QAAQ,CAAC,aAAa,EAAE;gBAC1B,cAAc,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC;aAChC;iBAAM;gBACL,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;aAChD;SACF;QAED,OAAO,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACzC,CAAC;IAES,OAAO,CAAC,KAAc,EAAE,cAAgC;QAChE,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,GAAG,cAAc,CAAC;QAE9C,uBAAuB;QACvB,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;YACjB,OAAO;SACR;QAED,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAElB,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;YAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAE7B,OAAO;SACR;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IAES,KAAK,CAAC,YAAY,CAAC,cAAgC;QAC3D,MAAM,EAAC,IAAI,EAAC,GAAG,cAAc,CAAC;QAE9B,IAAI;YACF,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;SACjD;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SAC9B;IACH,CAAC;IAES,UAAU,CAAC,KAAU,EAAE,IAAqB;QACpD,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF;AAhED,gDAgEC","sourcesContent":["import {HandlerMetadata, HandlerType, OnRequestOptions, PlatformContext, PlatformHandler} from \"@tsed/common\";\nimport Koa from \"koa\";\nimport \"./PlatformKoaRequest\";\n\nconst OVERRIDE_TYPES = [HandlerType.ENDPOINT, HandlerType.MIDDLEWARE, HandlerType.ERR_MIDDLEWARE, HandlerType.CTX_FN];\n\nexport class PlatformKoaHandler extends PlatformHandler {\n public async flush(data: any, ctx: PlatformContext): Promise<void> {\n if (data === undefined && ctx.getResponse().body) {\n data = ctx.getResponse().body;\n }\n\n return super.flush(data, ctx);\n }\n\n protected createRawHandler(metadata: HandlerMetadata) {\n if (OVERRIDE_TYPES.includes(metadata.type)) {\n const handler = this.compileHandler(metadata);\n return async (ctx: Koa.Context, next: Koa.Next) => handler({next, $ctx: ctx.request.$ctx});\n }\n\n return super.createRawHandler(metadata);\n }\n\n protected async onRequest(requestOptions: OnRequestOptions): Promise<any> {\n const {metadata, $ctx} = requestOptions;\n\n if ($ctx.data instanceof Error) {\n if (metadata.hasErrorParam) {\n requestOptions.err = $ctx.data;\n } else {\n return this.onError($ctx.data, requestOptions);\n }\n }\n\n return super.onRequest(requestOptions);\n }\n\n protected onError(error: unknown, requestOptions: OnRequestOptions) {\n const {next, $ctx, metadata} = requestOptions;\n\n // istanbul ignore next\n if ($ctx.isDone()) {\n return;\n }\n\n $ctx.data = error;\n\n if (!next || metadata.isFinal()) {\n this.throwError(error, $ctx);\n\n return;\n }\n\n return next();\n }\n\n protected async onCtxRequest(requestOptions: OnRequestOptions): Promise<any> {\n const {$ctx} = requestOptions;\n\n try {\n return await super.onCtxRequest(requestOptions);\n } catch (error) {\n this.throwError(error, $ctx);\n }\n }\n\n protected throwError(error: any, $ctx: PlatformContext) {\n $ctx.getApp().emit(\"error\", error, $ctx.getRequest().ctx);\n }\n}\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _ctx;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PlatformKoaRequest = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
require("@koa/router");
|
|
7
|
-
const common_1 = require("@tsed/common");
|
|
8
|
-
/**
|
|
9
|
-
* @platform
|
|
10
|
-
* @koa
|
|
11
|
-
*/
|
|
12
|
-
class PlatformKoaRequest extends common_1.PlatformRequest {
|
|
13
|
-
constructor(event) {
|
|
14
|
-
super(event);
|
|
15
|
-
_ctx.set(this, void 0);
|
|
16
|
-
tslib_1.__classPrivateFieldSet(this, _ctx, this.raw.ctx);
|
|
17
|
-
}
|
|
18
|
-
get protocol() {
|
|
19
|
-
return tslib_1.__classPrivateFieldGet(this, _ctx).request.protocol;
|
|
20
|
-
}
|
|
21
|
-
get host() {
|
|
22
|
-
return tslib_1.__classPrivateFieldGet(this, _ctx).request.host;
|
|
23
|
-
}
|
|
24
|
-
get secure() {
|
|
25
|
-
return tslib_1.__classPrivateFieldGet(this, _ctx).request.secure;
|
|
26
|
-
}
|
|
27
|
-
get cookies() {
|
|
28
|
-
return tslib_1.__classPrivateFieldGet(this, _ctx).cookie || tslib_1.__classPrivateFieldGet(this, _ctx).cookies;
|
|
29
|
-
}
|
|
30
|
-
get session() {
|
|
31
|
-
return tslib_1.__classPrivateFieldGet(this, _ctx).session;
|
|
32
|
-
}
|
|
33
|
-
getReq() {
|
|
34
|
-
return this.raw.req;
|
|
35
|
-
}
|
|
36
|
-
destroy() {
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
tslib_1.__classPrivateFieldSet(this, _ctx, null);
|
|
39
|
-
return super.destroy();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.PlatformKoaRequest = PlatformKoaRequest;
|
|
43
|
-
_ctx = new WeakMap();
|
|
44
|
-
//# sourceMappingURL=PlatformKoaRequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoaRequest.js","sourceRoot":"","sources":["../../src/services/PlatformKoaRequest.ts"],"names":[],"mappings":";;;;;AAAA,uBAAqB;AACrB,yCAA6E;AAiB7E;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,wBAA4B;IAGlE,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QAHf,uBAAkB;QAIhB,+BAAA,IAAI,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,EAAC;IAC3B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,2CAAU,OAAO,CAAC,QAAQ,CAAC;IACpC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,2CAAU,OAAO,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,2CAAU,OAAO,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,2CAAU,MAAM,IAAI,2CAAU,OAAO,CAAC;IAC/C,CAAC;IAED,IAAI,OAAO;QACT,OAAO,2CAAU,OAAO,CAAC;IAC3B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACtB,CAAC;IAED,OAAO;QACL,aAAa;QACb,+BAAA,IAAI,QAAQ,IAAI,EAAC;QACjB,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACF;AArCD,gDAqCC","sourcesContent":["import \"@koa/router\";\nimport {IncomingEvent, PlatformContext, PlatformRequest} from \"@tsed/common\";\nimport {IncomingMessage} from \"http\";\nimport Koa from \"koa\";\n\ndeclare module \"koa\" {\n export interface Request {\n id: string;\n $ctx: PlatformContext;\n }\n}\n\ndeclare global {\n namespace TsED {\n export interface Request extends Koa.Request {}\n }\n}\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoaRequest extends PlatformRequest<Koa.Request> {\n #ctx: Koa.Context;\n\n constructor(event: IncomingEvent) {\n super(event);\n this.#ctx = this.raw.ctx;\n }\n\n get protocol(): string {\n return this.#ctx.request.protocol;\n }\n\n get host(): string {\n return this.#ctx.request.host;\n }\n\n get secure(): boolean {\n return this.#ctx.request.secure;\n }\n\n get cookies(): {[p: string]: any} {\n return this.#ctx.cookie || this.#ctx.cookies;\n }\n\n get session(): any {\n return this.#ctx.session;\n }\n\n getReq(): IncomingMessage {\n return this.raw.req;\n }\n\n destroy() {\n // @ts-ignore\n this.#ctx = null;\n return super.destroy();\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoaResponse.js","sourceRoot":"","sources":["../../src/services/PlatformKoaResponse.ts"],"names":[],"mappings":";;;;;AAAA,yCAA6D;AAG7D,yCAA8C;AAE9C,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAQvC;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,yBAA8B;IAGrE,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QAHf,uBAAkB;QAIhB,+BAAA,IAAI,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,EAAC;IAC3B,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,2CAAU,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACtB,CAAC;IAED,SAAS;QACP,yBAAyB;QACzB,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAc;QACnB,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,WAAmB;QAC7B,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,WAAW,CAAC;QAE5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;IAC1B,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,IAAS;QACZ,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,QAAQ,CAAC,MAAc,EAAE,GAAW;QAClC,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC;QACvB,sBAAsB;QACtB,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE7C,IAAI,CAAC,IAAI,CAAC,GAAG,yBAAgB,CAAC,MAAM,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAEnE,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;YAClC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;SACrB;aAAM;YACL,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;SACnC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,QAAgB;QACvB,sCAAsC;QACtC,IAAI,QAAQ,KAAK,MAAM,EAAE;YACvB,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC;SAChD;QAED,eAAe;QACf,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5GD,kDA4GC","sourcesContent":["import {IncomingEvent, PlatformResponse} from \"@tsed/common\";\nimport {ServerResponse} from \"http\";\nimport Koa from \"koa\";\nimport {getStatusMessage} from \"@tsed/schema\";\n\nconst encodeUrl = require(\"encodeurl\");\n\ndeclare global {\n namespace TsED {\n export interface Response extends Koa.Response {}\n }\n}\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoaResponse extends PlatformResponse<Koa.Response> {\n #ctx: Koa.Context;\n\n constructor(event: IncomingEvent) {\n super(event);\n this.#ctx = this.raw.ctx;\n }\n\n get statusCode() {\n return this.raw.status;\n }\n\n get locals() {\n return this.#ctx.state;\n }\n\n /**\n * Return the Node.js response object\n */\n getRes(): ServerResponse {\n return this.raw.res;\n }\n\n hasStatus() {\n // KOA set 404 by default\n return this.statusCode !== 404;\n }\n\n /**\n * Sets the HTTP status for the response.\n *\n * @param status\n */\n status(status: number) {\n this.raw.status = status;\n\n return this;\n }\n\n /**\n * Set `Content-Type` response header with `type` through `mime.lookup()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n */\n contentType(contentType: string) {\n this.raw.type = contentType;\n\n return this;\n }\n\n getHeaders() {\n return this.raw.headers;\n }\n\n /**\n * Send any data to your consumer.\n *\n * This method accept a ReadableStream, a plain object, boolean, string, number, null and undefined data.\n * It choose the better way to send the data.\n *\n * @param data\n */\n body(data: any): this {\n this.raw.body = data;\n\n return this;\n }\n\n getBody() {\n return this.raw.body;\n }\n\n redirect(status: number, url: string): this {\n status = status || 302;\n // Set location header\n url = this.location(url).raw.get(\"Location\");\n\n this.body(`${getStatusMessage(status)}. Redirecting to ${url}`);\n this.status(status);\n this.setHeader(\"Content-Length\", Buffer.byteLength(this.raw.body));\n\n if (this.request.method === \"HEAD\") {\n this.getRes().end();\n } else {\n this.getRes().end(this.getBody());\n }\n\n return this;\n }\n\n location(location: string): this {\n // \"back\" is an alias for the referrer\n if (location === \"back\") {\n location = this.request.get(\"Referrer\") || \"/\";\n }\n\n // set location\n this.raw.set(\"Location\", encodeUrl(location));\n\n return this;\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="koa__router" />
|
|
2
|
-
import KoaRouter from "@koa/router";
|
|
3
|
-
import { RouterOptions as KoaRouterOptions } from "@koa/router";
|
|
4
|
-
import { PlatformHandler, PlatformMulter, PlatformMulterSettings, PlatformRouter, PlatformStaticsOptions } from "@tsed/common";
|
|
5
|
-
import { Configuration } from "@tsed/di";
|
|
6
|
-
import send from "koa-send";
|
|
7
|
-
declare global {
|
|
8
|
-
namespace TsED {
|
|
9
|
-
interface Router extends KoaRouter {
|
|
10
|
-
}
|
|
11
|
-
interface RouterOptions extends KoaRouterOptions {
|
|
12
|
-
}
|
|
13
|
-
interface StaticsOptions extends send.SendOptions {
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export declare class PlatformKoaRouter extends PlatformRouter<KoaRouter> {
|
|
18
|
-
constructor(platform: PlatformHandler, configuration: Configuration, routerOptions: any);
|
|
19
|
-
callback(): KoaRouter.Middleware<any, {}>[];
|
|
20
|
-
multer(options: PlatformMulterSettings): PlatformMulter;
|
|
21
|
-
statics(path: string, options: PlatformStaticsOptions): this;
|
|
22
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformKoaRouter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const router_1 = tslib_1.__importDefault(require("@koa/router"));
|
|
6
|
-
const common_1 = require("@tsed/common");
|
|
7
|
-
const di_1 = require("@tsed/di");
|
|
8
|
-
const staticsMiddleware_1 = require("../middlewares/staticsMiddleware");
|
|
9
|
-
const multer_1 = require("../utils/multer");
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
router_1.default.prototype.$$match = router_1.default.prototype.match;
|
|
12
|
-
router_1.default.prototype.match = function match(...args) {
|
|
13
|
-
const matched = this.$$match(...args);
|
|
14
|
-
if (matched) {
|
|
15
|
-
if (matched.path.length) {
|
|
16
|
-
matched.route = true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return matched;
|
|
20
|
-
};
|
|
21
|
-
let PlatformKoaRouter = class PlatformKoaRouter extends common_1.PlatformRouter {
|
|
22
|
-
constructor(platform, configuration, routerOptions) {
|
|
23
|
-
var _a;
|
|
24
|
-
super(platform);
|
|
25
|
-
const options = Object.assign({}, ((_a = configuration.koa) === null || _a === void 0 ? void 0 : _a.router) || {}, routerOptions);
|
|
26
|
-
this.rawRouter = new router_1.default(options);
|
|
27
|
-
}
|
|
28
|
-
callback() {
|
|
29
|
-
return [this.getRouter().routes(), this.getRouter().allowedMethods()];
|
|
30
|
-
}
|
|
31
|
-
multer(options) {
|
|
32
|
-
return multer_1.getMulter(options);
|
|
33
|
-
}
|
|
34
|
-
statics(path, options) {
|
|
35
|
-
this.rawRouter.use(path, staticsMiddleware_1.staticsMiddleware(options));
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
PlatformKoaRouter = tslib_1.__decorate([
|
|
40
|
-
tslib_1.__param(1, di_1.Configuration()),
|
|
41
|
-
tslib_1.__param(2, di_1.Inject(common_1.PLATFORM_ROUTER_OPTIONS)),
|
|
42
|
-
tslib_1.__metadata("design:paramtypes", [common_1.PlatformHandler, Object, Object])
|
|
43
|
-
], PlatformKoaRouter);
|
|
44
|
-
exports.PlatformKoaRouter = PlatformKoaRouter;
|
|
45
|
-
//# sourceMappingURL=PlatformKoaRouter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoaRouter.js","sourceRoot":"","sources":["../../src/services/PlatformKoaRouter.ts"],"names":[],"mappings":";;;;AAAA,iEAAoC;AAGpC,yCAOsB;AACtB,iCAA+C;AAE/C,wEAAmE;AACnE,4CAA0C;AAY1C,aAAa;AACb,gBAAS,CAAC,SAAS,CAAC,OAAO,GAAG,gBAAS,CAAC,SAAS,CAAC,KAAK,CAAC;AACxD,gBAAS,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,KAAK,CAAC,GAAG,IAAW;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACtC,IAAI,OAAO,EAAE;QACX,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YACvB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;SACtB;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,uBAAyB;IAC9D,YACE,QAAyB,EACR,aAA4B,EACZ,aAAkB;;QAEnD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAA,MAAA,aAAa,CAAC,GAAG,0CAAE,MAAM,KAAI,EAAE,EAAE,aAAa,CAAC,CAAC;QAClF,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAS,CAAC,OAAO,CAAQ,CAAC;IACjD,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,CAAC,OAA+B;QACpC,OAAO,kBAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,OAA+B;QACnD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,qCAAiB,CAAC,OAAO,CAAQ,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAzBY,iBAAiB;IAGzB,mBAAA,kBAAa,EAAE,CAAA;IACf,mBAAA,WAAM,CAAC,gCAAuB,CAAC,CAAA;6CAFtB,wBAAe;GAFhB,iBAAiB,CAyB7B;AAzBY,8CAAiB","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {RouterOptions as KoaRouterOptions} from \"@koa/router\";\n\nimport {\n PLATFORM_ROUTER_OPTIONS,\n PlatformHandler,\n PlatformMulter,\n PlatformMulterSettings,\n PlatformRouter,\n PlatformStaticsOptions\n} from \"@tsed/common\";\nimport {Configuration, Inject} from \"@tsed/di\";\nimport send from \"koa-send\";\nimport {staticsMiddleware} from \"../middlewares/staticsMiddleware\";\nimport {getMulter} from \"../utils/multer\";\n\ndeclare global {\n namespace TsED {\n export interface Router extends KoaRouter {}\n\n export interface RouterOptions extends KoaRouterOptions {}\n\n export interface StaticsOptions extends send.SendOptions {}\n }\n}\n\n// @ts-ignore\nKoaRouter.prototype.$$match = KoaRouter.prototype.match;\nKoaRouter.prototype.match = function match(...args: any[]) {\n const matched = this.$$match(...args);\n if (matched) {\n if (matched.path.length) {\n matched.route = true;\n }\n }\n\n return matched;\n};\n\nexport class PlatformKoaRouter extends PlatformRouter<KoaRouter> {\n constructor(\n platform: PlatformHandler,\n @Configuration() configuration: Configuration,\n @Inject(PLATFORM_ROUTER_OPTIONS) routerOptions: any\n ) {\n super(platform);\n\n const options = Object.assign({}, configuration.koa?.router || {}, routerOptions);\n this.rawRouter = new KoaRouter(options) as any;\n }\n\n callback() {\n return [this.getRouter().routes(), this.getRouter().allowedMethods()];\n }\n\n multer(options: PlatformMulterSettings): PlatformMulter {\n return getMulter(options);\n }\n\n statics(path: string, options: PlatformStaticsOptions) {\n this.rawRouter.use(path, staticsMiddleware(options) as any);\n\n return this;\n }\n}\n"]}
|
package/lib/services/index.d.ts
DELETED
package/lib/services/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./PlatformKoaApplication"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./PlatformKoaHandler"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./PlatformKoaRouter"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./PlatformKoaRequest"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./PlatformKoaResponse"), exports);
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC;AACzC,+DAAqC;AACrC,8DAAoC;AACpC,+DAAqC;AACrC,gEAAsC","sourcesContent":["export * from \"./PlatformKoaApplication\";\nexport * from \"./PlatformKoaHandler\";\nexport * from \"./PlatformKoaRouter\";\nexport * from \"./PlatformKoaRequest\";\nexport * from \"./PlatformKoaResponse\";\n"]}
|
package/lib/utils/multer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multer.js","sourceRoot":"","sources":["../../src/utils/multer.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B;;GAEG;AACH,SAAS,mBAAmB,CAAC,UAAe;IAC1C,OAAO,KAAK,EAAE,OAAoB,EAAE,EAAE;QACpC,MAAM,GAAG,GAAQ,OAAO,CAAC,GAAG,CAAC;QAE7B,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAEnC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAChB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAChC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACxB,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACrB;QACH,CAAC,CAAC;QAEF,IAAI,SAAS,IAAI,GAAG,EAAE;YACpB,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE;gBAChB,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAChC,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;aACrB;YAED,UAAU,CAAC,MAAM,CAAC,CAAC;YACnB,UAAU,CAAC,OAAO,CAAC,CAAC;SACrB;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,MAAW,EAAE,IAAY;IAC5C,uBAAuB;IACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO;IAE1B,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAExB,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,KAAK,CAAC,GAAG,IAAW;QAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CAAC,gBAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,OAAY;IACpC,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;IAErC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACtB,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACxB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACzB,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEzB,OAAO,CAAC,CAAC;AACX,CAAC;AAVD,8BAUC","sourcesContent":["import Koa from \"koa\";\nimport {promisify} from \"util\";\n\n/**\n * @ignore\n */\nfunction createRawMiddleware(middleware: any) {\n return async (request: Koa.Request) => {\n const ctx: any = request.ctx;\n\n await middleware(ctx.req, ctx.res);\n\n const forwardKey = (key: string) => {\n if (ctx.req[key]) {\n ctx.request[key] = ctx.req[key];\n ctx[key] = ctx.req[key];\n delete ctx.req[key];\n }\n };\n\n if (\"request\" in ctx) {\n if (ctx.req.body) {\n ctx.request.body = ctx.req.body;\n delete ctx.req.body;\n }\n\n forwardKey(\"file\");\n forwardKey(\"files\");\n }\n };\n}\n\n/**\n * @ignore\n */\nfunction makePromise(multer: any, name: string) {\n // istanbul ignore next\n if (!multer[name]) return;\n\n const fn = multer[name];\n\n multer[name] = function apply(...args: any[]) {\n const middleware = Reflect.apply(fn, this, args);\n\n return createRawMiddleware(promisify(middleware));\n };\n}\n\n/**\n * @ignore\n */\nexport function getMulter(options: any) {\n const m = require(\"multer\")(options);\n\n makePromise(m, \"any\");\n makePromise(m, \"array\");\n makePromise(m, \"fields\");\n makePromise(m, \"none\");\n makePromise(m, \"single\");\n\n return m;\n}\n"]}
|