@tsed/platform-http 8.34.0 → 8.35.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.
Files changed (38) hide show
  1. package/lib/esm/common/builder/PlatformBuilder.js +4 -4
  2. package/lib/esm/common/config/defineConfiguration.js +3 -3
  3. package/lib/esm/common/decorators/params/request.js +2 -2
  4. package/lib/esm/common/decorators/params/response.js +2 -2
  5. package/lib/esm/common/fn/adapter.js +1 -1
  6. package/lib/esm/common/services/Platform.js +1 -1
  7. package/lib/esm/common/services/PlatformAdapter.js +2 -4
  8. package/lib/esm/common/services/PlatformApplication.js +1 -1
  9. package/lib/esm/common/services/PlatformHandler.js +5 -5
  10. package/lib/esm/common/services/PlatformRequest.js +1 -1
  11. package/lib/esm/common/services/PlatformResponse.js +2 -2
  12. package/lib/esm/common/utils/createContext.js +1 -1
  13. package/lib/esm/common/utils/createHttpServer.js +1 -1
  14. package/lib/esm/common/utils/createHttpsServer.js +1 -1
  15. package/lib/esm/common/utils/createInjector.js +5 -1
  16. package/lib/esm/common/utils/createServer.js +1 -1
  17. package/lib/esm/common/utils/getBestHost.js +1 -1
  18. package/lib/esm/common/utils/resolveControllers.js +1 -1
  19. package/lib/esm/testing/FakeAdapter.js +1 -1
  20. package/lib/esm/testing/PlatformTest.js +8 -7
  21. package/lib/types/common/builder/PlatformBuilder.d.ts +3 -3
  22. package/lib/types/common/builder/__fixtures__/PlatformCustom.d.ts +1 -1
  23. package/lib/types/common/config/PlatformConfiguration.d.ts +1 -1
  24. package/lib/types/common/decorators/PlatformProvider.d.ts +1 -1
  25. package/lib/types/common/decorators/multer/multipartFile.d.ts +1 -1
  26. package/lib/types/common/domain/PlatformContext.d.ts +6 -6
  27. package/lib/types/common/fn/adapter.d.ts +1 -1
  28. package/lib/types/common/interfaces/PlatformRouteOptions.d.ts +1 -1
  29. package/lib/types/common/services/Platform.d.ts +1 -1
  30. package/lib/types/common/services/PlatformAdapter.d.ts +3 -3
  31. package/lib/types/common/services/PlatformHandler.d.ts +3 -3
  32. package/lib/types/common/utils/closeServer.d.ts +1 -1
  33. package/lib/types/common/utils/createContext.d.ts +1 -1
  34. package/lib/types/common/utils/createServer.d.ts +3 -3
  35. package/lib/types/common/utils/listenServer.d.ts +1 -1
  36. package/lib/types/testing/FakeAdapter.d.ts +5 -3
  37. package/lib/types/testing/PlatformTest.d.ts +3 -3
  38. package/package.json +59 -60
@@ -1,12 +1,12 @@
1
- import { colors, configuration, constant, createContainer, destroyInjector, injector, logger, ProviderScope } from "@tsed/di";
2
1
  import { $alter, $asyncAlter, $asyncEmit } from "@tsed/hooks";
3
- import { defineConfiguration } from "../config/defineConfiguration.js";
4
- import { application } from "../fn/application.js";
5
- import { Platform } from "../services/Platform.js";
2
+ import { ProviderScope, colors, configuration, constant, createContainer, destroyInjector, injector, logger } from "@tsed/di";
6
3
  import { PlatformAdapter } from "../services/PlatformAdapter.js";
4
+ import { Platform } from "../services/Platform.js";
7
5
  import { PlatformApplication } from "../services/PlatformApplication.js";
6
+ import { application } from "../fn/application.js";
8
7
  import { closeServer } from "../utils/closeServer.js";
9
8
  import { createInjector } from "../utils/createInjector.js";
9
+ import { defineConfiguration } from "../config/defineConfiguration.js";
10
10
  import { getStaticsOptions } from "../utils/getStaticsOptions.js";
11
11
  import { printRoutes } from "../utils/printRoutes.js";
12
12
  import { resolveControllers } from "../utils/resolveControllers.js";
@@ -1,8 +1,8 @@
1
1
  import "./PlatformConfiguration.js";
2
- import { Env, isBoolean, Store } from "@tsed/core";
3
- import { configuration, mergeMount, ProviderScope, ProviderType } from "@tsed/di";
4
- import { $on } from "@tsed/hooks";
2
+ import { Env, Store, isBoolean } from "@tsed/core";
5
3
  import { JsonMapperSettings } from "@tsed/json-mapper";
4
+ import { ProviderScope, ProviderType, configuration, mergeMount } from "@tsed/di";
5
+ import { $on } from "@tsed/hooks";
6
6
  export function defineConfiguration(input = {}) {
7
7
  if (input.$$resolved) {
8
8
  return input;
@@ -1,6 +1,6 @@
1
+ import { Metadata, isClass, nameOf } from "@tsed/core";
2
+ import { ParamTypes, UseParam, mapParamsOptions } from "@tsed/platform-params";
1
3
  import { IncomingMessage } from "node:http";
2
- import { isClass, Metadata, nameOf } from "@tsed/core";
3
- import { mapParamsOptions, ParamTypes, UseParam } from "@tsed/platform-params";
4
4
  function getParamType(target, propertyKey, parameterIndex) {
5
5
  const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
6
6
  if (isClass(type)) {
@@ -1,6 +1,6 @@
1
- import { ServerResponse } from "node:http";
2
- import { isClass, Metadata, nameOf } from "@tsed/core";
1
+ import { Metadata, isClass, nameOf } from "@tsed/core";
3
2
  import { ParamTypes, UseParam } from "@tsed/platform-params";
3
+ import { ServerResponse } from "node:http";
4
4
  function getParamType(target, propertyKey, parameterIndex) {
5
5
  const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
6
6
  if (isClass(type)) {
@@ -1,4 +1,4 @@
1
- import { injector, Provider, refValue } from "@tsed/di";
1
+ import { Provider, injector, refValue } from "@tsed/di";
2
2
  import { PlatformAdapter } from "../services/PlatformAdapter.js";
3
3
  const ADAPTER = "platform.adapter";
4
4
  let globalAdapter;
@@ -1,5 +1,5 @@
1
- import { inject, injectable, injector, ProviderScope } from "@tsed/di";
2
1
  import { PlatformRouters } from "@tsed/platform-router";
2
+ import { ProviderScope, inject, injectable, injector } from "@tsed/di";
3
3
  import { application } from "../fn/application.js";
4
4
  /**
5
5
  * `Platform` is used to provide all routes collected by annotation `@Controller`.
@@ -1,11 +1,9 @@
1
1
  import { configuration, constant, inject, injectable } from "@tsed/di";
2
2
  import { $on } from "@tsed/hooks";
3
+ import { PlatformApplication } from "./PlatformApplication.js";
3
4
  import { application } from "../fn/application.js";
4
5
  import { createHttpServer } from "../utils/createHttpServer.js";
5
6
  import { createHttpsServer } from "../utils/createHttpsServer.js";
6
- import { Platform } from "./Platform.js";
7
- import { PlatformApplication } from "./PlatformApplication.js";
8
- import { PlatformHandler } from "./PlatformHandler.js";
9
7
  export class PlatformAdapter {
10
8
  constructor() {
11
9
  this.app = inject(PlatformApplication);
@@ -45,4 +43,4 @@ export class PlatformAdapter {
45
43
  return inject(Symbol.for("MULTER_MODULE"))?.get(options);
46
44
  }
47
45
  }
48
- injectable(PlatformAdapter).imports([PlatformApplication, Platform, PlatformHandler]).alias("PlatformAdapter");
46
+ injectable(PlatformAdapter).imports([PlatformApplication]).alias("PlatformAdapter");
@@ -1,4 +1,4 @@
1
- import { injectable, ProviderScope } from "@tsed/di";
1
+ import { ProviderScope, injectable } from "@tsed/di";
2
2
  import { PlatformRouter } from "@tsed/platform-router";
3
3
  /**
4
4
  * `PlatformApplication` is used to provide all routes collected by annotation `@Controller`.
@@ -1,13 +1,13 @@
1
+ import { PlatformHandlerMetadata, PlatformHandlerType, PlatformRouters, useResponseHandler } from "@tsed/platform-router";
1
2
  import { AnyToPromiseStatus, catchAsyncError } from "@tsed/core";
2
- import { inject, injectable, ProviderScope } from "@tsed/di";
3
+ import { PlatformParams } from "@tsed/platform-params";
4
+ import { ProviderScope, inject, injectable } from "@tsed/di";
3
5
  import { $alter } from "@tsed/hooks";
6
+ import { AnyToPromiseWithCtx } from "../domain/AnyToPromiseWithCtx.js";
7
+ import { PlatformAdapter } from "./PlatformAdapter.js";
4
8
  import { PlatformExceptions } from "@tsed/platform-exceptions";
5
- import { PlatformParams } from "@tsed/platform-params";
6
9
  import { PlatformResponseFilter } from "@tsed/platform-response-filter";
7
- import { PlatformHandlerMetadata, PlatformHandlerType, PlatformRouters, useResponseHandler } from "@tsed/platform-router";
8
- import { AnyToPromiseWithCtx } from "../domain/AnyToPromiseWithCtx.js";
9
10
  import { setResponseHeaders } from "../utils/setResponseHeaders.js";
10
- import { PlatformAdapter } from "./PlatformAdapter.js";
11
11
  /**
12
12
  * Platform Handler abstraction layer. Wrap original class method to a pure platform handler (Express, Koa, etc...).
13
13
  * @platform
@@ -1,4 +1,4 @@
1
- import { injectable, ProviderScope } from "@tsed/di";
1
+ import { ProviderScope, injectable } from "@tsed/di";
2
2
  /**
3
3
  * Platform Request abstraction layer.
4
4
  * @platform
@@ -1,7 +1,7 @@
1
+ import { ProviderScope, injectable, lazyInject } from "@tsed/di";
1
2
  import { isBoolean, isNumber, isStream, isString } from "@tsed/core";
2
- import { injectable, lazyInject, ProviderScope } from "@tsed/di";
3
- import { getStatusMessage } from "@tsed/schema";
4
3
  import encodeUrl from "encodeurl";
4
+ import { getStatusMessage } from "@tsed/schema";
5
5
  /**
6
6
  * Platform Response abstraction layer.
7
7
  * @platform
@@ -1,8 +1,8 @@
1
1
  import { configuration, injector } from "@tsed/di";
2
- import { v4 } from "uuid";
3
2
  import { PlatformContext } from "../domain/PlatformContext.js";
4
3
  import { PlatformRequest } from "../services/PlatformRequest.js";
5
4
  import { PlatformResponse } from "../services/PlatformResponse.js";
5
+ import { v4 } from "uuid";
6
6
  function defaultReqIdBuilder(req) {
7
7
  return req.get?.("x-request-id") || v4().split("-").join("");
8
8
  }
@@ -1,5 +1,5 @@
1
- import Http from "node:http";
2
1
  import { configuration, constant } from "@tsed/di";
2
+ import Http from "node:http";
3
3
  import { createServer } from "./createServer.js";
4
4
  export function createHttpServer(requestListener) {
5
5
  const httpOptions = configuration().get("httpOptions");
@@ -1,5 +1,5 @@
1
- import Https from "node:https";
2
1
  import { configuration, constant } from "@tsed/di";
2
+ import Https from "node:https";
3
3
  import { createServer } from "./createServer.js";
4
4
  export function createHttpsServer(requestListener) {
5
5
  const httpsOptions = configuration().get("httpsOptions");
@@ -1,7 +1,9 @@
1
1
  import { attachLogger, injector } from "@tsed/di";
2
- import { $log } from "@tsed/logger";
3
2
  import { adapter as $adapter } from "../fn/adapter.js";
3
+ import { $log } from "@tsed/logger";
4
+ import { Platform } from "../services/Platform.js";
4
5
  import { PlatformAdapter } from "../services/PlatformAdapter.js";
6
+ import { PlatformHandler } from "../services/PlatformHandler.js";
5
7
  $log.name = "TSED";
6
8
  export function createInjector(settings) {
7
9
  const inj = injector();
@@ -9,5 +11,7 @@ export function createInjector(settings) {
9
11
  attachLogger($log);
10
12
  $adapter(settings.adapter);
11
13
  inj.invoke(PlatformAdapter);
14
+ inj.invoke(Platform);
15
+ inj.invoke(PlatformHandler);
12
16
  return inj;
13
17
  }
@@ -1,5 +1,5 @@
1
+ import { ProviderScope, configuration, injector, logger } from "@tsed/di";
1
2
  import { getHostInfoFromPort } from "@tsed/core";
2
- import { configuration, injector, logger, ProviderScope } from "@tsed/di";
3
3
  import { listenServer } from "./listenServer.js";
4
4
  export function createServer({ token, type, port, server: get, listen }) {
5
5
  const server = port !== false ? get() : null;
@@ -1,5 +1,5 @@
1
- import { getHostInfoFromPort } from "@tsed/core";
2
1
  import { configuration, constant } from "@tsed/di";
2
+ import { getHostInfoFromPort } from "@tsed/core";
3
3
  function httpPort() {
4
4
  return constant("httpPort", constant("port"));
5
5
  }
@@ -1,5 +1,5 @@
1
- import { isArray, isClass } from "@tsed/core";
2
1
  import { Provider, ProviderType } from "@tsed/di";
2
+ import { isArray, isClass } from "@tsed/core";
3
3
  const lookupProperties = ["mount", "imports"];
4
4
  /**
5
5
  * @ignore
@@ -1,5 +1,5 @@
1
1
  import { injectable } from "@tsed/di";
2
- import { PlatformAdapter } from "../common/index.js";
2
+ import { PlatformAdapter } from "../common/services/PlatformAdapter.js";
3
3
  export class FakeAdapter extends PlatformAdapter {
4
4
  constructor() {
5
5
  super(...arguments);
@@ -1,14 +1,15 @@
1
- import { isPlainObject } from "@tsed/core";
2
1
  import { DITest, injector } from "@tsed/di";
3
- import accepts from "accepts";
4
- import { PlatformBuilder } from "../common/builder/PlatformBuilder.js";
5
- import { PlatformContext } from "../common/domain/PlatformContext.js";
6
- import { adapter, defineConfiguration } from "../common/index.js";
2
+ import { isPlainObject } from "@tsed/core";
7
3
  import { PlatformAdapter } from "../common/services/PlatformAdapter.js";
8
- import { PlatformApplication } from "../common/services/PlatformApplication.js";
9
- import { createInjector } from "../common/utils/createInjector.js";
10
4
  import { FakeAdapter } from "./FakeAdapter.js";
11
5
  import { FakeResponse } from "./FakeResponse.js";
6
+ import { adapter } from "../common/fn/adapter.js";
7
+ import { defineConfiguration } from "../common/config/defineConfiguration.js";
8
+ import { PlatformContext } from "../common/domain/PlatformContext.js";
9
+ import { PlatformApplication } from "../common/services/PlatformApplication.js";
10
+ import { PlatformBuilder } from "../common/builder/PlatformBuilder.js";
11
+ import accepts from "accepts";
12
+ import { createInjector } from "../common/utils/createInjector.js";
12
13
  /**
13
14
  * @platform
14
15
  */
@@ -1,10 +1,10 @@
1
1
  import type { IncomingMessage, ServerResponse } from "node:http";
2
- import type { Type } from "@tsed/core";
3
2
  import { InjectorService, ProviderOpts, TokenProvider } from "@tsed/di";
4
- import { PlatformLayer } from "@tsed/platform-router";
5
- import { Platform } from "../services/Platform.js";
6
3
  import { PlatformAdapter, PlatformBuilderSettings } from "../services/PlatformAdapter.js";
4
+ import { Platform } from "../services/Platform.js";
7
5
  import { PlatformApplication } from "../services/PlatformApplication.js";
6
+ import { PlatformLayer } from "@tsed/platform-router";
7
+ import type { Type } from "@tsed/core";
8
8
  /**
9
9
  * @platform
10
10
  */
@@ -1,6 +1,6 @@
1
- import { Type } from "@tsed/core";
2
1
  import { FakeAdapter } from "../../../testing/index.js";
3
2
  import { PlatformBuilder } from "../PlatformBuilder.js";
3
+ import { Type } from "@tsed/core";
4
4
  export declare class PlatformCustom extends FakeAdapter {
5
5
  readonly NAME = "custom";
6
6
  readonly providers: {
@@ -1,7 +1,7 @@
1
- import { Type } from "@tsed/core";
2
1
  import { DIConfiguration } from "@tsed/di";
3
2
  import { JsonMapperGlobalOptions } from "@tsed/json-mapper";
4
3
  import type { PlatformStaticsSettings } from "./PlatformStaticsSettings.js";
4
+ import { Type } from "@tsed/core";
5
5
  export interface PlatformRouterSettings {
6
6
  appendChildrenRoutesFirst?: boolean;
7
7
  }
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { PlatformAdapter } from "../services/PlatformAdapter.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Register a new platform adapter.
5
5
  * @decorator
@@ -1,5 +1,5 @@
1
- import type { MultipartFile as MType } from "@tsed/platform-multer";
2
1
  import { MultipartFile as M } from "@tsed/platform-multer";
2
+ import type { MultipartFile as MType } from "@tsed/platform-multer";
3
3
  /**
4
4
  * Define a parameter as Multipart file.
5
5
  *
@@ -1,9 +1,9 @@
1
- import { IncomingMessage, ServerResponse } from "node:http";
2
1
  import { DIContext, DIContextOptions } from "@tsed/di";
3
- import { PlatformHandlerMetadata } from "@tsed/platform-router";
4
- import { EndpointMetadata } from "@tsed/schema";
2
+ import { IncomingMessage, ServerResponse } from "node:http";
5
3
  import { IncomingEvent } from "../interfaces/IncomingEvent.js";
4
+ import { JsonMethodStore } from "@tsed/schema";
6
5
  import { PlatformApplication } from "../services/PlatformApplication.js";
6
+ import { PlatformHandlerMetadata } from "@tsed/platform-router";
7
7
  import { PlatformRequest } from "../services/PlatformRequest.js";
8
8
  import { PlatformResponse } from "../services/PlatformResponse.js";
9
9
  declare global {
@@ -15,7 +15,7 @@ declare global {
15
15
  export interface PlatformContextOptions extends DIContextOptions {
16
16
  event: IncomingEvent;
17
17
  ignoreUrlPatterns?: any[];
18
- endpoint?: EndpointMetadata;
18
+ endpoint?: JsonMethodStore;
19
19
  }
20
20
  export declare class PlatformContext<PReq extends PlatformRequest = PlatformRequest, PRes extends PlatformResponse = PlatformResponse> extends DIContext {
21
21
  #private;
@@ -42,9 +42,9 @@ export declare class PlatformContext<PReq extends PlatformRequest = PlatformRequ
42
42
  */
43
43
  readonly request: PReq;
44
44
  /**
45
- * The current @@EndpointMetadata@@ resolved by Ts.ED during the request.
45
+ * The current @@JsonMethodStore@@ resolved by Ts.ED during the request.
46
46
  */
47
- endpoint: EndpointMetadata;
47
+ endpoint: JsonMethodStore;
48
48
  /**
49
49
  * The current @@PlatformHandlerMetadata@@ resolved by Ts.ED during the request.
50
50
  */
@@ -1,6 +1,6 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ProviderOpts } from "@tsed/di";
3
2
  import { PlatformAdapter } from "../services/PlatformAdapter.js";
3
+ import { Type } from "@tsed/core";
4
4
  /**
5
5
  * Set the platform adapter token and his dependencies
6
6
  */
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { PathType } from "@tsed/di";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * @ignore
5
5
  */
@@ -1,5 +1,5 @@
1
- import { TokenProvider } from "@tsed/di";
2
1
  import { PlatformLayer, PlatformRouters } from "@tsed/platform-router";
2
+ import { TokenProvider } from "@tsed/di";
3
3
  import { Route, RouteController } from "../interfaces/Route.js";
4
4
  /**
5
5
  * `Platform` is used to provide all routes collected by annotation `@Controller`.
@@ -1,10 +1,10 @@
1
1
  import { IncomingMessage, ServerResponse } from "node:http";
2
- import { Type } from "@tsed/core";
3
- import type { PlatformMulter, PlatformMulterSettings } from "@tsed/platform-multer";
4
2
  import { PlatformHandlerMetadata, PlatformLayer } from "@tsed/platform-router";
5
- import type { PlatformStaticsOptions } from "../config/PlatformStaticsSettings.js";
3
+ import type { PlatformMulter, PlatformMulterSettings } from "@tsed/platform-multer";
6
4
  import { CreateServerReturn } from "../utils/createServer.js";
7
5
  import { PlatformApplication } from "./PlatformApplication.js";
6
+ import type { PlatformStaticsOptions } from "../config/PlatformStaticsSettings.js";
7
+ import { Type } from "@tsed/core";
8
8
  export declare abstract class PlatformAdapter<App = TsED.Application> {
9
9
  abstract readonly NAME: string;
10
10
  readonly app: PlatformApplication<App>;
@@ -1,10 +1,10 @@
1
+ import { PlatformHandlerMetadata, PlatformRouters } from "@tsed/platform-router";
1
2
  import { AnyPromiseResult } from "@tsed/core";
3
+ import { PlatformParams, PlatformParamsCallback } from "@tsed/platform-params";
2
4
  import { Provider } from "@tsed/di";
5
+ import { PlatformContext } from "../domain/PlatformContext.js";
3
6
  import { PlatformExceptions } from "@tsed/platform-exceptions";
4
- import { PlatformParams, PlatformParamsCallback } from "@tsed/platform-params";
5
7
  import { PlatformResponseFilter } from "@tsed/platform-response-filter";
6
- import { PlatformHandlerMetadata, PlatformRouters } from "@tsed/platform-router";
7
- import { PlatformContext } from "../domain/PlatformContext.js";
8
8
  /**
9
9
  * Platform Handler abstraction layer. Wrap original class method to a pure platform handler (Express, Koa, etc...).
10
10
  * @platform
@@ -1,4 +1,4 @@
1
1
  import type Http from "node:http";
2
- import type Https from "node:https";
3
2
  import type Http2 from "http2";
3
+ import type Https from "node:https";
4
4
  export declare function closeServer(server: Http.Server | Https.Server | Http2.Http2Server): Promise<unknown> | undefined;
@@ -1,5 +1,5 @@
1
- import { PlatformContext } from "../domain/PlatformContext.js";
2
1
  import { IncomingEvent } from "../interfaces/IncomingEvent.js";
2
+ import { PlatformContext } from "../domain/PlatformContext.js";
3
3
  export declare function buildIgnoreLog(ignoreUrlPatterns: any[] | undefined): ((ignore: boolean, data: any, url: string) => any) | undefined;
4
4
  /**
5
5
  * Create the TsED context to wrap request, response, injector, etc...
@@ -1,8 +1,8 @@
1
- import Http from "node:http";
2
- import Https from "node:https";
3
- import { ReturnHostInfoFromPort } from "@tsed/core";
4
1
  import { TokenProvider } from "@tsed/di";
2
+ import { ReturnHostInfoFromPort } from "@tsed/core";
3
+ import Http from "node:http";
5
4
  import Http2 from "http2";
5
+ import Https from "node:https";
6
6
  export interface CreateServerOptions {
7
7
  token: TokenProvider;
8
8
  type: "http" | "https";
@@ -1,5 +1,5 @@
1
1
  import type Http from "node:http";
2
+ import type Http2 from "http2";
2
3
  import type Https from "node:https";
3
4
  import { getHostInfoFromPort } from "@tsed/core";
4
- import type Http2 from "http2";
5
5
  export declare function listenServer(server: Http.Server | Https.Server | Http2.Http2Server, hostInfo: ReturnType<typeof getHostInfoFromPort>): Promise<unknown>;
@@ -1,6 +1,8 @@
1
- import { type ProviderOpts } from "@tsed/di";
2
1
  import { type PlatformContextHandler, PlatformLayer } from "@tsed/platform-router";
3
- import { PlatformAdapter, PlatformContext, type PlatformStaticsOptions } from "../common/index.js";
2
+ import { type ProviderOpts } from "@tsed/di";
3
+ import { PlatformContext } from "../common/domain/PlatformContext.js";
4
+ import { type PlatformStaticsOptions } from "../common/config/PlatformStaticsSettings.js";
5
+ import { PlatformAdapter } from "../common/services/PlatformAdapter.js";
4
6
  export declare class FakeAdapter extends PlatformAdapter<any> {
5
7
  readonly NAME: string;
6
8
  providers: ProviderOpts[];
@@ -24,6 +26,6 @@ export declare class FakeAdapter extends PlatformAdapter<any> {
24
26
  statics(endpoint: string, options: PlatformStaticsOptions): any;
25
27
  bodyParser(type: string): any;
26
28
  mapLayers(layers: PlatformLayer[]): void;
27
- mapHandler(handler: PlatformContextHandler<PlatformContext>): PlatformContextHandler<PlatformContext<import("../common/index.js").PlatformRequest<any>, import("../common/index.js").PlatformResponse<any>>>;
29
+ mapHandler(handler: PlatformContextHandler<PlatformContext>): PlatformContextHandler<PlatformContext<import("../index.js").PlatformRequest<any>, import("../index.js").PlatformResponse<any>>>;
28
30
  useContext(): void;
29
31
  }
@@ -1,7 +1,7 @@
1
- import type { IncomingMessage, RequestListener, ServerResponse } from "node:http";
2
1
  import { DITest, InjectorService } from "@tsed/di";
3
- import { PlatformContext, PlatformContextOptions } from "../common/domain/PlatformContext.js";
2
+ import type { IncomingMessage, RequestListener, ServerResponse } from "node:http";
4
3
  import { PlatformBuilderSettings } from "../common/services/PlatformAdapter.js";
4
+ import { PlatformContext, PlatformContextOptions } from "../common/domain/PlatformContext.js";
5
5
  /**
6
6
  * @platform
7
7
  */
@@ -54,5 +54,5 @@ export declare class PlatformTest extends DITest {
54
54
  static callback(): RequestListener<typeof IncomingMessage, typeof ServerResponse>;
55
55
  static createRequest(options?: any): any;
56
56
  static createResponse(options?: any): any;
57
- static createRequestContext(options?: Partial<PlatformContextOptions & any>): PlatformContext<import("../common/index.js").PlatformRequest<any>, import("../common/index.js").PlatformResponse<any>>;
57
+ static createRequestContext(options?: Partial<PlatformContextOptions & any>): PlatformContext<import("../index.js").PlatformRequest<any>, import("../index.js").PlatformResponse<any>>;
58
58
  }
package/package.json CHANGED
@@ -1,63 +1,37 @@
1
1
  {
2
2
  "name": "@tsed/platform-http",
3
+ "version": "8.35.0",
3
4
  "description": "A TypeScript Framework on top of Express",
4
- "type": "module",
5
- "version": "8.34.0",
6
- "source": "./src/common/index.ts",
7
- "main": "./lib/esm/common/index.js",
8
- "module": "./lib/esm/common/index.js",
9
- "typings": "./lib/types/common/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "tsed-source": "./src/index.ts",
13
- "types": "./lib/types/common/index.d.ts",
14
- "import": "./lib/esm/common/index.js",
15
- "default": "./lib/esm/common/index.js"
16
- },
17
- "./testing": {
18
- "tsed-source": "./src/testing/index.ts",
19
- "types": "./lib/types/testing/index.d.ts",
20
- "import": "./lib/esm/testing/index.js",
21
- "default": "./lib/esm/testing/index.js"
22
- }
23
- },
24
- "scripts": {
25
- "build": "yarn barrels && yarn build:ts",
26
- "barrels": "barrels",
27
- "test": "vitest run",
28
- "build:ts": "tsc --build tsconfig.esm.json",
29
- "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
30
- },
31
5
  "keywords": [
6
+ "Controller",
7
+ "Decorator",
8
+ "ES2015",
9
+ "ES6",
32
10
  "Express",
11
+ "Inject",
33
12
  "Koa",
34
13
  "TypeScript",
35
- "typescript",
36
- "Decorator",
37
- "decorators",
14
+ "api",
38
15
  "decorator",
16
+ "decorators",
17
+ "di",
39
18
  "express",
40
- "koa",
41
- "Controller",
42
- "Inject",
43
19
  "ioc",
44
- "di",
20
+ "koa",
45
21
  "mvc",
22
+ "rest",
23
+ "server",
46
24
  "swagger",
47
25
  "swagger ui",
48
- "ES2015",
49
- "ES6",
50
- "server",
51
- "rest",
52
- "api",
26
+ "typescript",
53
27
  "validation"
54
28
  ],
55
- "author": "Romain Lenzotti",
56
- "license": "MIT",
29
+ "homepage": "https://github.com/tsedio/tsed/tree/production/packages/platform/platform-http",
57
30
  "bugs": {
58
31
  "url": "https://github.com/tsedio/tsed/issues"
59
32
  },
60
- "homepage": "https://github.com/tsedio/tsed/tree/production/packages/platform/platform-http",
33
+ "license": "MIT",
34
+ "author": "Romain Lenzotti",
61
35
  "repository": "https://github.com/tsedio/tsed",
62
36
  "funding": [
63
37
  {
@@ -69,23 +43,49 @@
69
43
  "url": "https://opencollective.com/tsed"
70
44
  }
71
45
  ],
46
+ "source": "./src/common/index.ts",
47
+ "type": "module",
48
+ "main": "./lib/esm/common/index.js",
49
+ "module": "./lib/esm/common/index.js",
50
+ "typings": "./lib/types/common/index.d.ts",
51
+ "exports": {
52
+ ".": {
53
+ "tsed-source": "./src/index.ts",
54
+ "types": "./lib/types/common/index.d.ts",
55
+ "import": "./lib/esm/common/index.js",
56
+ "default": "./lib/esm/common/index.js"
57
+ },
58
+ "./testing": {
59
+ "tsed-source": "./src/testing/index.ts",
60
+ "types": "./lib/types/testing/index.d.ts",
61
+ "import": "./lib/esm/testing/index.js",
62
+ "default": "./lib/esm/testing/index.js"
63
+ }
64
+ },
65
+ "scripts": {
66
+ "build": "yarn barrels && yarn build:ts",
67
+ "barrels": "barrels",
68
+ "test": "vitest run",
69
+ "build:ts": "tsc --build tsconfig.esm.json",
70
+ "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
71
+ },
72
72
  "dependencies": {
73
- "@tsed/core": "8.34.0",
74
- "@tsed/di": "8.34.0",
75
- "@tsed/exceptions": "8.34.0",
76
- "@tsed/hooks": "8.34.0",
77
- "@tsed/json-mapper": "8.34.0",
73
+ "@tsed/core": "8.35.0",
74
+ "@tsed/di": "8.35.0",
75
+ "@tsed/exceptions": "8.35.0",
76
+ "@tsed/hooks": "8.35.0",
77
+ "@tsed/json-mapper": "8.35.0",
78
78
  "@tsed/logger": "^8.0.0",
79
79
  "@tsed/logger-std": "^8.0.0",
80
- "@tsed/platform-accept-mimes": "8.34.0",
81
- "@tsed/platform-exceptions": "8.34.0",
82
- "@tsed/platform-middlewares": "8.34.0",
83
- "@tsed/platform-multer": "8.34.0",
84
- "@tsed/platform-params": "8.34.0",
85
- "@tsed/platform-response-filter": "8.34.0",
86
- "@tsed/platform-router": "8.34.0",
87
- "@tsed/platform-views": "8.34.0",
88
- "@tsed/schema": "8.34.0",
80
+ "@tsed/platform-accept-mimes": "8.35.0",
81
+ "@tsed/platform-exceptions": "8.35.0",
82
+ "@tsed/platform-middlewares": "8.35.0",
83
+ "@tsed/platform-multer": "8.35.0",
84
+ "@tsed/platform-params": "8.35.0",
85
+ "@tsed/platform-response-filter": "8.35.0",
86
+ "@tsed/platform-router": "8.35.0",
87
+ "@tsed/platform-views": "8.35.0",
88
+ "@tsed/schema": "8.35.0",
89
89
  "@types/json-schema": "7.0.15",
90
90
  "accepts": "^1.3.8",
91
91
  "encodeurl": "^2.0.0",
@@ -93,11 +93,10 @@
93
93
  "uuid": "14.0.0"
94
94
  },
95
95
  "devDependencies": {
96
- "@tsed/barrels": "8.34.0",
97
- "@tsed/engines": "8.34.0",
98
- "@tsed/typescript": "8.34.0",
96
+ "@tsed/barrels": "8.35.0",
97
+ "@tsed/engines": "8.35.0",
98
+ "@tsed/typescript": "8.35.0",
99
99
  "cross-env": "7.0.3",
100
- "eslint": "9.12.0",
101
100
  "typescript": "6.0.2",
102
101
  "vitest": "4.1.4"
103
102
  },