@tsed/platform-express 7.0.0-beta.1 → 7.0.0-beta.4
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/PlatformExpress.js +102 -43
- package/lib/cjs/components/PlatformExpress.js.map +1 -1
- package/lib/cjs/exports.js +7 -0
- package/lib/cjs/exports.js.map +1 -0
- package/lib/cjs/index.js +16 -12
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/PlatformExpressSettings.js.map +1 -1
- package/lib/cjs/interfaces/interfaces.js +3 -0
- package/lib/cjs/interfaces/interfaces.js.map +1 -0
- package/lib/cjs/middlewares/staticsMiddleware.js +1 -1
- package/lib/cjs/middlewares/staticsMiddleware.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/PlatformExpressRequest.js.map +1 -1
- package/lib/esm/components/PlatformExpress.js +100 -22
- package/lib/esm/components/PlatformExpress.js.map +1 -1
- package/lib/esm/decorators/caseSensitive.js +1 -1
- package/lib/esm/decorators/mergeParams.js +1 -1
- package/lib/esm/decorators/strict.js +1 -1
- package/lib/esm/exports.js +5 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +16 -12
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/PlatformExpressSettings.js.map +1 -1
- package/lib/esm/interfaces/interfaces.js +2 -0
- package/lib/esm/interfaces/interfaces.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/PlatformExpressRequest.js.map +1 -1
- package/lib/types/components/PlatformExpress.d.ts +41 -8
- package/lib/types/exports.d.ts +1 -0
- package/lib/types/index.d.ts +15 -3
- package/lib/types/interfaces/PlatformExpressSettings.d.ts +15 -1
- package/lib/types/interfaces/{index.d.ts → interfaces.d.ts} +0 -2
- package/lib/types/services/PlatformExpressRequest.d.ts +1 -15
- package/package.json +52 -22
- package/readme.md +0 -2
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/decorators/index.js +0 -8
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -6
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/middlewares/rawBodyMiddleware.js +0 -27
- package/lib/cjs/middlewares/rawBodyMiddleware.js.map +0 -1
- package/lib/cjs/services/PlatformExpressApplication.js +0 -32
- package/lib/cjs/services/PlatformExpressApplication.js.map +0 -1
- package/lib/cjs/services/PlatformExpressRouter.js +0 -34
- package/lib/cjs/services/PlatformExpressRouter.js.map +0 -1
- package/lib/cjs/services/index.js +0 -9
- package/lib/cjs/services/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -5
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -3
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/middlewares/rawBodyMiddleware.js +0 -22
- package/lib/esm/middlewares/rawBodyMiddleware.js.map +0 -1
- package/lib/esm/services/PlatformExpressApplication.js +0 -29
- package/lib/esm/services/PlatformExpressApplication.js.map +0 -1
- package/lib/esm/services/PlatformExpressRouter.js +0 -31
- package/lib/esm/services/PlatformExpressRouter.js.map +0 -1
- package/lib/esm/services/index.js +0 -6
- package/lib/esm/services/index.js.map +0 -1
- package/lib/types/decorators/index.d.ts +0 -4
- package/lib/types/middlewares/rawBodyMiddleware.d.ts +0 -4
- package/lib/types/services/PlatformExpressApplication.d.ts +0 -24
- package/lib/types/services/PlatformExpressRouter.d.ts +0 -18
- package/lib/types/services/index.d.ts +0 -5
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import { PLATFORM_ROUTER_OPTIONS, PlatformHandler, PlatformRouter } from "@tsed/common";
|
|
3
|
-
import { Configuration, Inject } from "@tsed/di";
|
|
4
|
-
import Express from "express";
|
|
5
|
-
import { staticsMiddleware } from "../middlewares/staticsMiddleware";
|
|
6
|
-
/**
|
|
7
|
-
* @platform
|
|
8
|
-
* @express
|
|
9
|
-
*/
|
|
10
|
-
let PlatformExpressRouter = class PlatformExpressRouter extends PlatformRouter {
|
|
11
|
-
constructor(platform, configuration, routerOptions = {}) {
|
|
12
|
-
var _a;
|
|
13
|
-
super(platform);
|
|
14
|
-
const options = Object.assign({
|
|
15
|
-
mergeParams: true
|
|
16
|
-
}, ((_a = configuration.express) === null || _a === void 0 ? void 0 : _a.router) || {}, routerOptions);
|
|
17
|
-
this.rawRouter = this.raw = Express.Router(options);
|
|
18
|
-
}
|
|
19
|
-
statics(endpoint, options) {
|
|
20
|
-
const { root, ...props } = options;
|
|
21
|
-
this.use(endpoint, staticsMiddleware(root, props));
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
PlatformExpressRouter = __decorate([
|
|
26
|
-
__param(1, Configuration()),
|
|
27
|
-
__param(2, Inject(PLATFORM_ROUTER_OPTIONS)),
|
|
28
|
-
__metadata("design:paramtypes", [PlatformHandler, Object, Object])
|
|
29
|
-
], PlatformExpressRouter);
|
|
30
|
-
export { PlatformExpressRouter };
|
|
31
|
-
//# sourceMappingURL=PlatformExpressRouter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformExpressRouter.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressRouter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,eAAe,EAAE,cAAc,EAAyB,MAAM,cAAc,CAAC;AAC9G,OAAO,EAAC,aAAa,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAC/C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAQnE;;;GAGG;AACH,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,cAA8B;IACvE,YACE,QAAyB,EACR,aAA4B,EACZ,gBAAwC,EAAE;;QAE3E,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAC3B;YACE,WAAW,EAAE,IAAI;SAClB,EACD,CAAA,MAAA,aAAa,CAAC,OAAO,0CAAE,MAAM,KAAI,EAAE,EACnC,aAAa,CACd,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,OAA+B;QACvD,MAAM,EAAC,IAAI,EAAE,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;QAEjC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAzBY,qBAAqB;IAG7B,WAAA,aAAa,EAAE,CAAA;IACf,WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;qCAFtB,eAAe;GAFhB,qBAAqB,CAyBjC;SAzBY,qBAAqB","sourcesContent":["import {PLATFORM_ROUTER_OPTIONS, PlatformHandler, PlatformRouter, PlatformStaticsOptions} from \"@tsed/common\";\nimport {Configuration, Inject} from \"@tsed/di\";\nimport Express from \"express\";\nimport {RouterOptions} from \"express\";\nimport {staticsMiddleware} from \"../middlewares/staticsMiddleware\";\n\ndeclare global {\n namespace TsED {\n export interface Router extends Express.Router {}\n }\n}\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressRouter extends PlatformRouter<Express.Router> {\n constructor(\n platform: PlatformHandler,\n @Configuration() configuration: Configuration,\n @Inject(PLATFORM_ROUTER_OPTIONS) routerOptions: Partial<RouterOptions> = {}\n ) {\n super(platform);\n\n const options = Object.assign(\n {\n mergeParams: true\n },\n configuration.express?.router || {},\n routerOptions\n );\n this.rawRouter = this.raw = Express.Router(options);\n }\n\n statics(endpoint: string, options: PlatformStaticsOptions) {\n const {root, ...props} = options;\n\n this.use(endpoint, staticsMiddleware(root, props));\n\n return this;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./PlatformExpressApplication\";\nexport * from \"./PlatformExpressHandler\";\nexport * from \"./PlatformExpressResponse\";\nexport * from \"./PlatformExpressRequest\";\nexport * from \"./PlatformExpressRouter\";\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Configuration, PlatformApplication, PlatformHandler } from "@tsed/common";
|
|
2
|
-
import Express from "express";
|
|
3
|
-
import { PlatformExpressStaticsOptions } from "../interfaces/PlatformExpressStaticsOptions";
|
|
4
|
-
import { PlatformExpressRouter } from "./PlatformExpressRouter";
|
|
5
|
-
declare global {
|
|
6
|
-
namespace TsED {
|
|
7
|
-
interface Application extends Express.Application {
|
|
8
|
-
}
|
|
9
|
-
interface StaticsOptions extends PlatformExpressStaticsOptions {
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @platform
|
|
15
|
-
* @express
|
|
16
|
-
*/
|
|
17
|
-
export declare class PlatformExpressApplication extends PlatformExpressRouter implements PlatformApplication<Express.Application, Express.Router> {
|
|
18
|
-
app: Express.Application;
|
|
19
|
-
rawApp: Express.Application;
|
|
20
|
-
rawRouter: Express.Router;
|
|
21
|
-
constructor(platformHandler: PlatformHandler, configuration: Configuration);
|
|
22
|
-
getApp(): Express.Application;
|
|
23
|
-
callback(): Express.Application;
|
|
24
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PlatformHandler, PlatformRouter, PlatformStaticsOptions } from "@tsed/common";
|
|
2
|
-
import { Configuration } from "@tsed/di";
|
|
3
|
-
import Express from "express";
|
|
4
|
-
import { RouterOptions } from "express";
|
|
5
|
-
declare global {
|
|
6
|
-
namespace TsED {
|
|
7
|
-
interface Router extends Express.Router {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @platform
|
|
13
|
-
* @express
|
|
14
|
-
*/
|
|
15
|
-
export declare class PlatformExpressRouter extends PlatformRouter<Express.Router> {
|
|
16
|
-
constructor(platform: PlatformHandler, configuration: Configuration, routerOptions?: Partial<RouterOptions>);
|
|
17
|
-
statics(endpoint: string, options: PlatformStaticsOptions): this;
|
|
18
|
-
}
|