From 13153b4acc033967e83a558a8533c8a4834e1472 Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 4 Oct 2023 15:16:18 -0300 Subject: [PATCH 1/4] support uws idle timeout --- etc/http-server.api.md | 7 ++++--- src/types.ts | 1 + src/uws.ts | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/etc/http-server.api.md b/etc/http-server.api.md index c92c885..08a5789 100644 --- a/etc/http-server.api.md +++ b/etc/http-server.api.md @@ -68,6 +68,7 @@ export type ITestHttpServerComponent = IHttpServerCompon // @public (undocumented) export type IUwsHttpServerOptions = { compression: boolean; + idleTimeout?: number; }; // @alpha (undocumented) @@ -177,9 +178,9 @@ export interface WebSocketServer { // Warnings were encountered during analysis: // -// dist/router.d.ts:20:5 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts -// dist/types.d.ts:23:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha -// dist/types.d.ts:29:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts +// src/router.ts:45:3 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts +// src/types.ts:30:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha +// src/types.ts:36:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/src/types.ts b/src/types.ts index 7269de2..1be81fa 100644 --- a/src/types.ts +++ b/src/types.ts @@ -38,4 +38,5 @@ export type IHttpServerOptions = { */ export type IUwsHttpServerOptions = { compression: boolean + idleTimeout?: number } diff --git a/src/uws.ts b/src/uws.ts index 3051dec..d6678d3 100644 --- a/src/uws.ts +++ b/src/uws.ts @@ -48,11 +48,11 @@ export async function createUwsHttpServer( const host = await config.requireString("HTTP_SERVER_HOST") const server: uwslib.TemplatedApp = uwslib - .App({ - }) + .App({}) .ws("/*", { compression: options.compression ? uwslib.SHARED_COMPRESSOR : uwslib.DISABLED, upgrade: wsHandler, + idleTimeout: options.idleTimeout ?? 120, open(_ws) { const ws = _ws as WsUserData ws.websocketConnect(ws as any) From 72a6eee8cfb0560424978cd8b1164379b4aef09b Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 4 Oct 2023 15:23:27 -0300 Subject: [PATCH 2/4] test --- etc/http-server.api.md | 374 ++++++++++++++++++++--------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/etc/http-server.api.md b/etc/http-server.api.md index 08a5789..ad173b0 100644 --- a/etc/http-server.api.md +++ b/etc/http-server.api.md @@ -1,187 +1,187 @@ -## API Report File for "@well-known-components/http-server" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -/// - -import * as fetch_2 from 'node-fetch'; -import type * as http from 'http'; -import type * as https from 'https'; -import { IBaseComponent } from '@well-known-components/interfaces'; -import { IConfigComponent } from '@well-known-components/interfaces'; -import { IHttpServerComponent } from '@well-known-components/interfaces'; -import type { ILoggerComponent } from '@well-known-components/interfaces'; -import { IMiddlewareAdapterHandler } from '@well-known-components/interfaces'; -import type { IStatusCheckCapableComponent } from '@well-known-components/interfaces'; -import { Key } from 'path-to-regexp'; -import type { Socket } from 'net'; - -// @public (undocumented) -export type AllowedMethodOptions = Partial<{ - throw: boolean; - notImplemented: NewableFunction; - methodNotAllowed: NewableFunction; -}>; - -// @public -export function createServerComponent(components: ServerComponents, options: Partial): Promise>; - -// @public -export function createStatusCheckComponent(components: { - server: IHttpServerComponent; - config: IConfigComponent; -}): Promise; - -// @public -export function createTestServerComponent(): ITestHttpServerComponent; - -// @public (undocumented) -export type FullHttpServerComponent = IHttpServerComponent & IBaseComponent & IStatusCheckCapableComponent & { - resetMiddlewares(): void; -}; - -// @public (undocumented) -export function getUnderlyingServer(server: IHttpServerComponent): Promise; - -// @public (undocumented) -export type IFetchComponent = { - fetch(url: fetch_2.Request): Promise; - fetch(url: fetch_2.RequestInfo, init?: fetch_2.RequestInit): Promise; -}; - -// @public (undocumented) -export type IHttpServerOptions = { - cors?: CorsOptions; -} & ({ - https: https.ServerOptions; -} | { - http: http.ServerOptions; -}); - -// @public (undocumented) -export type ITestHttpServerComponent = IHttpServerComponent & IFetchComponent & { - resetMiddlewares(): void; -}; - -// @public (undocumented) -export type IUwsHttpServerOptions = { - compression: boolean; - idleTimeout?: number; -}; - -// @alpha (undocumented) -export type IWebSocketComponent = { - createWebSocket(url: string, protocols?: string | string[]): W; -}; - -// @public (undocumented) -export type RoutedContext = IHttpServerComponent.PathAwareContext & { - captures: string[]; - matched?: Layer[]; - routerPath?: string; -}; - -// @public (undocumented) -export type RoutePathSignature = (path: T, ...middlewares: Array>>) => Router; - -// @public -export class Router implements IHttpServerComponent.MethodHandlers { - constructor(opts?: RouterOptions); - all(path: T, middleware: IHttpServerComponent.IRequestHandler>): this; - allowedMethods(options?: AllowedMethodOptions): IHttpServerComponent.IRequestHandler; - // (undocumented) - connect: RoutePathSignature; - // (undocumented) - delete: RoutePathSignature; - // (undocumented) - get: RoutePathSignature; - // (undocumented) - head: RoutePathSignature; - match(path: string, method: string): { - path: Layer[]; - pathAndMethod: Layer[]; - route: boolean; - }; - // (undocumented) - methods: (IHttpServerComponent.HTTPMethod | string)[]; - middleware(): IHttpServerComponent.IRequestHandler; - // (undocumented) - options: RoutePathSignature; - // (undocumented) - opts: RouterOptions; - // (undocumented) - patch: RoutePathSignature; - // (undocumented) - post: RoutePathSignature; - prefix(prefix: string): this; - // (undocumented) - put: RoutePathSignature; - redirect(source: string, destination: string, code?: number): this; - // Warning: (ae-forgotten-export) The symbol "LayerOptions" needs to be exported by the entry point index.d.ts - register(path: Path, methods: ReadonlyArray, middleware: IHttpServerComponent.IRequestHandler, opts?: LayerOptions): Layer; - // (undocumented) - stack: Layer[]; - // (undocumented) - trace: RoutePathSignature; - use(...middlewares: IHttpServerComponent.IRequestHandler>[]): this; - // (undocumented) - use

(route: P, ...middlewares: IHttpServerComponent.IRequestHandler>[]): this; -} - -// @public (undocumented) -export type RouterOptions = Partial<{ - methods: IHttpServerComponent.HTTPMethod[]; - prefix: string; - routerPath: string; - sensitive: boolean; - strict: boolean; -}>; - -// @public (undocumented) -export type ServerComponents = { - config: IConfigComponent; - logs: ILoggerComponent; - ws?: WebSocketServer; -}; - -// @beta (undocumented) -export type StandardStatusResponse = { - status: "pass" | "fail" | "warn"; - version?: string; - releaseId?: string; - notes?: string[]; - output?: string; - serviceId?: string; - description?: string; - details: Record; -}; - -// @beta (undocumented) -export type StandardStatusResponseDetail = { - status: "pass" | "fail" | "warn"; - componentType?: string; - componentId?: string; -}; - -// @alpha (undocumented) -export type TestServerWithWs = { - ws(path: string, protocols: string | string[]): WebSocket; -}; - -// @alpha @deprecated (undocumented) -export interface WebSocketServer { - // (undocumented) - handleUpgrade(request: http.IncomingMessage, socket: Socket, upgradeHead: Buffer, callback: (client: any, request: http.IncomingMessage) => void): void; -} - -// Warnings were encountered during analysis: -// -// src/router.ts:45:3 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts -// src/types.ts:30:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha -// src/types.ts:36:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@well-known-components/http-server" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import * as fetch_2 from 'node-fetch'; +import type * as http from 'http'; +import type * as https from 'https'; +import { IBaseComponent } from '@well-known-components/interfaces'; +import { IConfigComponent } from '@well-known-components/interfaces'; +import { IHttpServerComponent } from '@well-known-components/interfaces'; +import type { ILoggerComponent } from '@well-known-components/interfaces'; +import { IMiddlewareAdapterHandler } from '@well-known-components/interfaces'; +import type { IStatusCheckCapableComponent } from '@well-known-components/interfaces'; +import { Key } from 'path-to-regexp'; +import type { Socket } from 'net'; + +// @public (undocumented) +export type AllowedMethodOptions = Partial<{ + throw: boolean; + notImplemented: NewableFunction; + methodNotAllowed: NewableFunction; +}>; + +// @public +export function createServerComponent(components: ServerComponents, options: Partial): Promise>; + +// @public +export function createStatusCheckComponent(components: { + server: IHttpServerComponent; + config: IConfigComponent; +}): Promise; + +// @public +export function createTestServerComponent(): ITestHttpServerComponent; + +// @public (undocumented) +export type FullHttpServerComponent = IHttpServerComponent & IBaseComponent & IStatusCheckCapableComponent & { + resetMiddlewares(): void; +}; + +// @public (undocumented) +export function getUnderlyingServer(server: IHttpServerComponent): Promise; + +// @public (undocumented) +export type IFetchComponent = { + fetch(url: fetch_2.Request): Promise; + fetch(url: fetch_2.RequestInfo, init?: fetch_2.RequestInit): Promise; +}; + +// @public (undocumented) +export type IHttpServerOptions = { + cors?: CorsOptions; +} & ({ + https: https.ServerOptions; +} | { + http: http.ServerOptions; +}); + +// @public (undocumented) +export type ITestHttpServerComponent = IHttpServerComponent & IFetchComponent & { + resetMiddlewares(): void; +}; + +// @public (undocumented) +export type IUwsHttpServerOptions = { + compression: boolean; + idleTimeout?: number; +}; + +// @alpha (undocumented) +export type IWebSocketComponent = { + createWebSocket(url: string, protocols?: string | string[]): W; +}; + +// @public (undocumented) +export type RoutedContext = IHttpServerComponent.PathAwareContext & { + captures: string[]; + matched?: Layer[]; + routerPath?: string; +}; + +// @public (undocumented) +export type RoutePathSignature = (path: T, ...middlewares: Array>>) => Router; + +// @public +export class Router implements IHttpServerComponent.MethodHandlers { + constructor(opts?: RouterOptions); + all(path: T, middleware: IHttpServerComponent.IRequestHandler>): this; + allowedMethods(options?: AllowedMethodOptions): IHttpServerComponent.IRequestHandler; + // (undocumented) + connect: RoutePathSignature; + // (undocumented) + delete: RoutePathSignature; + // (undocumented) + get: RoutePathSignature; + // (undocumented) + head: RoutePathSignature; + match(path: string, method: string): { + path: Layer[]; + pathAndMethod: Layer[]; + route: boolean; + }; + // (undocumented) + methods: (IHttpServerComponent.HTTPMethod | string)[]; + middleware(): IHttpServerComponent.IRequestHandler; + // (undocumented) + options: RoutePathSignature; + // (undocumented) + opts: RouterOptions; + // (undocumented) + patch: RoutePathSignature; + // (undocumented) + post: RoutePathSignature; + prefix(prefix: string): this; + // (undocumented) + put: RoutePathSignature; + redirect(source: string, destination: string, code?: number): this; + // Warning: (ae-forgotten-export) The symbol "LayerOptions" needs to be exported by the entry point index.d.ts + register(path: Path, methods: ReadonlyArray, middleware: IHttpServerComponent.IRequestHandler, opts?: LayerOptions): Layer; + // (undocumented) + stack: Layer[]; + // (undocumented) + trace: RoutePathSignature; + use(...middlewares: IHttpServerComponent.IRequestHandler>[]): this; + // (undocumented) + use

(route: P, ...middlewares: IHttpServerComponent.IRequestHandler>[]): this; +} + +// @public (undocumented) +export type RouterOptions = Partial<{ + methods: IHttpServerComponent.HTTPMethod[]; + prefix: string; + routerPath: string; + sensitive: boolean; + strict: boolean; +}>; + +// @public (undocumented) +export type ServerComponents = { + config: IConfigComponent; + logs: ILoggerComponent; + ws?: WebSocketServer; +}; + +// @beta (undocumented) +export type StandardStatusResponse = { + status: "pass" | "fail" | "warn"; + version?: string; + releaseId?: string; + notes?: string[]; + output?: string; + serviceId?: string; + description?: string; + details: Record; +}; + +// @beta (undocumented) +export type StandardStatusResponseDetail = { + status: "pass" | "fail" | "warn"; + componentType?: string; + componentId?: string; +}; + +// @alpha (undocumented) +export type TestServerWithWs = { + ws(path: string, protocols: string | string[]): WebSocket; +}; + +// @alpha @deprecated (undocumented) +export interface WebSocketServer { + // (undocumented) + handleUpgrade(request: http.IncomingMessage, socket: Socket, upgradeHead: Buffer, callback: (client: any, request: http.IncomingMessage) => void): void; +} + +// Warnings were encountered during analysis: +// +// src/router.ts:45:3 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts +// src/types.ts:30:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha +// src/types.ts:36:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` From 38b9def42e3a5dc0b3b608b669ed0adfa0d5fd02 Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 4 Oct 2023 15:33:39 -0300 Subject: [PATCH 3/4] x --- etc/http-server.api.md | 374 ++++++++++++++++++++--------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/etc/http-server.api.md b/etc/http-server.api.md index ad173b0..08a5789 100644 --- a/etc/http-server.api.md +++ b/etc/http-server.api.md @@ -1,187 +1,187 @@ -## API Report File for "@well-known-components/http-server" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -/// - -import * as fetch_2 from 'node-fetch'; -import type * as http from 'http'; -import type * as https from 'https'; -import { IBaseComponent } from '@well-known-components/interfaces'; -import { IConfigComponent } from '@well-known-components/interfaces'; -import { IHttpServerComponent } from '@well-known-components/interfaces'; -import type { ILoggerComponent } from '@well-known-components/interfaces'; -import { IMiddlewareAdapterHandler } from '@well-known-components/interfaces'; -import type { IStatusCheckCapableComponent } from '@well-known-components/interfaces'; -import { Key } from 'path-to-regexp'; -import type { Socket } from 'net'; - -// @public (undocumented) -export type AllowedMethodOptions = Partial<{ - throw: boolean; - notImplemented: NewableFunction; - methodNotAllowed: NewableFunction; -}>; - -// @public -export function createServerComponent(components: ServerComponents, options: Partial): Promise>; - -// @public -export function createStatusCheckComponent(components: { - server: IHttpServerComponent; - config: IConfigComponent; -}): Promise; - -// @public -export function createTestServerComponent(): ITestHttpServerComponent; - -// @public (undocumented) -export type FullHttpServerComponent = IHttpServerComponent & IBaseComponent & IStatusCheckCapableComponent & { - resetMiddlewares(): void; -}; - -// @public (undocumented) -export function getUnderlyingServer(server: IHttpServerComponent): Promise; - -// @public (undocumented) -export type IFetchComponent = { - fetch(url: fetch_2.Request): Promise; - fetch(url: fetch_2.RequestInfo, init?: fetch_2.RequestInit): Promise; -}; - -// @public (undocumented) -export type IHttpServerOptions = { - cors?: CorsOptions; -} & ({ - https: https.ServerOptions; -} | { - http: http.ServerOptions; -}); - -// @public (undocumented) -export type ITestHttpServerComponent = IHttpServerComponent & IFetchComponent & { - resetMiddlewares(): void; -}; - -// @public (undocumented) -export type IUwsHttpServerOptions = { - compression: boolean; - idleTimeout?: number; -}; - -// @alpha (undocumented) -export type IWebSocketComponent = { - createWebSocket(url: string, protocols?: string | string[]): W; -}; - -// @public (undocumented) -export type RoutedContext = IHttpServerComponent.PathAwareContext & { - captures: string[]; - matched?: Layer[]; - routerPath?: string; -}; - -// @public (undocumented) -export type RoutePathSignature = (path: T, ...middlewares: Array>>) => Router; - -// @public -export class Router implements IHttpServerComponent.MethodHandlers { - constructor(opts?: RouterOptions); - all(path: T, middleware: IHttpServerComponent.IRequestHandler>): this; - allowedMethods(options?: AllowedMethodOptions): IHttpServerComponent.IRequestHandler; - // (undocumented) - connect: RoutePathSignature; - // (undocumented) - delete: RoutePathSignature; - // (undocumented) - get: RoutePathSignature; - // (undocumented) - head: RoutePathSignature; - match(path: string, method: string): { - path: Layer[]; - pathAndMethod: Layer[]; - route: boolean; - }; - // (undocumented) - methods: (IHttpServerComponent.HTTPMethod | string)[]; - middleware(): IHttpServerComponent.IRequestHandler; - // (undocumented) - options: RoutePathSignature; - // (undocumented) - opts: RouterOptions; - // (undocumented) - patch: RoutePathSignature; - // (undocumented) - post: RoutePathSignature; - prefix(prefix: string): this; - // (undocumented) - put: RoutePathSignature; - redirect(source: string, destination: string, code?: number): this; - // Warning: (ae-forgotten-export) The symbol "LayerOptions" needs to be exported by the entry point index.d.ts - register(path: Path, methods: ReadonlyArray, middleware: IHttpServerComponent.IRequestHandler, opts?: LayerOptions): Layer; - // (undocumented) - stack: Layer[]; - // (undocumented) - trace: RoutePathSignature; - use(...middlewares: IHttpServerComponent.IRequestHandler>[]): this; - // (undocumented) - use

(route: P, ...middlewares: IHttpServerComponent.IRequestHandler>[]): this; -} - -// @public (undocumented) -export type RouterOptions = Partial<{ - methods: IHttpServerComponent.HTTPMethod[]; - prefix: string; - routerPath: string; - sensitive: boolean; - strict: boolean; -}>; - -// @public (undocumented) -export type ServerComponents = { - config: IConfigComponent; - logs: ILoggerComponent; - ws?: WebSocketServer; -}; - -// @beta (undocumented) -export type StandardStatusResponse = { - status: "pass" | "fail" | "warn"; - version?: string; - releaseId?: string; - notes?: string[]; - output?: string; - serviceId?: string; - description?: string; - details: Record; -}; - -// @beta (undocumented) -export type StandardStatusResponseDetail = { - status: "pass" | "fail" | "warn"; - componentType?: string; - componentId?: string; -}; - -// @alpha (undocumented) -export type TestServerWithWs = { - ws(path: string, protocols: string | string[]): WebSocket; -}; - -// @alpha @deprecated (undocumented) -export interface WebSocketServer { - // (undocumented) - handleUpgrade(request: http.IncomingMessage, socket: Socket, upgradeHead: Buffer, callback: (client: any, request: http.IncomingMessage) => void): void; -} - -// Warnings were encountered during analysis: -// -// src/router.ts:45:3 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts -// src/types.ts:30:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha -// src/types.ts:36:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@well-known-components/http-server" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import * as fetch_2 from 'node-fetch'; +import type * as http from 'http'; +import type * as https from 'https'; +import { IBaseComponent } from '@well-known-components/interfaces'; +import { IConfigComponent } from '@well-known-components/interfaces'; +import { IHttpServerComponent } from '@well-known-components/interfaces'; +import type { ILoggerComponent } from '@well-known-components/interfaces'; +import { IMiddlewareAdapterHandler } from '@well-known-components/interfaces'; +import type { IStatusCheckCapableComponent } from '@well-known-components/interfaces'; +import { Key } from 'path-to-regexp'; +import type { Socket } from 'net'; + +// @public (undocumented) +export type AllowedMethodOptions = Partial<{ + throw: boolean; + notImplemented: NewableFunction; + methodNotAllowed: NewableFunction; +}>; + +// @public +export function createServerComponent(components: ServerComponents, options: Partial): Promise>; + +// @public +export function createStatusCheckComponent(components: { + server: IHttpServerComponent; + config: IConfigComponent; +}): Promise; + +// @public +export function createTestServerComponent(): ITestHttpServerComponent; + +// @public (undocumented) +export type FullHttpServerComponent = IHttpServerComponent & IBaseComponent & IStatusCheckCapableComponent & { + resetMiddlewares(): void; +}; + +// @public (undocumented) +export function getUnderlyingServer(server: IHttpServerComponent): Promise; + +// @public (undocumented) +export type IFetchComponent = { + fetch(url: fetch_2.Request): Promise; + fetch(url: fetch_2.RequestInfo, init?: fetch_2.RequestInit): Promise; +}; + +// @public (undocumented) +export type IHttpServerOptions = { + cors?: CorsOptions; +} & ({ + https: https.ServerOptions; +} | { + http: http.ServerOptions; +}); + +// @public (undocumented) +export type ITestHttpServerComponent = IHttpServerComponent & IFetchComponent & { + resetMiddlewares(): void; +}; + +// @public (undocumented) +export type IUwsHttpServerOptions = { + compression: boolean; + idleTimeout?: number; +}; + +// @alpha (undocumented) +export type IWebSocketComponent = { + createWebSocket(url: string, protocols?: string | string[]): W; +}; + +// @public (undocumented) +export type RoutedContext = IHttpServerComponent.PathAwareContext & { + captures: string[]; + matched?: Layer[]; + routerPath?: string; +}; + +// @public (undocumented) +export type RoutePathSignature = (path: T, ...middlewares: Array>>) => Router; + +// @public +export class Router implements IHttpServerComponent.MethodHandlers { + constructor(opts?: RouterOptions); + all(path: T, middleware: IHttpServerComponent.IRequestHandler>): this; + allowedMethods(options?: AllowedMethodOptions): IHttpServerComponent.IRequestHandler; + // (undocumented) + connect: RoutePathSignature; + // (undocumented) + delete: RoutePathSignature; + // (undocumented) + get: RoutePathSignature; + // (undocumented) + head: RoutePathSignature; + match(path: string, method: string): { + path: Layer[]; + pathAndMethod: Layer[]; + route: boolean; + }; + // (undocumented) + methods: (IHttpServerComponent.HTTPMethod | string)[]; + middleware(): IHttpServerComponent.IRequestHandler; + // (undocumented) + options: RoutePathSignature; + // (undocumented) + opts: RouterOptions; + // (undocumented) + patch: RoutePathSignature; + // (undocumented) + post: RoutePathSignature; + prefix(prefix: string): this; + // (undocumented) + put: RoutePathSignature; + redirect(source: string, destination: string, code?: number): this; + // Warning: (ae-forgotten-export) The symbol "LayerOptions" needs to be exported by the entry point index.d.ts + register(path: Path, methods: ReadonlyArray, middleware: IHttpServerComponent.IRequestHandler, opts?: LayerOptions): Layer; + // (undocumented) + stack: Layer[]; + // (undocumented) + trace: RoutePathSignature; + use(...middlewares: IHttpServerComponent.IRequestHandler>[]): this; + // (undocumented) + use

(route: P, ...middlewares: IHttpServerComponent.IRequestHandler>[]): this; +} + +// @public (undocumented) +export type RouterOptions = Partial<{ + methods: IHttpServerComponent.HTTPMethod[]; + prefix: string; + routerPath: string; + sensitive: boolean; + strict: boolean; +}>; + +// @public (undocumented) +export type ServerComponents = { + config: IConfigComponent; + logs: ILoggerComponent; + ws?: WebSocketServer; +}; + +// @beta (undocumented) +export type StandardStatusResponse = { + status: "pass" | "fail" | "warn"; + version?: string; + releaseId?: string; + notes?: string[]; + output?: string; + serviceId?: string; + description?: string; + details: Record; +}; + +// @beta (undocumented) +export type StandardStatusResponseDetail = { + status: "pass" | "fail" | "warn"; + componentType?: string; + componentId?: string; +}; + +// @alpha (undocumented) +export type TestServerWithWs = { + ws(path: string, protocols: string | string[]): WebSocket; +}; + +// @alpha @deprecated (undocumented) +export interface WebSocketServer { + // (undocumented) + handleUpgrade(request: http.IncomingMessage, socket: Socket, upgradeHead: Buffer, callback: (client: any, request: http.IncomingMessage) => void): void; +} + +// Warnings were encountered during analysis: +// +// src/router.ts:45:3 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts +// src/types.ts:30:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha +// src/types.ts:36:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` From fb522e6522788a14a6addc592fd8ea2aec6efb8e Mon Sep 17 00:00:00 2001 From: menduz Date: Wed, 4 Oct 2023 18:42:21 +0000 Subject: [PATCH 4/4] update md --- etc/http-server.api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/http-server.api.md b/etc/http-server.api.md index 08a5789..bda9227 100644 --- a/etc/http-server.api.md +++ b/etc/http-server.api.md @@ -178,9 +178,9 @@ export interface WebSocketServer { // Warnings were encountered during analysis: // -// src/router.ts:45:3 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts -// src/types.ts:30:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha -// src/types.ts:36:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts +// dist/router.d.ts:20:5 - (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts +// dist/types.d.ts:23:5 - (ae-incompatible-release-tags) The symbol "ws" is marked as @public, but its signature references "WebSocketServer" which is marked as @alpha +// dist/types.d.ts:29:5 - (ae-forgotten-export) The symbol "CorsOptions" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package)