@tsed/platform-express 7.0.0-beta.2 → 7.0.0-beta.20
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/coverage.json +6 -0
- package/jest.config.js +9 -0
- package/lib/cjs/components/PlatformExpress.js +126 -66
- 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 +9 -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/esm/components/PlatformExpress.js +126 -48
- package/lib/esm/components/PlatformExpress.js.map +1 -1
- package/lib/esm/exports.js +5 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +9 -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/types/components/PlatformExpress.d.ts +40 -22
- package/lib/types/exports.d.ts +1 -0
- package/lib/types/index.d.ts +8 -3
- package/lib/types/interfaces/PlatformExpressSettings.d.ts +15 -1
- package/lib/types/interfaces/{index.d.ts → interfaces.d.ts} +6 -4
- package/package.json +64 -26
- package/readme.md +3 -4
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/decorators/caseSensitive.js +0 -31
- package/lib/cjs/decorators/caseSensitive.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -8
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/decorators/mergeParams.js +0 -31
- package/lib/cjs/decorators/mergeParams.js.map +0 -1
- package/lib/cjs/decorators/routerSettings.js +0 -32
- package/lib/cjs/decorators/routerSettings.js.map +0 -1
- package/lib/cjs/decorators/strict.js +0 -31
- package/lib/cjs/decorators/strict.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/PlatformExpressHandler.js +0 -31
- package/lib/cjs/services/PlatformExpressHandler.js.map +0 -1
- package/lib/cjs/services/PlatformExpressRequest.js +0 -12
- package/lib/cjs/services/PlatformExpressRequest.js.map +0 -1
- package/lib/cjs/services/PlatformExpressResponse.js +0 -12
- package/lib/cjs/services/PlatformExpressResponse.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/caseSensitive.js +0 -27
- package/lib/esm/decorators/caseSensitive.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -5
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/decorators/mergeParams.js +0 -27
- package/lib/esm/decorators/mergeParams.js.map +0 -1
- package/lib/esm/decorators/routerSettings.js +0 -28
- package/lib/esm/decorators/routerSettings.js.map +0 -1
- package/lib/esm/decorators/strict.js +0 -27
- package/lib/esm/decorators/strict.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/PlatformExpressHandler.js +0 -27
- package/lib/esm/services/PlatformExpressHandler.js.map +0 -1
- package/lib/esm/services/PlatformExpressRequest.js +0 -8
- package/lib/esm/services/PlatformExpressRequest.js.map +0 -1
- package/lib/esm/services/PlatformExpressResponse.js +0 -8
- package/lib/esm/services/PlatformExpressResponse.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/caseSensitive.d.ts +0 -23
- package/lib/types/decorators/index.d.ts +0 -4
- package/lib/types/decorators/mergeParams.d.ts +0 -23
- package/lib/types/decorators/routerSettings.d.ts +0 -24
- package/lib/types/decorators/strict.d.ts +0 -23
- package/lib/types/middlewares/rawBodyMiddleware.d.ts +0 -4
- package/lib/types/services/PlatformExpressApplication.d.ts +0 -24
- package/lib/types/services/PlatformExpressHandler.d.ts +0 -9
- package/lib/types/services/PlatformExpressRequest.d.ts +0 -22
- package/lib/types/services/PlatformExpressResponse.d.ts +0 -14
- package/lib/types/services/PlatformExpressRouter.d.ts +0 -18
- package/lib/types/services/index.d.ts +0 -5
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RouterOptions } from "express";
|
|
2
|
-
/**
|
|
3
|
-
* Specify the behavior of the router controller.
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* @Controller("/")
|
|
7
|
-
* @RouterSettings({mergeParams: true})
|
|
8
|
-
* class MyCtrl {
|
|
9
|
-
*
|
|
10
|
-
* }
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* Property | Description | Default
|
|
14
|
-
* ---|---|---
|
|
15
|
-
* caseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
|
|
16
|
-
* mergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
|
|
17
|
-
* strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
|
|
18
|
-
*
|
|
19
|
-
* @returns {(target:any)=>void}
|
|
20
|
-
* @decorator
|
|
21
|
-
* @param routerOptions
|
|
22
|
-
* @express
|
|
23
|
-
*/
|
|
24
|
-
export declare function RouterSettings(routerOptions: RouterOptions): Function;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Specify the behavior of the router controller.
|
|
3
|
-
*
|
|
4
|
-
* ```typescript
|
|
5
|
-
* @Controller("/")
|
|
6
|
-
* @Strict(true)
|
|
7
|
-
* class MyCtrl {
|
|
8
|
-
*
|
|
9
|
-
* }
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* Property | Description | Default
|
|
13
|
-
* ---|---|---
|
|
14
|
-
* CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
|
|
15
|
-
* MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
|
|
16
|
-
* Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
|
|
17
|
-
*
|
|
18
|
-
* @param strict
|
|
19
|
-
* @returns {Function}
|
|
20
|
-
* @decorator
|
|
21
|
-
* @express
|
|
22
|
-
*/
|
|
23
|
-
export declare function Strict(strict: boolean): Function;
|
|
@@ -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,9 +0,0 @@
|
|
|
1
|
-
import { HandlerMetadata, OnRequestOptions, PlatformHandler } from "@tsed/common";
|
|
2
|
-
/**
|
|
3
|
-
* @platform
|
|
4
|
-
* @express
|
|
5
|
-
*/
|
|
6
|
-
export declare class PlatformExpressHandler extends PlatformHandler {
|
|
7
|
-
protected createRawHandler(metadata: HandlerMetadata): Function;
|
|
8
|
-
protected onCtxRequest(requestOptions: OnRequestOptions): Promise<any>;
|
|
9
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PlatformContext, PlatformRequest } from "@tsed/common";
|
|
2
|
-
import type Express from "express";
|
|
3
|
-
declare module "express" {
|
|
4
|
-
interface Request {
|
|
5
|
-
id: string;
|
|
6
|
-
$ctx: PlatformContext;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
declare global {
|
|
10
|
-
namespace TsED {
|
|
11
|
-
interface Request extends Express.Request {
|
|
12
|
-
id: string;
|
|
13
|
-
$ctx: PlatformContext;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @platform
|
|
19
|
-
* @express
|
|
20
|
-
*/
|
|
21
|
-
export declare class PlatformExpressRequest extends PlatformRequest<Express.Request> {
|
|
22
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PlatformResponse } from "@tsed/common";
|
|
2
|
-
import type Express from "express";
|
|
3
|
-
declare global {
|
|
4
|
-
namespace TsED {
|
|
5
|
-
interface Response extends Express.Response {
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @platform
|
|
11
|
-
* @express
|
|
12
|
-
*/
|
|
13
|
-
export declare class PlatformExpressResponse extends PlatformResponse<Express.Response> {
|
|
14
|
-
}
|
|
@@ -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
|
-
}
|