@3sixty/api-server-hono 0.0.0-stage → 0.20.0-next.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honoWebServer.js","sources":["../../src/honoWebServer.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,YAAY,IAAI,eAAe,EAA4B,MAAM,UAAU,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACN,aAAa,EACb,eAAe,EAWf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAe,EAAE,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAsC,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAmC,MAAM,WAAW,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAgB;IAClD;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,eAAe,CAAC;IAE5D;;;OAGG;IACK,MAAM,CAAU,iBAAiB,GAAW,IAAI,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C,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;gBAC9B,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC5B,OAAO,EAAE,CAAC;YACX,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACK,KAAK,CAAC,iBAAiB,CAAC,YAAoB,EAAE,MAAmB;QACxE,MAAM,YAAY,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1E,YAAY,CAAC,iBAAiB,EAAE,CAAC;QACjC,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;QAC3B,MAAM,YAAY,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,WAAW,CAAC,MAA8B;QACvD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nimport { lookup } from \"node:dns/promises\";\nimport { once } from \"node:events\";\nimport { createSecureServer as createSecureHttp2Server } from \"node:http2\";\nimport { createServer as createHttpsServer } from \"node:https\";\nimport { createServer as createNetServer, type Server as NetServer } from \"node:net\";\nimport type { Server as TlsServer } from \"node:tls\";\nimport { BaseServer } from \"@3sixty/api-core-server\";\nimport {\n\tHttpBodyLimit,\n\tHttpErrorHelper,\n\ttype IHttpRequest,\n\ttype IHttpRequestQuery,\n\ttype IHttpResponse,\n\ttype IMimeTypeProcessor,\n\ttype IRestRoute,\n\ttype IRestRouteProcessor,\n\ttype ISocketRoute,\n\ttype ISocketRouteProcessor,\n\ttype ISocketServerRequest,\n\ttype IWebServerOptions\n} from \"@3sixty/api-models\";\nimport type { IContextIds } from \"@3sixty/context\";\nimport { BaseError, Converter, GeneralError, type IError, Is, StringHelper } from \"@3sixty/core\";\n\nimport { HeaderTypes, HttpMethod, HttpStatusCode, type IHttpHeaders, MimeTypes } from \"@3sixty/web\";\nimport { createAdaptorServer, type HttpBindings, type ServerType } from \"@hono/node-server\";\nimport { type Context, Hono } from \"hono\";\nimport { compress } from \"hono/compress\";\nimport { HTTPException } from \"hono/http-exception\";\nimport { Server, type ServerOptions, type Socket } from \"socket.io\";\nimport type { IHonoWebServerConfig } from \"./models/IHonoWebServerConfig.js\";\nimport type { IHonoWebServerConstructorOptions } from \"./models/IHonoWebServerConstructorOptions.js\";\n\n/**\n * Implementation of the web server using Hono.\n */\nexport class HonoWebServer extends BaseServer<Hono> {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"HonoWebServer\";\n\n\t/**\n\t * The maximum length of a path param, matching the Fastify server.\n\t * @internal\n\t */\n\tprivate static readonly _MAX_PARAM_LENGTH: number = 2000;\n\n\t/**\n\t * The Hono application.\n\t * @internal\n\t */\n\tprivate readonly _app: Hono;\n\n\t/**\n\t * The options for the node web server.\n\t * @internal\n\t */\n\tprivate readonly _webConfig: IHonoWebServerConfig[\"web\"];\n\n\t/**\n\t * The options for the socket server.\n\t * @internal\n\t */\n\tprivate readonly _socketConfig: Partial<ServerOptions>;\n\n\t/**\n\t * The mime type processors keyed by the media type they handle.\n\t * @internal\n\t */\n\tprivate readonly _mimeTypeProcessorMap: { [mediaType: string]: IMimeTypeProcessor };\n\n\t/**\n\t * The node server the application is served on, available once listening.\n\t * @internal\n\t */\n\tprivate _server?: ServerType;\n\n\t/**\n\t * Listeners for additional bound addresses, which forward connections to the main server.\n\t * @internal\n\t */\n\tprivate _additionalServers: NetServer[];\n\n\t/**\n\t * The socket server, available once built with socket routes.\n\t * @internal\n\t */\n\tprivate _socketServer?: Server;\n\n\t/**\n\t * Create a new instance of HonoWebServer.\n\t * @param options The options for the server.\n\t */\n\tconstructor(options?: IHonoWebServerConstructorOptions) {\n\t\tsuper({\n\t\t\tloggingComponentType: options?.loggingComponentType,\n\t\t\tmimeTypeProcessors: options?.mimeTypeProcessors,\n\t\t\tincludeErrorStack: options?.config?.includeErrorStack\n\t\t});\n\n\t\tthis._app = new Hono();\n\t\tthis._webConfig = options?.config?.web;\n\t\tthis._socketConfig = {\n\t\t\tpath: \"/socket\",\n\t\t\t...options?.config?.socket\n\t\t};\n\t\tthis._mimeTypeProcessorMap = {};\n\t\tthis._additionalServers = [];\n\t}\n\n\t/**\n\t * Compare two route paths, ordering a static segment before a param in the same position.\n\t * @param a The first route path.\n\t * @param b The second route path.\n\t * @returns Negative if a should be registered first, positive if b should, otherwise zero.\n\t * @internal\n\t */\n\tprivate static compareRouteSpecificity(a: string, b: string): number {\n\t\tconst aSegments = StringHelper.trimLeadingSlashes(a).split(\"/\");\n\t\tconst bSegments = StringHelper.trimLeadingSlashes(b).split(\"/\");\n\t\tconst length = Math.min(aSegments.length, bSegments.length);\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tconst aIsParam = aSegments[i].startsWith(\":\");\n\t\t\tconst bIsParam = bSegments[i].startsWith(\":\");\n\t\t\tif (aIsParam !== bIsParam) {\n\t\t\t\treturn aIsParam ? 1 : -1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn HonoWebServer.CLASS_NAME;\n\t}\n\n\t/**\n\t * Get the web server instance.\n\t * @returns The web server instance.\n\t */\n\tpublic getInstance(): Hono {\n\t\treturn this._app;\n\t}\n\n\t/**\n\t * Build the server.\n\t * @param restRouteProcessors The processors for incoming requests over REST.\n\t * @param restRoutes The REST routes.\n\t * @param socketRouteProcessors The processors for incoming requests over Sockets.\n\t * @param socketRoutes The socket routes.\n\t * @param options Options for building the server.\n\t * @returns A promise that resolves when the server is fully built and ready to start.\n\t */\n\tpublic async build(\n\t\trestRouteProcessors?: IRestRouteProcessor[],\n\t\trestRoutes?: IRestRoute[],\n\t\tsocketRouteProcessors?: ISocketRouteProcessor[],\n\t\tsocketRoutes?: ISocketRoute[],\n\t\toptions?: IWebServerOptions\n\t): Promise<void> {\n\t\tawait this.prepareBuild(\n\t\t\trestRouteProcessors,\n\t\t\trestRoutes,\n\t\t\tsocketRouteProcessors,\n\t\t\tsocketRoutes,\n\t\t\toptions\n\t\t);\n\n\t\t// Only run the compression middleware when the client accepts an encoding, as it\n\t\t// reads the request and response headers through the slower fetch API\n\t\tconst compressMiddleware = compress();\n\t\tthis._app.use(async (c, next) => {\n\t\t\tif (Is.stringValue(this.getRequestHeaders(c)[\"accept-encoding\"])) {\n\t\t\t\tawait compressMiddleware(c, next);\n\t\t\t} else {\n\t\t\t\tawait next();\n\t\t\t}\n\t\t});\n\n\t\tif (Is.arrayValue(socketRoutes)) {\n\t\t\tthis._socketServer = new Server(this._socketConfig);\n\t\t}\n\n\t\t// Processors supplied first take precedence for a media type\n\t\tfor (const mimeTypeProcessor of [...this._mimeTypeProcessors].reverse()) {\n\t\t\tfor (const mediaType of mimeTypeProcessor.getTypes()) {\n\t\t\t\tthis._mimeTypeProcessorMap[mediaType.toLowerCase()] = mimeTypeProcessor;\n\t\t\t}\n\t\t}\n\n\t\tthis.initCors(options);\n\n\t\tconst bodyLimits = this.resolveBodyLimits();\n\n\t\tthis._app.notFound(async c => this.handleRequestRest(c, bodyLimits[HttpBodyLimit.Default]));\n\n\t\tthis._app.onError(async (error, c) => {\n\t\t\t// HTTP exceptions are raised by the transport, everything else is from our framework\n\t\t\tlet httpStatusCode: HttpStatusCode;\n\t\t\tlet err: IError;\n\t\t\tconst httpException = error as Partial<HTTPException>;\n\t\t\tif (Is.integer(httpException.status) && Is.function(httpException.getResponse)) {\n\t\t\t\terr = BaseError.fromError(httpException.cause).toJsonObject();\n\t\t\t\thttpStatusCode = httpException.status as HttpStatusCode;\n\t\t\t} else {\n\t\t\t\tconst errorAndCode = HttpErrorHelper.processError(error);\n\t\t\t\terr = errorAndCode.error;\n\t\t\t\thttpStatusCode = errorAndCode.httpStatusCode;\n\t\t\t}\n\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"error\",\n\t\t\t\tts: Date.now(),\n\t\t\t\tsource: HonoWebServer.CLASS_NAME,\n\t\t\t\tmessage: \"badRequest\",\n\t\t\t\terror: err\n\t\t\t});\n\n\t\t\tif (httpStatusCode === HttpStatusCode.payloadTooLarge) {\n\t\t\t\t// The unread body would otherwise hold the connection open, so close it like Fastify\n\t\t\t\tc.header(\"connection\", \"close\");\n\t\t\t}\n\n\t\t\treturn c.json({ error: err }, httpStatusCode as 400);\n\t\t});\n\n\t\tawait this.addRoutesRest(bodyLimits, restRouteProcessors, restRoutes);\n\t\tawait this.addRoutesSocket(socketRouteProcessors, socketRoutes);\n\t}\n\n\t/**\n\t * Start listening for connections on the transport.\n\t * @param host The host to bind to.\n\t * @param port The port to bind to.\n\t * @returns A promise that resolves when the transport is listening.\n\t */\n\tprotected async serverListen(host: string, port: number): Promise<void> {\n\t\t// The config omits the options the server controls, which flattens the server type union\n\t\tconst server = createAdaptorServer({\n\t\t\t...this._webConfig,\n\t\t\tfetch: this._app.fetch\n\t\t} as Parameters<typeof createAdaptorServer>[0]);\n\t\tthis._socketServer?.attach(server);\n\n\t\t// Like Fastify, bind every address localhost resolves to, so both IPv4 and IPv6 clients connect\n\t\tconst hosts =\n\t\t\thost === \"localhost\"\n\t\t\t\t? [...new Set((await lookup(host, { all: true })).map(a => a.address))]\n\t\t\t\t: [host];\n\n\t\tawait this.listenOn(server, hosts[0], port);\n\t\tthis._server = server;\n\n\t\tfor (const additionalHost of hosts.slice(1)) {\n\t\t\tconst additionalServer = createNetServer(socket => server.emit(\"connection\", socket));\n\t\t\ttry {\n\t\t\t\tawait this.listenOn(additionalServer, additionalHost, port);\n\t\t\t\tthis._additionalServers.push(additionalServer);\n\t\t\t} catch (err) {\n\t\t\t\t// Like Fastify, an additional address failing to bind does not stop the server\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tsource: HonoWebServer.CLASS_NAME,\n\t\t\t\t\tmessage: \"additionalBindingFailed\",\n\t\t\t\t\tdata: { host: additionalHost, port },\n\t\t\t\t\terror: BaseError.fromError(err)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Close the transport and all of its connections.\n\t * @returns A promise that resolves when the transport has closed.\n\t */\n\tprotected async serverClose(): Promise<void> {\n\t\tconst server = this._server;\n\t\tconst additionalServers = this._additionalServers;\n\t\tthis._server = undefined;\n\t\tthis._additionalServers = [];\n\n\t\t// The forwarded connections are only released when the main server closes its idle\n\t\t// connections, so all the servers must be closed together\n\t\tconst closing: Promise<void>[] = additionalServers.map(async s => this.closeServer(s));\n\n\t\tif (!Is.empty(this._socketServer)) {\n\t\t\tclosing.push(this.closeSocketServer(this._socketServer, server));\n\t\t} else if (!Is.empty(server)) {\n\t\t\tclosing.push(this.closeServer(server));\n\t\t}\n\n\t\tawait Promise.all(closing);\n\t}\n\n\t/**\n\t * Get the addresses the transport is bound to.\n\t * @returns The bound addresses.\n\t */\n\tprotected serverAddresses(): { address: string; family?: string; port: number }[] {\n\t\tconst addresses: { address: string; family?: string; port: number }[] = [];\n\t\tfor (const server of [this._server, ...this._additionalServers]) {\n\t\t\tconst address = server?.address();\n\t\t\tif (Is.object<{ address: string; family: string; port: number }>(address)) {\n\t\t\t\taddresses.push({ address: address.address, family: address.family, port: address.port });\n\t\t\t}\n\t\t}\n\t\treturn addresses;\n\t}\n\n\t/**\n\t * Whether the transport is serving over TLS.\n\t * @returns True if the transport is secure.\n\t */\n\tprotected serverIsSecure(): boolean {\n\t\tif (!Is.empty(this._server)) {\n\t\t\treturn Is.function((this._server as Partial<TlsServer>).setSecureContext);\n\t\t}\n\t\t// Before listening the server factory determines whether it will be secure\n\t\tconst createServer: unknown = this._webConfig?.createServer;\n\t\treturn createServer === createHttpsServer || createServer === createSecureHttp2Server;\n\t}\n\n\t/**\n\t * Whether the transport is currently listening for connections.\n\t * @returns True if the transport is listening.\n\t */\n\tprotected serverIsListening(): boolean {\n\t\treturn this._server?.listening ?? false;\n\t}\n\n\t/**\n\t * Whether a GET route is registered for the root path.\n\t * @returns True if the root route is registered.\n\t */\n\tprotected serverHasRootRoute(): boolean {\n\t\treturn this._app.routes.some(route => route.method === HttpMethod.GET && route.path === \"/\");\n\t}\n\n\t/**\n\t * Add the REST routes to the server.\n\t * @param bodyLimits The named body limits in bytes.\n\t * @param restRouteProcessors The processors for the incoming requests.\n\t * @param restRoutes The REST routes to add.\n\t * @internal\n\t */\n\tprivate async addRoutesRest(\n\t\tbodyLimits: { [name: string]: number },\n\t\trestRouteProcessors?: IRestRouteProcessor[],\n\t\trestRoutes?: IRestRoute[]\n\t): Promise<void> {\n\t\tif (Is.arrayValue(restRouteProcessors) && Is.arrayValue(restRoutes)) {\n\t\t\t// Hono matches overlapping routes in registration order, so register the routes with a\n\t\t\t// static segment before those with a param in the same position, as find-my-way does\n\t\t\tconst sortedRoutes = [...restRoutes].sort((a, b) =>\n\t\t\t\tHonoWebServer.compareRouteSpecificity(a.path, b.path)\n\t\t\t);\n\t\t\tfor (const restRoute of sortedRoutes) {\n\t\t\t\tlet path = StringHelper.trimTrailingSlashes(restRoute.path);\n\t\t\t\tif (!path.startsWith(\"/\")) {\n\t\t\t\t\tpath = `/${path}`;\n\t\t\t\t}\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tsource: HonoWebServer.CLASS_NAME,\n\t\t\t\t\tmessage: \"restRouteAdded\",\n\t\t\t\t\tdata: { route: path, method: restRoute.method }\n\t\t\t\t});\n\n\t\t\t\tconst bodyLimitKey = Is.stringValue(restRoute.bodyLimit)\n\t\t\t\t\t? restRoute.bodyLimit\n\t\t\t\t\t: HttpBodyLimit.Default;\n\t\t\t\tconst bodyLimit = bodyLimits[bodyLimitKey];\n\t\t\t\tif (Is.empty(bodyLimit)) {\n\t\t\t\t\tthrow new GeneralError(HonoWebServer.CLASS_NAME, \"unknownBodyLimit\", {\n\t\t\t\t\t\troute: path,\n\t\t\t\t\t\tbodyLimit: bodyLimitKey\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Like find-my-way, a param can match an empty segment\n\t\t\t\tconst honoPath = path.replace(/:(\\w+)/g, \":$1{[^/]*}\");\n\t\t\t\tthis._app.on(restRoute.method, honoPath, async c =>\n\t\t\t\t\tthis.handleRequestRest(c, bodyLimit, restRoute)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Add the socket routes to the server.\n\t * @param socketRouteProcessors The processors for the incoming requests.\n\t * @param socketRoutes The socket routes to add.\n\t * @internal\n\t */\n\tprivate async addRoutesSocket(\n\t\tsocketRouteProcessors?: ISocketRouteProcessor[],\n\t\tsocketRoutes?: ISocketRoute[]\n\t): Promise<void> {\n\t\tconst io = this._socketServer;\n\t\tif (Is.arrayValue(socketRouteProcessors) && Is.arrayValue(socketRoutes) && !Is.empty(io)) {\n\t\t\tfor (const socketRoute of socketRoutes) {\n\t\t\t\tconst path = StringHelper.trimLeadingSlashes(\n\t\t\t\t\tStringHelper.trimTrailingSlashes(socketRoute.path)\n\t\t\t\t);\n\t\t\t\tconst pathParts = path.split(\"/\");\n\n\t\t\t\tconst namespace = `/${pathParts[0]}`;\n\t\t\t\tconst topic = pathParts.slice(1).join(\"/\");\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tsource: HonoWebServer.CLASS_NAME,\n\t\t\t\t\tmessage: \"socketRouteAdded\",\n\t\t\t\t\tdata: {\n\t\t\t\t\t\thandshakePath: this._socketConfig.path,\n\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\teventName: topic\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tconst socketNamespace = io.of(namespace);\n\n\t\t\t\tsocketNamespace.on(\"connection\", async socket => {\n\t\t\t\t\tconst socketServerRequest: ISocketServerRequest = {\n\t\t\t\t\t\tmethod: HttpMethod.GET,\n\t\t\t\t\t\turl: socket.handshake.url,\n\t\t\t\t\t\tquery: socket.handshake.query as IHttpRequestQuery,\n\t\t\t\t\t\theaders: socket.handshake.headers as IHttpHeaders,\n\t\t\t\t\t\tsocketId: socket.id\n\t\t\t\t\t};\n\n\t\t\t\t\t// Pass the connected information on to any processors\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (const connected of this._socketChains.connected) {\n\t\t\t\t\t\t\tawait connected(socketServerRequest, socketRoute, this._loggingComponentType);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconst { error, httpStatusCode } = HttpErrorHelper.processError(\n\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\tthis._includeErrorStack\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst response: IHttpResponse = {};\n\t\t\t\t\t\tHttpErrorHelper.buildResponse(response, error, httpStatusCode, this._includeErrorStack);\n\t\t\t\t\t\tsocket.emit(topic, response);\n\t\t\t\t\t}\n\n\t\t\t\t\tsocket.on(\"disconnect\", async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// The socket disconnected so notify any processors\n\t\t\t\t\t\t\tfor (const disconnected of this._socketChains.disconnected) {\n\t\t\t\t\t\t\t\tawait disconnected(socketServerRequest, socketRoute, this._loggingComponentType);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// If something fails on a disconnect there is not much we can do with it\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// Handle any incoming messages\n\t\t\t\t\tsocket.on(topic, async data => {\n\t\t\t\t\t\t// The listener is async, so anything escaping it would surface as an unhandled\n\t\t\t\t\t\t// rejection and terminate the process, emit it on the topic instead\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait this.handleRequestSocket(\n\t\t\t\t\t\t\t\tsocketRoute,\n\t\t\t\t\t\t\t\tsocket,\n\t\t\t\t\t\t\t\t`/${pathParts.join(\"/\")}`,\n\t\t\t\t\t\t\t\ttopic,\n\t\t\t\t\t\t\t\tdata\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tconst { error, httpStatusCode } = HttpErrorHelper.processError(\n\t\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\t\tthis._includeErrorStack\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst response: IHttpResponse = {};\n\t\t\t\t\t\t\tHttpErrorHelper.buildResponse(\n\t\t\t\t\t\t\t\tresponse,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\thttpStatusCode,\n\t\t\t\t\t\t\t\tthis._includeErrorStack\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsocket.emit(topic, response);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handle the incoming REST request.\n\t * @param c The Hono context for the request.\n\t * @param bodyLimit The maximum size of the request body in bytes.\n\t * @param restRoute The REST route to handle.\n\t * @returns The response.\n\t * @internal\n\t */\n\tprivate async handleRequestRest(\n\t\tc: Context,\n\t\tbodyLimit: number,\n\t\trestRoute?: IRestRoute\n\t): Promise<Response> {\n\t\tconst url = c.req.url;\n\t\tconst pathStart = url.indexOf(\"/\", url.indexOf(\"//\") + 2);\n\t\tconst requestOrigin = pathStart === -1 ? url : url.slice(0, pathStart);\n\t\tconst headers = this.getRequestHeaders(c);\n\n\t\t// Like Fastify, a path which is not valid percent encoding is rejected, the raw path is\n\t\t// checked as Hono may already have partially decoded its own copy\n\t\tconst queryStart = url.indexOf(\"?\", pathStart);\n\t\tconst path =\n\t\t\tpathStart === -1 ? \"/\" : url.slice(pathStart, queryStart === -1 ? undefined : queryStart);\n\t\tif (path.includes(\"%\")) {\n\t\t\ttry {\n\t\t\t\tdecodeURIComponent(path);\n\t\t\t} catch (err) {\n\t\t\t\tthrow new HTTPException(HttpStatusCode.badRequest, {\n\t\t\t\t\tcause: new GeneralError(HonoWebServer.CLASS_NAME, \"invalidUrl\", { path }, err)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst pathParams = c.req.param();\n\t\tfor (const param of Object.keys(pathParams)) {\n\t\t\tif (pathParams[param].length > HonoWebServer._MAX_PARAM_LENGTH) {\n\t\t\t\tthrow new HTTPException(HttpStatusCode.uriTooLong, {\n\t\t\t\t\tcause: new GeneralError(HonoWebServer.CLASS_NAME, \"paramTooLong\", {\n\t\t\t\t\t\tparam,\n\t\t\t\t\t\tmaxParamLength: HonoWebServer._MAX_PARAM_LENGTH\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst httpServerRequest = this.buildServerRequest(\n\t\t\tc.req.method.toUpperCase() as HttpMethod,\n\t\t\turl,\n\t\t\tawait this.parseBody(c, headers, bodyLimit),\n\t\t\tthis.getRequestQuery(c),\n\t\t\tpathParams,\n\t\t\theaders\n\t\t);\n\n\t\tconst httpResponse: IHttpResponse = {};\n\t\tconst contextIds = this.buildContextIds(requestOrigin, httpServerRequest.headers);\n\t\tconst processorState = {};\n\n\t\tawait this.runProcessorsRest(\n\t\t\trestRoute,\n\t\t\thttpServerRequest,\n\t\t\thttpResponse,\n\t\t\tcontextIds,\n\t\t\tprocessorState\n\t\t);\n\n\t\tthis.validateResponse(httpResponse);\n\t\treturn this.buildResponse(httpResponse);\n\t}\n\n\t/**\n\t * Handle the incoming socket request.\n\t * @param socketRoute The socket route to handle.\n\t * @param socket The socket to handle.\n\t * @param fullPath The full path of the socket route.\n\t * @param emitTopic The topic to emit the response on.\n\t * @param request The incoming request.\n\t * @internal\n\t */\n\tprivate async handleRequestSocket(\n\t\tsocketRoute: ISocketRoute,\n\t\tsocket: Socket,\n\t\tfullPath: string,\n\t\temitTopic: string,\n\t\trequest: IHttpRequest | undefined\n\t): Promise<void> {\n\t\tconst socketServerRequest: ISocketServerRequest = {\n\t\t\tmethod: HttpMethod.GET,\n\t\t\turl: fullPath,\n\t\t\tquery: socket.handshake.query as IHttpRequestQuery,\n\t\t\theaders: socket.handshake.headers as IHttpHeaders,\n\t\t\t// The payload arrives straight off the wire, so it can be missing or any shape\n\t\t\tbody: Is.object(request) ? request.body : undefined,\n\t\t\tsocketId: socket.id\n\t\t};\n\t\tconst httpResponse: IHttpResponse = {};\n\t\tconst contextIds: IContextIds = {};\n\t\tconst processorState = {};\n\n\t\tdelete socketServerRequest.query?.EIO;\n\t\tdelete socketServerRequest.query?.transport;\n\n\t\tawait this.runProcessorsSocket(\n\t\t\tsocketRoute,\n\t\t\tsocketServerRequest,\n\t\t\thttpResponse,\n\t\t\tcontextIds,\n\t\t\tprocessorState,\n\t\t\temitTopic,\n\t\t\tasync (topic, response) => {\n\t\t\t\tsocket.emit(topic, response);\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get the request query, like Fastify a repeated key gives an array of its values.\n\t * @param c The Hono context for the request.\n\t * @returns The request query.\n\t * @internal\n\t */\n\tprivate getRequestQuery(c: Context): IHttpRequestQuery {\n\t\tconst query: { [key: string]: string | string[] } = {};\n\t\tconst queries = c.req.queries();\n\t\tfor (const key of Object.keys(queries)) {\n\t\t\tconst values = queries[key];\n\t\t\tquery[key] = values.length === 1 ? values[0] : values;\n\t\t}\n\t\treturn query as IHttpRequestQuery;\n\t}\n\n\t/**\n\t * Get the request headers, using the headers already parsed by Node when available,\n\t * as building them from the fetch request is comparatively expensive.\n\t * @param c The Hono context for the request.\n\t * @returns The request headers with lower case names.\n\t * @internal\n\t */\n\tprivate getRequestHeaders(c: Context): IHttpHeaders {\n\t\tconst incoming = (c.env as Partial<HttpBindings> | undefined)?.incoming;\n\t\treturn (incoming?.headers ?? c.req.header()) as IHttpHeaders;\n\t}\n\n\t/**\n\t * Read and parse the request body based on its content type.\n\t * @param c The Hono context for the request.\n\t * @param headers The request headers.\n\t * @param bodyLimit The maximum size of the request body in bytes.\n\t * @returns The parsed body, or undefined if there is no body.\n\t * @throws HTTPException If the body is too large, malformed or an unsupported media type.\n\t * @internal\n\t */\n\tprivate async parseBody(c: Context, headers: IHttpHeaders, bodyLimit: number): Promise<unknown> {\n\t\tconst method = c.req.method;\n\t\tif (method === HttpMethod.GET || method === HttpMethod.HEAD) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst contentType = headers[HeaderTypes.ContentType];\n\t\tconst mediaType = (Is.string(contentType) ? contentType : \"\")\n\t\t\t.split(\";\")[0]\n\t\t\t.trim()\n\t\t\t.toLowerCase();\n\n\t\tconst raw = await this.readBody(c, headers, bodyLimit);\n\t\tif (Is.empty(raw)) {\n\t\t\t// Like Fastify, declaring a JSON body without sending one is an error\n\t\t\tif (mediaType === MimeTypes.Json) {\n\t\t\t\tthrow new HTTPException(HttpStatusCode.badRequest, {\n\t\t\t\t\tcause: new GeneralError(HonoWebServer.CLASS_NAME, \"emptyJsonBody\")\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst mimeTypeProcessor = this._mimeTypeProcessorMap[mediaType];\n\t\tif (!Is.empty(mimeTypeProcessor)) {\n\t\t\treturn mimeTypeProcessor.handle(raw);\n\t\t}\n\n\t\tif (mediaType === MimeTypes.Json) {\n\t\t\tconst text = Converter.bytesToUtf8(raw);\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(text);\n\t\t\t} catch (err) {\n\t\t\t\tthrow new HTTPException(HttpStatusCode.badRequest, {\n\t\t\t\t\tcause: new GeneralError(HonoWebServer.CLASS_NAME, \"invalidJsonBody\", undefined, err)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (mediaType === MimeTypes.PlainText) {\n\t\t\treturn Converter.bytesToUtf8(raw);\n\t\t}\n\n\t\tthrow new HTTPException(HttpStatusCode.unsupportedMediaType, {\n\t\t\tcause: new GeneralError(HonoWebServer.CLASS_NAME, \"unsupportedMediaType\", {\n\t\t\t\tcontentType: mediaType\n\t\t\t})\n\t\t});\n\t}\n\n\t/**\n\t * Read the raw request body, enforcing the body limit while streaming.\n\t * @param c The Hono context for the request.\n\t * @param headers The request headers.\n\t * @param bodyLimit The maximum size of the request body in bytes.\n\t * @returns The raw body, or undefined if it is empty.\n\t * @throws HTTPException If the body is larger than the limit.\n\t * @internal\n\t */\n\tprivate async readBody(\n\t\tc: Context,\n\t\theaders: IHttpHeaders,\n\t\tbodyLimit: number\n\t): Promise<Uint8Array | undefined> {\n\t\tconst contentLength = headers[HeaderTypes.ContentLength];\n\t\tif (Is.string(contentLength) && Number.parseInt(contentLength, 10) > bodyLimit) {\n\t\t\tthrow this.createBodyTooLargeError(bodyLimit);\n\t\t}\n\n\t\t// Reading the Node stream directly avoids wrapping it in a web stream\n\t\tconst source: AsyncIterable<Uint8Array> | null =\n\t\t\t(c.env as Partial<HttpBindings> | undefined)?.incoming ?? c.req.raw.body;\n\t\tif (Is.empty(source)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst chunks: Uint8Array[] = [];\n\t\tlet total = 0;\n\t\tfor await (const chunk of source) {\n\t\t\ttotal += chunk.byteLength;\n\t\t\tif (total > bodyLimit) {\n\t\t\t\tthrow this.createBodyTooLargeError(bodyLimit);\n\t\t\t}\n\t\t\tchunks.push(chunk);\n\t\t}\n\n\t\treturn total === 0 ? undefined : Buffer.concat(chunks, total);\n\t}\n\n\t/**\n\t * Create the error for a body which exceeds the limit.\n\t * @param bodyLimit The maximum size of the request body in bytes.\n\t * @returns The error.\n\t * @internal\n\t */\n\tprivate createBodyTooLargeError(bodyLimit: number): HTTPException {\n\t\treturn new HTTPException(HttpStatusCode.payloadTooLarge, {\n\t\t\tcause: new GeneralError(HonoWebServer.CLASS_NAME, \"bodyTooLarge\", { bodyLimit })\n\t\t});\n\t}\n\n\t/**\n\t * Build the transport response from the processed response.\n\t * @param httpResponse The processed response.\n\t * @returns The response.\n\t * @internal\n\t */\n\tprivate buildResponse(httpResponse: IHttpResponse): Response {\n\t\t// A plain header record keeps the response on the node adapter's fast path,\n\t\t// multiple values for a header can only be represented with a Headers instance\n\t\tconst headers: { [name: string]: string } = {};\n\t\tlet multiValueHeaders: Headers | undefined;\n\t\tif (!Is.empty(httpResponse.headers)) {\n\t\t\tfor (const header of Object.keys(httpResponse.headers)) {\n\t\t\t\tconst value = httpResponse.headers[header];\n\t\t\t\tif (Is.array(value)) {\n\t\t\t\t\tmultiValueHeaders ??= new Headers();\n\t\t\t\t\tfor (const item of value) {\n\t\t\t\t\t\tmultiValueHeaders.append(header, item);\n\t\t\t\t\t}\n\t\t\t\t} else if (!Is.empty(value)) {\n\t\t\t\t\theaders[header.toLowerCase()] = String(value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst status = httpResponse.statusCode ?? HttpStatusCode.ok;\n\t\tconst payload: unknown = httpResponse.body;\n\n\t\tif (\n\t\t\tIs.empty(payload) ||\n\t\t\tstatus === HttpStatusCode.noContent ||\n\t\t\tstatus === HttpStatusCode.notModified\n\t\t) {\n\t\t\treturn new Response(null, {\n\t\t\t\tstatus,\n\t\t\t\theaders: this.mergeHeaders(headers, multiValueHeaders)\n\t\t\t});\n\t\t}\n\n\t\tif (Is.function((payload as Partial<ReadableStream>).getReader)) {\n\t\t\theaders[HeaderTypes.ContentType] ??= MimeTypes.OctetStream;\n\t\t\treturn new Response(payload as ReadableStream, {\n\t\t\t\tstatus,\n\t\t\t\theaders: this.mergeHeaders(headers, multiValueHeaders)\n\t\t\t});\n\t\t}\n\n\t\tlet body: Uint8Array;\n\t\tif (Is.uint8Array(payload)) {\n\t\t\tbody = payload;\n\t\t\theaders[HeaderTypes.ContentType] ??= MimeTypes.OctetStream;\n\t\t} else if (Is.string(payload)) {\n\t\t\tbody = Converter.utf8ToBytes(payload);\n\t\t\theaders[HeaderTypes.ContentType] ??= `${MimeTypes.PlainText}; charset=utf-8`;\n\t\t} else {\n\t\t\tbody = Converter.utf8ToBytes(JSON.stringify(payload));\n\t\t\theaders[HeaderTypes.ContentType] ??= `${MimeTypes.Json}; charset=utf-8`;\n\t\t}\n\n\t\t// A known length lets compression skip small bodies and avoids a chunked response\n\t\theaders[HeaderTypes.ContentLength] = body.byteLength.toString();\n\n\t\treturn new Response(body as Uint8Array<ArrayBuffer>, {\n\t\t\tstatus,\n\t\t\theaders: this.mergeHeaders(headers, multiValueHeaders)\n\t\t});\n\t}\n\n\t/**\n\t * Merge the single value headers in to the multiple value headers, if there are any.\n\t * @param headers The single value headers.\n\t * @param multiValueHeaders The multiple value headers.\n\t * @returns The headers to use for the response.\n\t * @internal\n\t */\n\tprivate mergeHeaders(\n\t\theaders: { [name: string]: string },\n\t\tmultiValueHeaders?: Headers\n\t): HeadersInit {\n\t\tif (Is.empty(multiValueHeaders)) {\n\t\t\treturn headers;\n\t\t}\n\t\tfor (const header of Object.keys(headers)) {\n\t\t\tmultiValueHeaders.set(header, headers[header]);\n\t\t}\n\t\treturn multiValueHeaders;\n\t}\n\n\t/**\n\t * Initialize the cors options.\n\t * @param options The web server options.\n\t * @internal\n\t */\n\tprivate initCors(options?: IWebServerOptions): void {\n\t\tconst corsOptions = this.resolveCorsOptions(options);\n\t\tconst allowMethods = corsOptions.methods.join(\", \");\n\t\tconst allowHeaders = corsOptions.allowedHeaders.join(\", \");\n\t\tconst exposeHeaders = corsOptions.exposedHeaders.join(\", \");\n\n\t\t// Mirrors the Fastify CORS plugin, the headers are added after the handler has run\n\t\t// because creating the response headers beforehand forces Hono to rebuild the response\n\t\tthis._app.use(async (c, next) => {\n\t\t\tconst headers = this.getRequestHeaders(c);\n\t\t\tconst origin = headers.origin;\n\t\t\tconst requestOrigin = Is.string(origin) ? origin : undefined;\n\t\t\tconst allowed =\n\t\t\t\tcorsOptions.hasWildcardOrigin ||\n\t\t\t\t(Is.stringValue(requestOrigin) && corsOptions.origins.includes(requestOrigin));\n\n\t\t\tif (allowed && c.req.method === HttpMethod.OPTIONS) {\n\t\t\t\tif (\n\t\t\t\t\t!Is.stringValue(requestOrigin) ||\n\t\t\t\t\t!Is.stringValue(headers[\"access-control-request-method\"])\n\t\t\t\t) {\n\t\t\t\t\treturn c.text(\"Invalid Preflight Request\", HttpStatusCode.badRequest, {\n\t\t\t\t\t\tvary: \"Origin\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn new Response(null, {\n\t\t\t\t\tstatus: HttpStatusCode.noContent,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tvary: \"Origin\",\n\t\t\t\t\t\t\"access-control-allow-origin\": requestOrigin,\n\t\t\t\t\t\t\"access-control-allow-credentials\": \"true\",\n\t\t\t\t\t\t\"access-control-expose-headers\": exposeHeaders,\n\t\t\t\t\t\t\"access-control-allow-methods\": allowMethods,\n\t\t\t\t\t\t\"access-control-allow-headers\": allowHeaders,\n\t\t\t\t\t\t\"content-length\": \"0\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tawait next();\n\n\t\t\tconst responseHeaders = c.res.headers;\n\t\t\tresponseHeaders.append(\"vary\", \"Origin\");\n\t\t\tif (allowed) {\n\t\t\t\tif (Is.stringValue(requestOrigin)) {\n\t\t\t\t\tresponseHeaders.set(\"access-control-allow-origin\", requestOrigin);\n\t\t\t\t}\n\t\t\t\tresponseHeaders.set(\"access-control-allow-credentials\", \"true\");\n\t\t\t\tresponseHeaders.set(\"access-control-expose-headers\", exposeHeaders);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Listen on a host and port.\n\t * @param server The server to listen with.\n\t * @param host The host to bind to.\n\t * @param port The port to bind to.\n\t * @returns A promise that resolves when the server is listening.\n\t * @internal\n\t */\n\tprivate async listenOn(\n\t\tserver: ServerType | NetServer,\n\t\thost: string,\n\t\tport: number\n\t): Promise<void> {\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\tserver.once(\"error\", reject);\n\t\t\tserver.listen(port, host, () => {\n\t\t\t\tserver.off(\"error\", reject);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Close the socket server, which also closes the server it is attached to.\n\t * @param socketServer The socket server to close.\n\t * @param server The server the socket server is attached to.\n\t * @returns A promise that resolves when both servers have closed.\n\t * @internal\n\t */\n\tprivate async closeSocketServer(socketServer: Server, server?: ServerType): Promise<void> {\n\t\tconst serverClosed = Is.empty(server) ? undefined : once(server, \"close\");\n\t\tsocketServer.disconnectSockets();\n\t\tawait socketServer.close();\n\t\tawait serverClosed;\n\t}\n\n\t/**\n\t * Close a server.\n\t * @param server The server to close.\n\t * @returns A promise that resolves when the server has closed.\n\t * @internal\n\t */\n\tprivate async closeServer(server: ServerType | NetServer): Promise<void> {\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\tserver.close(err => (Is.empty(err) ? resolve() : reject(err)));\n\t\t});\n\t}\n}\n"]}
@@ -0,0 +1,6 @@
1
+ // Copyright 2026 3Sixty Trade Ltd.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./honoWebServer.js";
4
+ export * from "./models/IHonoWebServerConfig.js";
5
+ export * from "./models/IHonoWebServerConstructorOptions.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,uCAAuC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8CAA8C,CAAC","sourcesContent":["// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./honoWebServer.js\";\nexport * from \"./models/IHonoWebServerConfig.js\";\nexport * from \"./models/IHonoWebServerConstructorOptions.js\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IHonoWebServerConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHonoWebServerConfig.js","sources":["../../../src/models/IHonoWebServerConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { createAdaptorServer } from \"@hono/node-server\";\nimport type { ServerOptions } from \"socket.io\";\n\n/**\n * The configuration for the Hono web server.\n */\nexport interface IHonoWebServerConfig {\n\t/**\n\t * The node server options, such as the server factory and TLS options.\n\t */\n\tweb?: Omit<\n\t\tParameters<typeof createAdaptorServer>[0],\n\t\t\"fetch\" | \"port\" | \"hostname\" | \"websocket\"\n\t>;\n\n\t/**\n\t * The socket server options.\n\t */\n\tsocket?: Partial<ServerOptions>;\n\n\t/**\n\t * Include the stack with errors.\n\t */\n\tincludeErrorStack?: boolean;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IHonoWebServerConstructorOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHonoWebServerConstructorOptions.js","sources":["../../../src/models/IHonoWebServerConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IMimeTypeProcessor } from \"@3sixty/api-models\";\nimport type { IHonoWebServerConfig } from \"./IHonoWebServerConfig.js\";\n\n/**\n * The options for the Hono web server constructor.\n */\nexport interface IHonoWebServerConstructorOptions {\n\t/**\n\t * The type of the logging component to use, if undefined, no logging will happen.\n\t */\n\tloggingComponentType?: string;\n\n\t/**\n\t * Additional configuration for the server.\n\t */\n\tconfig?: IHonoWebServerConfig;\n\n\t/**\n\t * Additional MIME type processors.\n\t */\n\tmimeTypeProcessors?: IMimeTypeProcessor[];\n}\n"]}
@@ -0,0 +1,74 @@
1
+ import { BaseServer } from "@3sixty/api-core-server";
2
+ import { type IRestRoute, type IRestRouteProcessor, type ISocketRoute, type ISocketRouteProcessor, type IWebServerOptions } from "@3sixty/api-models";
3
+ import { Hono } from "hono";
4
+ import type { IHonoWebServerConstructorOptions } from "./models/IHonoWebServerConstructorOptions.js";
5
+ /**
6
+ * Implementation of the web server using Hono.
7
+ */
8
+ export declare class HonoWebServer extends BaseServer<Hono> {
9
+ /**
10
+ * Runtime name for the class.
11
+ */
12
+ static readonly CLASS_NAME: string;
13
+ /**
14
+ * Create a new instance of HonoWebServer.
15
+ * @param options The options for the server.
16
+ */
17
+ constructor(options?: IHonoWebServerConstructorOptions);
18
+ /**
19
+ * Returns the class name of the component.
20
+ * @returns The class name of the component.
21
+ */
22
+ className(): string;
23
+ /**
24
+ * Get the web server instance.
25
+ * @returns The web server instance.
26
+ */
27
+ getInstance(): Hono;
28
+ /**
29
+ * Build the server.
30
+ * @param restRouteProcessors The processors for incoming requests over REST.
31
+ * @param restRoutes The REST routes.
32
+ * @param socketRouteProcessors The processors for incoming requests over Sockets.
33
+ * @param socketRoutes The socket routes.
34
+ * @param options Options for building the server.
35
+ * @returns A promise that resolves when the server is fully built and ready to start.
36
+ */
37
+ build(restRouteProcessors?: IRestRouteProcessor[], restRoutes?: IRestRoute[], socketRouteProcessors?: ISocketRouteProcessor[], socketRoutes?: ISocketRoute[], options?: IWebServerOptions): Promise<void>;
38
+ /**
39
+ * Start listening for connections on the transport.
40
+ * @param host The host to bind to.
41
+ * @param port The port to bind to.
42
+ * @returns A promise that resolves when the transport is listening.
43
+ */
44
+ protected serverListen(host: string, port: number): Promise<void>;
45
+ /**
46
+ * Close the transport and all of its connections.
47
+ * @returns A promise that resolves when the transport has closed.
48
+ */
49
+ protected serverClose(): Promise<void>;
50
+ /**
51
+ * Get the addresses the transport is bound to.
52
+ * @returns The bound addresses.
53
+ */
54
+ protected serverAddresses(): {
55
+ address: string;
56
+ family?: string;
57
+ port: number;
58
+ }[];
59
+ /**
60
+ * Whether the transport is serving over TLS.
61
+ * @returns True if the transport is secure.
62
+ */
63
+ protected serverIsSecure(): boolean;
64
+ /**
65
+ * Whether the transport is currently listening for connections.
66
+ * @returns True if the transport is listening.
67
+ */
68
+ protected serverIsListening(): boolean;
69
+ /**
70
+ * Whether a GET route is registered for the root path.
71
+ * @returns True if the root route is registered.
72
+ */
73
+ protected serverHasRootRoute(): boolean;
74
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./honoWebServer.js";
2
+ export * from "./models/IHonoWebServerConfig.js";
3
+ export * from "./models/IHonoWebServerConstructorOptions.js";
@@ -0,0 +1,19 @@
1
+ import type { createAdaptorServer } from "@hono/node-server";
2
+ import type { ServerOptions } from "socket.io";
3
+ /**
4
+ * The configuration for the Hono web server.
5
+ */
6
+ export interface IHonoWebServerConfig {
7
+ /**
8
+ * The node server options, such as the server factory and TLS options.
9
+ */
10
+ web?: Omit<Parameters<typeof createAdaptorServer>[0], "fetch" | "port" | "hostname" | "websocket">;
11
+ /**
12
+ * The socket server options.
13
+ */
14
+ socket?: Partial<ServerOptions>;
15
+ /**
16
+ * Include the stack with errors.
17
+ */
18
+ includeErrorStack?: boolean;
19
+ }
@@ -0,0 +1,19 @@
1
+ import type { IMimeTypeProcessor } from "@3sixty/api-models";
2
+ import type { IHonoWebServerConfig } from "./IHonoWebServerConfig.js";
3
+ /**
4
+ * The options for the Hono web server constructor.
5
+ */
6
+ export interface IHonoWebServerConstructorOptions {
7
+ /**
8
+ * The type of the logging component to use, if undefined, no logging will happen.
9
+ */
10
+ loggingComponentType?: string;
11
+ /**
12
+ * Additional configuration for the server.
13
+ */
14
+ config?: IHonoWebServerConfig;
15
+ /**
16
+ * Additional MIME type processors.
17
+ */
18
+ mimeTypeProcessors?: IMimeTypeProcessor[];
19
+ }
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## [0.20.0-next.1](https://github.com/3sixtyglobal/api/compare/api-server-hono-v0.20.0-next.0...api-server-hono-v0.20.0-next.1) (2026-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * authorization ([#51](https://github.com/3sixtyglobal/api/issues/51)) ([023ef94](https://github.com/3sixtyglobal/api/commit/023ef94925114e88522cbe6f703d9b05a202bc6d))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @3sixty/api-core-server bumped from 0.20.0-next.0 to 0.20.0-next.1
16
+ * @3sixty/api-models bumped from 0.20.0-next.0 to 0.20.0-next.1
17
+ * devDependencies
18
+ * @3sixty/api-processors bumped from 0.20.0-next.0 to 0.20.0-next.1
@@ -0,0 +1,61 @@
1
+ # Server Hono Examples
2
+
3
+ Use these snippets to build and run the Hono server with explicit lifecycle control in scripts and integration tests.
4
+
5
+ ## HonoWebServer
6
+
7
+ ```typescript
8
+ import { HonoWebServer } from '@3sixty/api-server-hono';
9
+
10
+ const webServer = new HonoWebServer();
11
+
12
+ await webServer.build(undefined, undefined, undefined, undefined, {
13
+ port: 8080,
14
+ host: '0.0.0.0'
15
+ });
16
+
17
+ await webServer.start();
18
+ const app = webServer.getInstance();
19
+
20
+ console.log(app.routes.length >= 0); // true
21
+
22
+ await webServer.stop();
23
+ ```
24
+
25
+ ```typescript
26
+ import { RestRouteProcessor, SocketRouteProcessor } from '@3sixty/api-processors';
27
+ import { HonoWebServer } from '@3sixty/api-server-hono';
28
+ import { HttpMethod } from '@3sixty/web';
29
+
30
+ const webServer = new HonoWebServer({
31
+ config: { socket: { path: '/socket' } }
32
+ });
33
+
34
+ await webServer.build(
35
+ [new RestRouteProcessor()],
36
+ [
37
+ {
38
+ operationId: 'info',
39
+ path: '/info',
40
+ method: HttpMethod.GET,
41
+ tag: 'info',
42
+ summary: 'Get the server information',
43
+ handler: async () => ({ body: { name: 'example' } })
44
+ }
45
+ ],
46
+ [new SocketRouteProcessor()],
47
+ [
48
+ {
49
+ operationId: 'echo',
50
+ path: '/events/echo',
51
+ handler: async (socketRequestContext, request, responseEmitter) => {
52
+ await responseEmitter('echo', { body: request.body });
53
+ }
54
+ }
55
+ ],
56
+ { port: 3000, host: 'localhost' }
57
+ );
58
+
59
+ await webServer.start();
60
+ await webServer.stop();
61
+ ```