@tsed/common 6.75.9 → 6.76.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.
@@ -1,12 +1,14 @@
1
- import { PathType } from "@tsed/di";
1
+ import { Type } from "@tsed/core";
2
+ import { PathType } from "./PathType";
2
3
  /**
3
4
  * @ignore
4
5
  */
5
6
  export interface PlatformRouteOptions {
6
- method: string;
7
- path: PathType;
8
- handlers: any[];
7
+ token?: Type<any>;
8
+ path?: PathType | undefined;
9
+ method?: string;
9
10
  isFinal?: boolean;
11
+ handlers: any[];
10
12
  }
11
13
  /**
12
14
  * @ignore
@@ -2,6 +2,7 @@ import { InjectorService, TokenProvider } from "@tsed/di";
2
2
  import { PlatformRouteDetails } from "../domain";
3
3
  import { Route, RouteController } from "../interfaces/Route";
4
4
  import { PlatformApplication } from "./PlatformApplication";
5
+ import "../registries/ControllerRegistry";
5
6
  /**
6
7
  * `Platform` is used to provide all routes collected by annotation `@Controller`.
7
8
  *
@@ -15,15 +16,15 @@ export declare class Platform {
15
16
  constructor(injector: InjectorService, platformApplication: PlatformApplication);
16
17
  get app(): PlatformApplication<TsED.Application, TsED.Router>;
17
18
  get routes(): PlatformRouteDetails[];
18
- protected $onInit(): void;
19
19
  addRoutes(routes: Route[]): void;
20
- addRoute(endpoint: string, token: TokenProvider): this;
20
+ addRoute(basePath: string, token: TokenProvider): this | undefined;
21
21
  /**
22
22
  * Get all routes built by TsExpressDecorators and mounted on Express application.
23
23
  * @returns {PlatformRouteDetails[]}
24
24
  */
25
25
  getRoutes(): PlatformRouteDetails[];
26
26
  getMountedControllers(): RouteController[];
27
+ protected $onInit(): void;
27
28
  /**
28
29
  * Create routers from the collected controllers.
29
30
  * @private
@@ -34,10 +35,4 @@ export declare class Platform {
34
35
  * @private
35
36
  */
36
37
  private buildControllers;
37
- /**
38
- *
39
- * @param ctrl
40
- * @param endpointUrl
41
- */
42
- private buildRoutes;
43
38
  }
@@ -1,6 +1,6 @@
1
1
  import { InjectorService, PathType } from "@tsed/di";
2
2
  import { PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions } from "../config";
3
- import { PlatformRouteWithoutHandlers, PlatformRouteOptions } from "../interfaces";
3
+ import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces";
4
4
  import { PlatformHandler } from "./PlatformHandler";
5
5
  /**
6
6
  * @ignore
@@ -32,7 +32,7 @@ export declare class PlatformRouter<Router = TsED.Router> {
32
32
  callback(): any;
33
33
  getRouter(): Router;
34
34
  use(...handlers: any[]): this;
35
- addRoute(options: PlatformRouteOptions): this;
35
+ addRoute(options: Partial<PlatformRouteOptions>): this;
36
36
  all(path: PathType, ...handlers: any[]): this;
37
37
  get(path: PathType, ...handlers: any[]): this;
38
38
  post(path: PathType, ...handlers: any[]): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/common",
3
- "version": "6.75.9",
3
+ "version": "6.76.0",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -55,21 +55,22 @@
55
55
  "build": "microbundle --target node --no-compress --format modern,cjs --tsconfig ./tsconfig.compile.json"
56
56
  },
57
57
  "dependencies": {
58
- "@tsed/components-scan": "6.75.9",
59
- "@tsed/core": "6.75.9",
60
- "@tsed/di": "6.75.9",
61
- "@tsed/exceptions": "6.75.9",
62
- "@tsed/json-mapper": "6.75.9",
63
- "@tsed/logger": "^5.16.0",
64
- "@tsed/perf": "6.75.9",
65
- "@tsed/platform-cache": "6.75.9",
66
- "@tsed/platform-exceptions": "6.75.9",
67
- "@tsed/platform-log-middleware": "6.75.9",
68
- "@tsed/platform-middlewares": "6.75.9",
69
- "@tsed/platform-params": "6.75.9",
70
- "@tsed/platform-response-filter": "6.75.9",
71
- "@tsed/platform-views": "6.75.9",
72
- "@tsed/schema": "6.75.9",
58
+ "@tsed/components-scan": "6.76.0",
59
+ "@tsed/core": "6.76.0",
60
+ "@tsed/di": "6.76.0",
61
+ "@tsed/exceptions": "6.76.0",
62
+ "@tsed/json-mapper": "6.76.0",
63
+ "@tsed/logger": "^6.0.0",
64
+ "@tsed/logger-file": "^6.0.0",
65
+ "@tsed/perf": "6.76.0",
66
+ "@tsed/platform-cache": "6.76.0",
67
+ "@tsed/platform-exceptions": "6.76.0",
68
+ "@tsed/platform-log-middleware": "6.76.0",
69
+ "@tsed/platform-middlewares": "6.76.0",
70
+ "@tsed/platform-params": "6.76.0",
71
+ "@tsed/platform-response-filter": "6.76.0",
72
+ "@tsed/platform-views": "6.76.0",
73
+ "@tsed/schema": "6.76.0",
73
74
  "@types/json-schema": "7.0.7",
74
75
  "json-schema": "^0.2.3",
75
76
  "on-finished": "2.3.0",
@@ -1,2 +0,0 @@
1
- import { ControllerProvider } from "../domain/ControllerProvider";
2
- export declare function getControllerPath(basePath: string, provider: ControllerProvider): string;