@tsed/platform-express 6.95.7 → 6.96.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-express",
3
- "version": "6.95.7",
3
+ "version": "6.96.0",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -54,10 +54,10 @@
54
54
  "tslib": "2.2.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@tsed/common": "6.95.7",
58
- "@tsed/core": "6.95.7",
59
- "@tsed/di": "6.95.7",
60
- "@tsed/platform-test-utils": "6.95.7",
57
+ "@tsed/common": "6.96.0",
58
+ "@tsed/core": "6.96.0",
59
+ "@tsed/di": "6.96.0",
60
+ "@tsed/platform-test-utils": "6.96.0",
61
61
  "@types/body-parser": "1.19.0",
62
62
  "@types/compression": "1.7.0",
63
63
  "@types/cookie-parser": "1.4.2",
@@ -73,13 +73,13 @@
73
73
  "method-override": "3.0.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "@tsed/common": "^6.95.7",
77
- "@tsed/core": "^6.95.7",
78
- "@tsed/di": "^6.95.7",
79
- "@tsed/json-mapper": "^6.95.7",
76
+ "@tsed/common": "^6.96.0",
77
+ "@tsed/core": "^6.96.0",
78
+ "@tsed/di": "^6.96.0",
79
+ "@tsed/json-mapper": "^6.96.0",
80
80
  "@tsed/logger": ">=6.0.0",
81
- "@tsed/openspec": "^6.95.7",
82
- "@tsed/schema": "^6.95.7",
81
+ "@tsed/openspec": "^6.96.0",
82
+ "@tsed/schema": "^6.96.0",
83
83
  "@types/multer": "^1.4.5",
84
84
  "body-parser": "1.19.0"
85
85
  }
@@ -1,42 +0,0 @@
1
- import Express from "express";
2
- import { PlatformAdapter, PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
3
- import { Type } from "@tsed/core";
4
- import { PlatformExpressHandler, PlatformExpressRequest, PlatformExpressResponse, PlatformExpressRouter } from "../services";
5
- /**
6
- * @platform
7
- * @express
8
- */
9
- export declare class PlatformExpress implements PlatformAdapter<Express.Application, Express.Router> {
10
- private platform;
11
- readonly providers: ({
12
- provide: typeof PlatformRouter;
13
- useClass: typeof PlatformExpressRouter;
14
- } | {
15
- provide: typeof PlatformHandler;
16
- useClass: typeof PlatformExpressHandler;
17
- } | {
18
- provide: typeof PlatformResponse;
19
- useClass: typeof PlatformExpressResponse;
20
- } | {
21
- provide: typeof PlatformRequest;
22
- useClass: typeof PlatformExpressRequest;
23
- })[];
24
- constructor(platform: PlatformBuilder<Express.Application, Express.Router>);
25
- /**
26
- * Create new serverless application. In this mode, the component scan are disabled.
27
- * @param module
28
- * @param settings
29
- */
30
- static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Express.Application, Express.Router>;
31
- /**
32
- * Bootstrap a server application
33
- * @param module
34
- * @param settings
35
- */
36
- static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<Express.Application, Express.Router>>;
37
- useRouter(): this;
38
- beforeLoadRoutes(): Promise<void>;
39
- afterLoadRoutes(): Promise<void>;
40
- useContext(): this;
41
- private configureViewsEngine;
42
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Specify the behavior of the router controller.
3
- *
4
- * ```typescript
5
- * @Controller("/")
6
- * @CaseSensitive(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 caseSensitive
19
- * @returns {Function}
20
- * @decorator
21
- * @express
22
- */
23
- export declare function CaseSensitive(caseSensitive: boolean): Function;
@@ -1,4 +0,0 @@
1
- export * from "./routerSettings";
2
- export * from "./caseSensitive";
3
- export * from "./mergeParams";
4
- export * from "./strict";
@@ -1,23 +0,0 @@
1
- /**
2
- * Specify the behavior of the router controller.
3
- *
4
- * ```typescript
5
- * @Controller("/")
6
- * @MergeParams(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 mergeParams
19
- * @returns {Function}
20
- * @decorator
21
- * @express
22
- */
23
- export declare function MergeParams(mergeParams?: boolean): Function;
@@ -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,4 +0,0 @@
1
- export * from "./interfaces";
2
- export * from "./decorators";
3
- export * from "./services";
4
- export * from "./components/PlatformExpress";
@@ -1,9 +0,0 @@
1
- /// <reference types="express-serve-static-core" />
2
- import { RouterOptions } from "express";
3
- export interface PlatformExpressSettings {
4
- /**
5
- * Global configuration for the Express.Router. See express [documentation](http://expressjs.com/en/api.html#express.router).
6
- */
7
- router?: RouterOptions;
8
- app?: Express.Application;
9
- }
@@ -1,63 +0,0 @@
1
- import Express from "express";
2
- export interface PlatformExpressStaticsOptions {
3
- /**
4
- * Enable or disable setting Cache-Control response header, defaults to true.
5
- * Disabling this will ignore the immutable and maxAge options.
6
- */
7
- cacheControl?: boolean;
8
- /**
9
- * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
10
- * Note this check is done on the path itself without checking if the path actually exists on the disk.
11
- * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
12
- * The default value is 'ignore'.
13
- * 'allow' No special treatment for dotfiles
14
- * 'deny' Send a 403 for any request for a dotfile
15
- * 'ignore' Pretend like the dotfile does not exist and call next()
16
- */
17
- dotfiles?: string;
18
- /**
19
- * Enable or disable etag generation, defaults to true.
20
- */
21
- etag?: boolean;
22
- /**
23
- * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
24
- * The first that exists will be served. Example: ['html', 'htm'].
25
- * The default value is false.
26
- */
27
- extensions?: string[] | false;
28
- /**
29
- * Let client errors fall-through as unhandled requests, otherwise forward a client error.
30
- * The default value is true.
31
- */
32
- fallthrough?: boolean;
33
- /**
34
- * Enable or disable the immutable directive in the Cache-Control response header.
35
- * If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
36
- */
37
- immutable?: boolean;
38
- /**
39
- * By default this module will send "index.html" files in response to a request on a directory.
40
- * To disable this set false or to supply a new index pass a string or an array in preferred order.
41
- */
42
- index?: boolean | string | string[];
43
- /**
44
- * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
45
- */
46
- lastModified?: boolean;
47
- /**
48
- * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
49
- */
50
- maxAge?: number | string;
51
- /**
52
- * Redirect to trailing "/" when the pathname is a dir. Defaults to true.
53
- */
54
- redirect?: boolean;
55
- /**
56
- * Function to set custom headers on response. Alterations to the headers need to occur synchronously.
57
- * The function is called as fn(res, path, stat), where the arguments are:
58
- * res the response object
59
- * path the file path that is being sent
60
- * stat the stat object of the file that is being sent
61
- */
62
- setHeaders?: (res: Express.Response, path: string, stat: any) => any;
63
- }
@@ -1,16 +0,0 @@
1
- import Express from "express";
2
- import { PlatformExpressSettings } from "./PlatformExpressSettings";
3
- export * from "./PlatformExpressSettings";
4
- export * from "./PlatformExpressStaticsOptions";
5
- declare global {
6
- namespace TsED {
7
- interface Configuration {
8
- /**
9
- * Configuration related to Express platform application.
10
- */
11
- express: PlatformExpressSettings;
12
- }
13
- interface NextFunction extends Express.NextFunction {
14
- }
15
- }
16
- }
@@ -1,4 +0,0 @@
1
- import { Request } from "express";
2
- export declare function rawBodyMiddleware(request: Request & {
3
- rawBody: string;
4
- }, response: any, next: any): void;
@@ -1,4 +0,0 @@
1
- /**
2
- * @ignore
3
- */
4
- export declare function staticsMiddleware(directory: string, options?: any): (request: any, response: any, next: any) => void;
@@ -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
- }
@@ -1,5 +0,0 @@
1
- export * from "./PlatformExpressApplication";
2
- export * from "./PlatformExpressHandler";
3
- export * from "./PlatformExpressResponse";
4
- export * from "./PlatformExpressRequest";
5
- export * from "./PlatformExpressRouter";