@tsed/common 6.86.2 → 6.88.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.
@@ -13,5 +13,4 @@ export * from "./OnReady";
13
13
  export * from "./OnRequest";
14
14
  export * from "./OnResponse";
15
15
  export * from "./Route";
16
- export * from "./PlatformRouterMethods";
17
16
  export * from "./IncomingEvent";
@@ -2,7 +2,6 @@ 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";
6
5
  /**
7
6
  * `Platform` is used to provide all routes collected by annotation `@Controller`.
8
7
  *
@@ -0,0 +1,6 @@
1
+ import { JsonOperationRoute } from "@tsed/schema";
2
+ import { ControllerProvider } from "../domain/ControllerProvider";
3
+ import { EndpointMetadata } from "../domain/EndpointMetadata";
4
+ export declare class PlatformMiddlewaresChain {
5
+ get(provider: ControllerProvider, operationRoute: JsonOperationRoute<EndpointMetadata>): any[];
6
+ }
@@ -18,12 +18,13 @@ declare global {
18
18
  export declare class PlatformRequest<T extends {
19
19
  [key: string]: any;
20
20
  } = any> {
21
+ protected $ctx: PlatformContext;
21
22
  raw: T;
22
23
  /**
23
24
  * The current @@PlatformResponse@@.
24
25
  */
25
26
  response: PlatformResponse;
26
- constructor({ request }: IncomingEvent);
27
+ constructor({ request }: IncomingEvent, $ctx: PlatformContext);
27
28
  get secure(): boolean;
28
29
  get host(): string;
29
30
  get protocol(): string;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
- import { PlatformViews } from "@tsed/platform-views";
3
2
  import { ServerResponse } from "http";
4
3
  import { IncomingEvent } from "../interfaces/IncomingEvent";
5
4
  import type { PlatformRequest } from "./PlatformRequest";
5
+ import type { PlatformContext } from "../domain/PlatformContext";
6
6
  declare global {
7
7
  namespace TsED {
8
8
  interface Response {
@@ -15,14 +15,14 @@ export declare type HeaderValue = Array<boolean | number | string> | boolean | n
15
15
  * @platform
16
16
  */
17
17
  export declare class PlatformResponse<T extends Record<string, any> = any> {
18
- platformViews: PlatformViews;
18
+ protected $ctx: PlatformContext;
19
19
  /**
20
20
  * The current @@PlatformRequest@@.
21
21
  */
22
22
  request: PlatformRequest;
23
23
  data: any;
24
24
  raw: T;
25
- constructor({ response }: IncomingEvent);
25
+ constructor({ response }: IncomingEvent, $ctx: PlatformContext);
26
26
  /**
27
27
  * Get the current statusCode
28
28
  */
@@ -139,7 +139,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
139
139
  * @param path
140
140
  * @param options
141
141
  */
142
- render(path: string, options?: any): Promise<string>;
142
+ render(path: string, options?: any): Promise<any>;
143
143
  /**
144
144
  * Send any data to your consumer.
145
145
  *
@@ -20,6 +20,7 @@ export declare class PlatformRouter<Router = TsED.Router> {
20
20
  protected platformHandler: PlatformHandler;
21
21
  rawRouter: Router;
22
22
  raw: any;
23
+ isBuilt: boolean;
23
24
  injector: InjectorService;
24
25
  constructor(platformHandler: PlatformHandler);
25
26
  /**
@@ -7,7 +7,7 @@ import { PlatformContext, PlatformContextOptions } from "../domain/PlatformConte
7
7
  */
8
8
  export declare class PlatformTest extends DITest {
9
9
  static platformBuilder: Type<PlatformBuilder<any, any>>;
10
- static create(options?: Partial<TsED.Configuration>): Promise<void>;
10
+ static create(settings?: Partial<TsED.Configuration>): Promise<void>;
11
11
  /**
12
12
  * Create a new injector with the right default services
13
13
  */
@@ -5,3 +5,4 @@ export * from "./PlatformRequest";
5
5
  export * from "./PlatformResponse";
6
6
  export * from "./PlatformRouter";
7
7
  export * from "./PlatformTest";
8
+ export * from "./PlatformMiddlewaresChain";
@@ -1,2 +1,7 @@
1
- import { InjectorService } from "@tsed/di";
2
- export declare function createInjector(settings?: Partial<TsED.Configuration>): InjectorService;
1
+ import { InjectorService, IProvider } from "@tsed/di";
2
+ interface CreateInjectorOptions {
3
+ providers?: IProvider[];
4
+ settings?: Partial<TsED.Configuration>;
5
+ }
6
+ export declare function createInjector({ providers, settings }: CreateInjectorOptions): InjectorService;
7
+ export {};
@@ -1,5 +1,4 @@
1
1
  export * from "./createInjector";
2
- export * from "./createPlatformApplication";
3
2
  export * from "./createHttpServer";
4
3
  export * from "./createHttpsServer";
5
4
  export * from "./loadInjector";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/common",
3
- "version": "6.86.2",
3
+ "version": "6.88.0",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -55,22 +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.86.2",
59
- "@tsed/core": "6.86.2",
60
- "@tsed/di": "6.86.2",
61
- "@tsed/exceptions": "6.86.2",
62
- "@tsed/json-mapper": "6.86.2",
58
+ "@tsed/components-scan": "6.88.0",
59
+ "@tsed/core": "6.88.0",
60
+ "@tsed/di": "6.88.0",
61
+ "@tsed/exceptions": "6.88.0",
62
+ "@tsed/json-mapper": "6.88.0",
63
63
  "@tsed/logger": "^6.0.0",
64
64
  "@tsed/logger-file": "^6.0.0",
65
- "@tsed/perf": "6.86.2",
66
- "@tsed/platform-cache": "6.86.2",
67
- "@tsed/platform-exceptions": "6.86.2",
68
- "@tsed/platform-log-middleware": "6.86.2",
69
- "@tsed/platform-middlewares": "6.86.2",
70
- "@tsed/platform-params": "6.86.2",
71
- "@tsed/platform-response-filter": "6.86.2",
72
- "@tsed/platform-views": "6.86.2",
73
- "@tsed/schema": "6.86.2",
65
+ "@tsed/perf": "6.88.0",
66
+ "@tsed/platform-cache": "6.88.0",
67
+ "@tsed/platform-exceptions": "6.88.0",
68
+ "@tsed/platform-log-middleware": "6.88.0",
69
+ "@tsed/platform-middlewares": "6.88.0",
70
+ "@tsed/platform-params": "6.88.0",
71
+ "@tsed/platform-response-filter": "6.88.0",
72
+ "@tsed/platform-views": "6.88.0",
73
+ "@tsed/schema": "6.88.0",
74
74
  "@types/json-schema": "7.0.7",
75
75
  "json-schema": "^0.2.3",
76
76
  "on-finished": "2.3.0",
@@ -1,10 +0,0 @@
1
- import type { PlatformRouteOptions } from "./PlatformRouteOptions";
2
- /**
3
- * @ignore
4
- */
5
- export interface PlatformRouterMethods<T = any> {
6
- addRoute(routeOptions: PlatformRouteOptions): this;
7
- use(...handlers: any[]): this;
8
- callback(): any;
9
- getRouter(): T;
10
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { InjectorService } from "@tsed/di";
2
- export declare function createPlatformApplication(injector: InjectorService): void;