@dunx/http 0.2.6 → 0.2.8

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.
package/dist/index.js CHANGED
@@ -1236,7 +1236,7 @@ class HttpApplication {
1236
1236
  }
1237
1237
  }
1238
1238
  Object.defineProperty(HttpApplication, Symbol.for("dunx.deps"), {
1239
- value: () => [{ unresolved: "app: App" }, { unresolved: "discovered: readonly DiscoveredRoute[]" }, { unresolved: "options: HttpOptions" }, { unresolved: "websocket?: WebSocketRuntime" }]
1239
+ value: () => [{ unresolved: "app: App", typeOnly: "App" }, { unresolved: "discovered: readonly DiscoveredRoute[]" }, { unresolved: "options: HttpOptions" }, { unresolved: "websocket?: WebSocketRuntime", typeOnly: "WebSocketRuntime" }]
1240
1240
  });
1241
1241
 
1242
1242
  // src/server/factory.ts
@@ -1445,5 +1445,5 @@ export {
1445
1445
  ClientAddress
1446
1446
  };
1447
1447
 
1448
- //# debugId=25FA8588CA1C239F64756E2164756E21
1448
+ //# debugId=F568FED96394ED7164756E2164756E21
1449
1449
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -19,7 +19,7 @@
19
19
  "import {\n AppError,\n type Ctor,\n type InjectionToken,\n type ProviderEntry,\n type ResolvedModule,\n} from '@dunx/core';\nimport {\n gatewayPathOf,\n handlerMetaOf,\n isGateway,\n type HandlerKind,\n type HandlerMeta,\n} from './marker.js';\n\n/**\n * A discovered handler, already bound to its instance. Every kind has a different\n * signature, so the runtime holds them loosely and the decorators are what keep\n * the declared shapes honest.\n */\nexport type Invoke = (...args: readonly unknown[]) => unknown;\n\nexport interface DiscoveredHandler {\n readonly kind: HandlerKind;\n readonly event: string | undefined;\n readonly method: string;\n readonly invoke: Invoke;\n}\n\nexport interface DiscoveredGateway {\n readonly name: string;\n readonly path: string;\n readonly handlers: readonly DiscoveredHandler[];\n}\n\n/** `chat` and `/chat/` both become `/chat`; an empty path becomes `/`. */\nexport const normalizePath = (path: string): string => {\n const joined = `/${path}`.replace(/\\/{2,}/g, '/');\n return joined.length > 1 ? joined.replace(/\\/$/, '') : '/';\n};\n\n/** Every marked method on a prototype chain, most-derived first, names deduped. */\nconst eachHandler = (\n start: object | null,\n): readonly [string, HandlerMeta][] => {\n const found: [string, HandlerMeta][] = [];\n const seen = new Set<string>();\n\n for (\n let proto = start;\n proto !== null && proto !== Object.prototype;\n proto = Object.getPrototypeOf(proto) as object | null\n ) {\n for (const [name, descriptor] of Object.entries(\n Object.getOwnPropertyDescriptors(proto),\n )) {\n if (name === 'constructor' || seen.has(name)) continue;\n\n const meta = handlerMetaOf(descriptor.value);\n if (!meta) continue;\n\n seen.add(name);\n found.push([name, meta]);\n }\n }\n\n return found;\n};\n\n/**\n * Walks the prototype chain of a constructed gateway and collects every marked\n * method. Most-derived wins on a repeated name; an undecorated override does not\n * shadow its decorated base, and dispatch still lands on the override because the\n * handler is bound off the instance.\n */\nexport const discoverGateway = (instance: object): DiscoveredGateway => {\n const klass = instance.constructor;\n const members = instance as Record<string, Invoke>;\n\n return {\n name: klass.name,\n path: normalizePath(gatewayPathOf(klass)),\n handlers: eachHandler(Object.getPrototypeOf(instance) as object | null).map(\n ([name, meta]) => ({\n kind: meta.kind,\n event: meta.event,\n method: name,\n invoke: members[name]!.bind(instance),\n }),\n ),\n };\n};\n\n/**\n * The name of the first handler a class declares, without constructing it. A\n * provider that declares one but is not a gateway would silently never receive a\n * frame, so that becomes a boot error naming the method.\n */\nexport const findHandlerMethod = (ctor: Ctor<unknown>): string | undefined =>\n eachHandler(ctor.prototype as object | null)[0]?.[0];\n\n/** The class a `providers` entry would construct, or nothing for value/factory. */\nconst classOf = (\n entry: ProviderEntry,\n): { token: InjectionToken<unknown>; ctor: Ctor<unknown> } | undefined => {\n if (typeof entry === 'function') return { token: entry, ctor: entry };\n return entry.provider.kind === 'class'\n ? { token: entry.token, ctor: entry.provider.ctor }\n : undefined;\n};\n\n/**\n * Gateways are declared in `@Module({ providers })` like any other injectable and\n * found here by their marker - the same discovery-by-inspection controllers get,\n * with no second registration key to keep in step.\n */\nexport const discoverGateways = (\n modules: readonly ResolvedModule[],\n resolve: (token: InjectionToken<unknown>) => unknown,\n): readonly DiscoveredGateway[] => {\n const discovered: DiscoveredGateway[] = [];\n\n for (const module of modules) {\n for (const entry of module.options.providers ?? []) {\n const candidate = classOf(entry);\n if (!candidate) continue;\n\n if (isGateway(candidate.ctor)) {\n discovered.push(discoverGateway(resolve(candidate.token) as object));\n continue;\n }\n // Otherwise its handlers could never run, and nothing would say so.\n const orphan = findHandlerMethod(candidate.ctor);\n if (orphan !== undefined) {\n throw new AppError(\n `${candidate.ctor.name}.${orphan}() is a websocket handler, but ` +\n `${candidate.ctor.name} is not a gateway. Decorate the class with ` +\n '@Gateway(path), or drop the handler decorator.',\n );\n }\n }\n }\n\n return discovered;\n};\n",
20
20
  "import { AppError } from '@dunx/core';\nimport type { Server } from 'bun';\nimport { encode } from './envelope.js';\nimport {\n decodeRelay,\n DEFAULT_RELAY_CHANNEL,\n defaultRelayError,\n encodeRelay,\n type PubSubRelay,\n type RelayOptions,\n type RelayPhase,\n} from './relay.js';\nimport type { SocketData } from './socket.js';\n\n/**\n * Server-wide publish, delegating to Bun's own pub/sub. Topics live in the\n * runtime, not in a JavaScript registry: `socket.subscribe(topic)` is what joins\n * one, and Bun does the fan-out.\n *\n * Injectable - `HttpFactory` binds it, so a service can publish without holding a\n * socket and without registering anything.\n *\n * With a {@link PubSubRelay} attached the same publish also reaches the other\n * nodes. Without one - the default - nothing here touches a broker and the cost is\n * exactly Bun's.\n */\nexport class PubSub {\n /**\n * Identifies this process on the wire, so a frame this node published and the\n * broker echoed back is recognised and dropped instead of being fanned out\n * locally a second time. `Bun.randomUUIDv7` rather than a counter: two nodes\n * booted in the same millisecond must not collide.\n */\n readonly #origin = Bun.randomUUIDv7();\n #server: Server<SocketData> | undefined;\n #relay: PubSubRelay | undefined;\n #channel = DEFAULT_RELAY_CHANNEL;\n #onRelayError = defaultRelayError;\n /** So a broker that is down is reported once, not once per publish. */\n #relayFailing = false;\n #resubscribeTimer: ReturnType<typeof setTimeout> | undefined;\n #resubscribeLeft = 0;\n #resubscribeDelay = 0;\n\n /** Called with the live server by `listen()`; also usable directly. */\n attach(server: Server<SocketData>): void {\n this.#server = server;\n }\n\n get attached(): boolean {\n return this.#server !== undefined;\n }\n\n /** This process's id on the relay channel. Stable for the process's lifetime. */\n get origin(): string {\n return this.#origin;\n }\n\n get relaying(): boolean {\n return this.#relay !== undefined;\n }\n\n /**\n * Opt into multi-node fan-out: every `publish` from here on also goes to\n * `relay`, and everything other nodes put on the channel is fanned out locally.\n *\n * `HttpFactory.create(root, { relay })` is the shorthand - `listen()` calls this.\n * Call it directly when the relay has to come out of the container, which is the\n * case for an app reusing its own `@dunx/infra/redis` connection:\n * `app.get(PubSub).relayThrough(app.get(RedisConnection))` before `listen()`.\n *\n * A broker that cannot be reached is reported through `onError` and left alone -\n * local fan-out is unaffected, and the app boots either way.\n */\n async relayThrough(\n relay: PubSubRelay,\n options: RelayOptions = {},\n ): Promise<void> {\n if (this.#relay) {\n throw new AppError(\n 'PubSub already relays. Two subscriptions on one channel would deliver ' +\n 'every relayed message twice - pass HttpOptions.relay or call ' +\n 'relayThrough(), not both.',\n );\n }\n this.#relay = relay;\n this.#channel = options.channel ?? DEFAULT_RELAY_CHANNEL;\n this.#onRelayError = options.onError ?? defaultRelayError;\n this.#resubscribeLeft = options.resubscribe?.attempts ?? 5;\n this.#resubscribeDelay = options.resubscribe?.delayMs ?? 500;\n\n await this.#trySubscribe();\n }\n\n /**\n * One subscribe attempt, scheduling the next on failure. Separate from\n * `relayThrough` because a retry has to run the identical path - including the\n * synchronous-throw handling, which Bun's client needs.\n */\n async #trySubscribe(): Promise<void> {\n const relay = this.#relay;\n if (!relay) return;\n\n try {\n // Bun's client throws synchronously for some states, so the call is inside\n // the try rather than only the await.\n await relay.subscribe(this.#channel, (message) => {\n this.#inbound(message);\n });\n this.#relayFailing = false;\n this.#resubscribeLeft = 0;\n } catch (error) {\n this.#degrade(error, 'subscribe');\n this.#scheduleResubscribe();\n }\n }\n\n #scheduleResubscribe(): void {\n if (this.#resubscribeLeft <= 0 || this.#relay === undefined) return;\n this.#resubscribeLeft -= 1;\n const delay = this.#resubscribeDelay;\n // Capped so a long-dead broker settles into a slow poll instead of growing\n // unboundedly; unref'd so it can never be the reason a process stays up.\n this.#resubscribeDelay = Math.min(delay * 2, 30_000);\n this.#resubscribeTimer = setTimeout(() => {\n void this.#trySubscribe();\n }, delay);\n this.#resubscribeTimer.unref?.();\n }\n\n /** Bytes sent locally, `0` if the message was dropped, `-1` under backpressure. */\n publish(\n topic: string,\n data: string | Bun.BufferSource,\n compress?: boolean,\n ): number {\n const sent = this.#live().publish(topic, data, compress);\n // Unconditional, and after the local fan-out: a topic with no subscriber on\n // this node may have thousands on another.\n this.#outbound(topic, data);\n return sent;\n }\n\n /** The same envelope `@OnMessage(event)` reads, published to a topic. */\n publishEvent(topic: string, event: string, data?: unknown): number {\n return this.publish(topic, encode(event, data));\n }\n\n /** Subscribers on **this** node. Bun counts its own sockets and nothing else. */\n subscriberCount(topic: string): number {\n return this.#live().subscriberCount(topic);\n }\n\n /**\n * Releases a relay this `PubSub` was given, if the relay owns connections.\n *\n * The server reference goes too, which is what makes a relay the *app* owns safe\n * to leave subscribed: `PubSubRelay` has no unsubscribe, so a frame may still\n * arrive on a shared connection after this node stopped, and with no server\n * there is nothing for it to fan out to.\n */\n async close(): Promise<void> {\n const relay = this.#relay;\n this.#relay = undefined;\n // Before anything can await: a pending retry must not fire against a relay\n // this call is closing.\n this.#resubscribeLeft = 0;\n if (this.#resubscribeTimer !== undefined) {\n clearTimeout(this.#resubscribeTimer);\n this.#resubscribeTimer = undefined;\n }\n this.#server = undefined;\n if (!relay?.close) return;\n try {\n await relay.close();\n } catch (error) {\n this.#degrade(error, 'close');\n }\n }\n\n #outbound(topic: string, data: string | Bun.BufferSource): void {\n const relay = this.#relay;\n if (!relay) return;\n try {\n const result = relay.publish(\n this.#channel,\n encodeRelay(this.#origin, topic, data),\n );\n if (result instanceof Promise) {\n void result.then(\n () => {\n this.#relayFailing = false;\n },\n (error: unknown) => {\n this.#degrade(error, 'publish');\n },\n );\n return;\n }\n this.#relayFailing = false;\n } catch (error) {\n this.#degrade(error, 'publish');\n }\n }\n\n /**\n * Local fan-out only, and that is the whole rule: republishing to the relay here\n * would put the frame back on the channel that delivered it and loop forever.\n */\n #inbound(message: string): void {\n const frame = decodeRelay(message);\n if (!frame || frame.origin === this.#origin) return;\n this.#server?.publish(frame.topic, frame.data);\n }\n\n #degrade(error: unknown, phase: RelayPhase): void {\n if (this.#relayFailing) return;\n this.#relayFailing = true;\n this.#onRelayError(error, phase);\n }\n\n #live(): Server<SocketData> {\n if (!this.#server) {\n throw new AppError(\n 'PubSub has no server yet. Publish once the server is listening: ' +\n 'HttpApp.listen() is what attaches it.',\n );\n }\n return this.#server;\n }\n}\n",
21
21
  "/**\n * What `PubSub` needs from something that carries a message to the other nodes:\n * publish, and subscribe. Nothing else, so anything that already talks to a\n * broker satisfies it - `@dunx/infra/redis`'s `RedisConnection` does, structurally\n * and with no adapter, and so does a bare `Bun.RedisClient` pair.\n *\n * The return types are `unknown` rather than `Promise<void>` deliberately: Bun's\n * `publish` resolves the subscriber count, `@dunx/infra`'s resolves nothing, and a\n * synchronous in-memory bus resolves at all. A returned promise is awaited by\n * `subscribe` and watched for rejection by `publish`; anything else is taken as\n * having succeeded.\n */\nexport interface PubSubRelay {\n /** Hand `message` to every node subscribed to `channel`, this one included. */\n publish(channel: string, message: string): unknown;\n /**\n * Deliver every message published to `channel` to `listener`. Called once, with\n * one channel - pattern subscription is not used, because Bun's `psubscribe`\n * does not work (see docs/bun-apis.md).\n */\n subscribe(channel: string, listener: (message: string) => void): unknown;\n /**\n * Release whatever this relay opened. Implement it only for connections the\n * relay itself owns: a relay that is the application's own shared\n * `RedisConnection` must leave closing to the container, and simply omitting\n * this method is how it says so.\n */\n close?(): unknown;\n}\n\n/** Which relay call failed, so one message can say what degraded. */\nexport type RelayPhase = 'publish' | 'subscribe' | 'close';\n\nexport interface RelayOptions {\n /**\n * The one broker channel every topic's frames travel on.\n *\n * One channel rather than one per topic, because a node cannot know which\n * topics its sockets joined - `socket.subscribe()` goes straight into Bun - and\n * `psubscribe` is unusable. The cost is that every node reads every relayed\n * frame and drops the ones for topics it has no local subscriber on, which is a\n * `server.publish` returning `0`. Two apps sharing a Redis need two channels.\n *\n * @default 'dunx:ws'\n */\n readonly channel?: string;\n /**\n * Where a relay failure goes. Called once when the relay starts failing and not\n * again until it works, so an unreachable broker cannot flood the log.\n *\n * @default console.warn\n */\n readonly onError?: (error: unknown, phase: RelayPhase) => void;\n /**\n * What to do when the **boot** subscribe fails. Publishing recovers on its own -\n * every publish retries the broker - but a failed subscribe used to be retried\n * by nothing, so the node stayed permanently deaf to other nodes while still\n * looking healthy.\n *\n * Bounded rather than infinite, and the timer is unref'd, so a broker that never\n * comes back cannot hold the process open or spin forever.\n */\n readonly resubscribe?: {\n /** Retries after the first failure. `0` disables them. @default 5 */\n readonly attempts?: number;\n /** First delay; doubles each attempt, capped at 30s. @default 500 */\n readonly delayMs?: number;\n };\n}\n\nexport const DEFAULT_RELAY_CHANNEL = 'dunx:ws';\n\nexport const defaultRelayError = (error: unknown, phase: RelayPhase): void => {\n console.warn(\n `[dunx/http] the websocket relay could not ${phase}. Fan-out is local to ` +\n 'this process until it recovers:',\n error,\n );\n};\n\n/**\n * One relayed publish: which process published it, which topic it belongs to, and\n * the frame itself. `origin` is the whole duplicate-delivery defence - the broker\n * echoes a publish back to the publisher, and fanning that out locally a second\n * time would give every client on the originating node the message twice.\n */\nexport interface RelayFrame {\n readonly origin: string;\n readonly topic: string;\n readonly data: string | Uint8Array<ArrayBufferLike>;\n}\n\nconst toBytes = (data: Bun.BufferSource): Uint8Array<ArrayBufferLike> =>\n ArrayBuffer.isView(data)\n ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n : new Uint8Array(data);\n\nexport const encodeRelay = (\n origin: string,\n topic: string,\n data: string | Bun.BufferSource,\n): string =>\n typeof data === 'string'\n ? JSON.stringify({ o: origin, t: topic, d: data })\n : // Base64 through Buffer, which Bun implements natively. A binary frame has\n // to survive a text channel, and Redis pub/sub payloads are text here\n // because Bun's buffer-mode subscription is not implemented.\n JSON.stringify({\n o: origin,\n t: topic,\n d: Buffer.from(toBytes(data)).toString('base64'),\n b: 1,\n });\n\n/** `undefined` for anything that is not one of our frames, which is then ignored. */\nexport const decodeRelay = (message: string): RelayFrame | undefined => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(message);\n } catch {\n return undefined;\n }\n if (typeof parsed !== 'object' || parsed === null) return undefined;\n\n const { o, t, d, b } = parsed as {\n o?: unknown;\n t?: unknown;\n d?: unknown;\n b?: unknown;\n };\n if (typeof o !== 'string' || typeof t !== 'string' || typeof d !== 'string') {\n return undefined;\n }\n return { origin: o, topic: t, data: b ? Buffer.from(d, 'base64') : d };\n};\n",
22
- "import type { BunRequest, Server } from 'bun';\nimport {\n AppError,\n Logger,\n type App,\n type AppOptions,\n type Ctor,\n type InjectionToken,\n type ShutdownSignal,\n} from '@dunx/core';\nimport { joinPath, type DiscoveredRoute } from '../route/discover.js';\nimport type { WebSocketRuntime } from '../ws/adapter.js';\nimport { PubSub } from '../ws/pubsub.js';\nimport type { PubSubRelay, RelayPhase } from '../ws/relay.js';\nimport type { SocketData, SocketOptions } from '../ws/socket.js';\nimport { attachAddressSource, ClientAddress } from './client-address.js';\nimport type { CorsOptions } from './cors.js';\nimport { errorMapper, type ErrorMapper } from './errors.js';\nimport type { Middleware } from './middleware.js';\nimport {\n RequestLoggingMiddleware,\n type RequestLoggingOptions,\n} from './request-logging.js';\nimport {\n assertNoGatewayCollisions,\n buildFallback,\n buildRoutes,\n withUpgradeRoutes,\n} from './routes.js';\nimport { defaultSettings, type AppSettings } from './settings.js';\n\nexport interface HttpOptions extends AppOptions {\n readonly port?: number;\n /** Resolved from the container, so middleware can inject(). */\n readonly middleware?: readonly Ctor<Middleware>[];\n readonly onError?: ErrorMapper;\n /**\n * One structured entry per request, on by default. `false` removes it; an\n * options object tunes what it records. See {@link RequestLoggingMiddleware}.\n *\n * It is the **outermost** middleware, ahead of anything `middleware` declares,\n * so a request rejected by a guard is still logged with the status it got.\n */\n readonly requestLogging?: boolean | RequestLoggingOptions;\n /**\n * Bun's `websocket` options, plus where a throwing handler goes. Server-wide, so\n * they live here next to `middleware` rather than on a module: gateways\n * themselves are declared in `@Module({ providers })`.\n */\n readonly websocket?: SocketOptions;\n /**\n * Multi-node websocket fan-out. Absent - the default - means `PubSub` publishes\n * to this process only, which is exactly Bun's native pub/sub and costs nothing.\n *\n * `new RedisRelay({ url })` is the batteries-included one. Anything with a\n * `publish` and a `subscribe` fits, including `@dunx/infra`'s `RedisConnection`,\n * which has to come out of the container and so goes through\n * `app.get(PubSub).relayThrough(...)` instead of this option.\n */\n readonly relay?: PubSubRelay;\n /** The broker channel the relay carries frames on. @default 'dunx:ws' */\n readonly relayChannel?: string;\n}\n\n/**\n * Everything below `listen()` configures the route table, which is built exactly\n * once - when the server binds. Calling any of them afterwards throws rather than\n * being quietly dropped.\n */\nexport interface HttpApp extends App {\n /** Prefixes every discovered route. Last call wins. */\n setGlobalPrefix(prefix: string): this;\n /** Appends middleware, after anything `HttpOptions.middleware` declared. */\n use(...middleware: readonly Ctor<Middleware>[]): this;\n set<K extends keyof AppSettings>(key: K, value: AppSettings[K]): this;\n setting<K extends keyof AppSettings>(key: K): AppSettings[K];\n /** Mounts an `OPTIONS` preflight per path. Last call wins. */\n enableCors(options?: CorsOptions): this;\n /** The same `inject(ClientAddress)` singleton - honours `'trust proxy'`. */\n clientIp(req: BunRequest): string | undefined;\n /** Every gateway path this app upgrades on, exactly as mounted. */\n readonly gatewayPaths: readonly string[];\n listen(port?: number): Promise<string>;\n}\n\nexport class HttpApplication implements HttpApp {\n readonly closed: Promise<void>;\n readonly gatewayPaths: readonly string[];\n readonly #app: App;\n readonly #discovered: readonly DiscoveredRoute[];\n readonly #middleware: Ctor<Middleware>[];\n readonly #settings: AppSettings = defaultSettings();\n readonly #onError: ErrorMapper;\n readonly #port: number;\n readonly #websocket: WebSocketRuntime | undefined;\n readonly #relay: PubSubRelay | undefined;\n readonly #relayChannel: string | undefined;\n #globalPrefix = '';\n #cors: CorsOptions | undefined;\n #started = false;\n #server: Server<SocketData> | undefined;\n #resolveClosed: (() => void) | undefined;\n #shuttingDown: Promise<void> | undefined;\n #hooked = false;\n\n constructor(\n app: App,\n discovered: readonly DiscoveredRoute[],\n options: HttpOptions,\n websocket?: WebSocketRuntime,\n ) {\n this.#app = app;\n this.#discovered = discovered;\n this.#middleware = [\n ...(options.requestLogging === false ? [] : [RequestLoggingMiddleware]),\n ...(options.middleware ?? []),\n ];\n // The bound Logger, resolved only when the app did not bring its own mapper:\n // a 500's stack belongs in the same stream as everything else.\n this.#onError = options.onError ?? errorMapper(app.get(Logger));\n this.#port = options.port ?? 3000;\n this.#websocket = websocket;\n this.#relay = options.relay;\n this.#relayChannel = options.relayChannel;\n this.gatewayPaths = websocket?.paths ?? [];\n this.closed = new Promise<void>((resolve) => {\n this.#resolveClosed = resolve;\n });\n }\n\n get<T>(token: InjectionToken<T>): T {\n return this.#app.get(token);\n }\n\n setGlobalPrefix(prefix: string): this {\n this.#assertNotStarted('setGlobalPrefix()');\n this.#globalPrefix = prefix;\n return this;\n }\n\n use(...middleware: readonly Ctor<Middleware>[]): this {\n this.#assertNotStarted('use()');\n this.#middleware.push(...middleware);\n return this;\n }\n\n set<K extends keyof AppSettings>(key: K, value: AppSettings[K]): this {\n this.#assertNotStarted('set()');\n this.#settings[key] = value;\n return this;\n }\n\n setting<K extends keyof AppSettings>(key: K): AppSettings[K] {\n return this.#settings[key];\n }\n\n enableCors(options: CorsOptions = {}): this {\n this.#assertNotStarted('enableCors()');\n this.#cors = options;\n return this;\n }\n\n clientIp(req: BunRequest): string | undefined {\n return this.#app.get(ClientAddress).of(req);\n }\n\n /**\n * The one `Bun.serve` call. A gateway's upgrade is a native `GET` route in the\n * same table, so Bun's router - not a hand-written `fetch` fallback - is what\n * matches an upgrade, and no `fetch` handler is needed at all.\n */\n async listen(port = this.#port): Promise<string> {\n this.#assertNotStarted('listen()');\n this.#started = true;\n\n const middleware = this.#middleware.map((entry) => this.#app.get(entry));\n const prefixed = this.#prefixed();\n // A `@UseGuards` class comes from the container too, so a guard injects exactly\n // like global middleware does.\n const routes = buildRoutes(\n prefixed,\n middleware,\n this.#onError,\n this.#cors,\n (guard) => this.#app.get(guard),\n );\n\n const ws = this.#websocket;\n if (ws) assertNoGatewayCollisions(prefixed, ws.paths);\n\n // Bun's own 404 never reaches the middleware chain, so an unmatched path is\n // invisible to request logging. This runs only after Bun has matched nothing,\n // so Bun is still the router - it just puts the global middleware in front of\n // the 404 and returns it in the framework's error shape.\n const fetch = buildFallback(middleware, this.#onError, this.#cors);\n\n // Two literals, one call: a route that may answer `undefined` because it\n // upgraded is only a valid route table when `websocket` is there to receive it,\n // and Bun's own types say so.\n const options: Bun.Serve.Options<SocketData> = ws\n ? {\n port,\n fetch,\n routes: withUpgradeRoutes(routes, ws.routes),\n websocket: ws.websocket,\n }\n : { port, fetch, routes };\n this.#server = Bun.serve(options);\n\n attachAddressSource(this.#app.get(ClientAddress), {\n server: this.#server,\n trustProxy: this.#settings['trust proxy'],\n });\n const pubsub = this.#app.get(PubSub);\n pubsub.attach(this.#server);\n // After attach, so a frame that arrives during the subscribe already has a\n // server to fan out on. Awaited so a two-node deployment is subscribed by the\n // time listen() resolves; an unreachable broker fails fast and degrades.\n if (this.#relay) {\n const logger = this.#app.get(Logger);\n await pubsub.relayThrough(this.#relay, {\n ...(this.#relayChannel !== undefined && {\n channel: this.#relayChannel,\n }),\n onError: (error: unknown, phase: RelayPhase) => {\n logger.warn(\n `the websocket relay could not ${phase}. Fan-out is local to this ` +\n 'process until it recovers.',\n { error },\n );\n },\n });\n }\n return this.#server.url.href;\n }\n\n // Not delegated to the core app: the server has to stop before providers tear\n // down, so the signal handler must land here. With a gateway the stop is forced -\n // a graceful stop waits for open connections and a WebSocket does not close on\n // its own, so it would hang. Those clients see a 1006 close.\n async shutdown(): Promise<void> {\n this.#shuttingDown ??= (async () => {\n await this.#server?.stop(this.#websocket !== undefined);\n this.#server = undefined;\n // Before the container: a relay this app owns holds two Redis sockets, and\n // `maxRetries: 0` means nothing else will ever close them.\n await this.#app.get(PubSub).close();\n await this.#app.shutdown();\n this.#resolveClosed?.();\n })();\n return this.#shuttingDown;\n }\n\n enableShutdownHooks(\n signals: readonly ShutdownSignal[] = ['SIGTERM', 'SIGINT'],\n ): this {\n if (this.#hooked) return this;\n this.#hooked = true;\n for (const signal of signals) {\n process.once(signal, () => void this.shutdown());\n }\n return this;\n }\n\n // Collision detection re-runs inside buildRoutes on these final paths.\n #prefixed(): readonly DiscoveredRoute[] {\n if (this.#globalPrefix === '') return this.#discovered;\n return this.#discovered.map((route) => ({\n ...route,\n path: joinPath(this.#globalPrefix, route.path),\n }));\n }\n\n // #started rather than #server, which shutdown() clears - a hook called after\n // the server stopped is just as ineffective as one called while it ran.\n #assertNotStarted(hook: string): void {\n if (!this.#started) return;\n throw new AppError(\n `${hook} must be called before listen(). The route table and the middleware ` +\n 'chain are folded into one closure per route when the server binds, so ' +\n 'this call could not take effect.',\n );\n }\n}\nObject.defineProperty(HttpApplication, Symbol.for('dunx.deps'), {\n value: () => [{ unresolved: \"app: App\" }, { unresolved: \"discovered: readonly DiscoveredRoute[]\" }, { unresolved: \"options: HttpOptions\" }, { unresolved: \"websocket?: WebSocketRuntime\" }],\n});\n",
22
+ "import type { BunRequest, Server } from 'bun';\nimport {\n AppError,\n Logger,\n type App,\n type AppOptions,\n type Ctor,\n type InjectionToken,\n type ShutdownSignal,\n} from '@dunx/core';\nimport { joinPath, type DiscoveredRoute } from '../route/discover.js';\nimport type { WebSocketRuntime } from '../ws/adapter.js';\nimport { PubSub } from '../ws/pubsub.js';\nimport type { PubSubRelay, RelayPhase } from '../ws/relay.js';\nimport type { SocketData, SocketOptions } from '../ws/socket.js';\nimport { attachAddressSource, ClientAddress } from './client-address.js';\nimport type { CorsOptions } from './cors.js';\nimport { errorMapper, type ErrorMapper } from './errors.js';\nimport type { Middleware } from './middleware.js';\nimport {\n RequestLoggingMiddleware,\n type RequestLoggingOptions,\n} from './request-logging.js';\nimport {\n assertNoGatewayCollisions,\n buildFallback,\n buildRoutes,\n withUpgradeRoutes,\n} from './routes.js';\nimport { defaultSettings, type AppSettings } from './settings.js';\n\nexport interface HttpOptions extends AppOptions {\n readonly port?: number;\n /** Resolved from the container, so middleware can inject(). */\n readonly middleware?: readonly Ctor<Middleware>[];\n readonly onError?: ErrorMapper;\n /**\n * One structured entry per request, on by default. `false` removes it; an\n * options object tunes what it records. See {@link RequestLoggingMiddleware}.\n *\n * It is the **outermost** middleware, ahead of anything `middleware` declares,\n * so a request rejected by a guard is still logged with the status it got.\n */\n readonly requestLogging?: boolean | RequestLoggingOptions;\n /**\n * Bun's `websocket` options, plus where a throwing handler goes. Server-wide, so\n * they live here next to `middleware` rather than on a module: gateways\n * themselves are declared in `@Module({ providers })`.\n */\n readonly websocket?: SocketOptions;\n /**\n * Multi-node websocket fan-out. Absent - the default - means `PubSub` publishes\n * to this process only, which is exactly Bun's native pub/sub and costs nothing.\n *\n * `new RedisRelay({ url })` is the batteries-included one. Anything with a\n * `publish` and a `subscribe` fits, including `@dunx/infra`'s `RedisConnection`,\n * which has to come out of the container and so goes through\n * `app.get(PubSub).relayThrough(...)` instead of this option.\n */\n readonly relay?: PubSubRelay;\n /** The broker channel the relay carries frames on. @default 'dunx:ws' */\n readonly relayChannel?: string;\n}\n\n/**\n * Everything below `listen()` configures the route table, which is built exactly\n * once - when the server binds. Calling any of them afterwards throws rather than\n * being quietly dropped.\n */\nexport interface HttpApp extends App {\n /** Prefixes every discovered route. Last call wins. */\n setGlobalPrefix(prefix: string): this;\n /** Appends middleware, after anything `HttpOptions.middleware` declared. */\n use(...middleware: readonly Ctor<Middleware>[]): this;\n set<K extends keyof AppSettings>(key: K, value: AppSettings[K]): this;\n setting<K extends keyof AppSettings>(key: K): AppSettings[K];\n /** Mounts an `OPTIONS` preflight per path. Last call wins. */\n enableCors(options?: CorsOptions): this;\n /** The same `inject(ClientAddress)` singleton - honours `'trust proxy'`. */\n clientIp(req: BunRequest): string | undefined;\n /** Every gateway path this app upgrades on, exactly as mounted. */\n readonly gatewayPaths: readonly string[];\n listen(port?: number): Promise<string>;\n}\n\nexport class HttpApplication implements HttpApp {\n readonly closed: Promise<void>;\n readonly gatewayPaths: readonly string[];\n readonly #app: App;\n readonly #discovered: readonly DiscoveredRoute[];\n readonly #middleware: Ctor<Middleware>[];\n readonly #settings: AppSettings = defaultSettings();\n readonly #onError: ErrorMapper;\n readonly #port: number;\n readonly #websocket: WebSocketRuntime | undefined;\n readonly #relay: PubSubRelay | undefined;\n readonly #relayChannel: string | undefined;\n #globalPrefix = '';\n #cors: CorsOptions | undefined;\n #started = false;\n #server: Server<SocketData> | undefined;\n #resolveClosed: (() => void) | undefined;\n #shuttingDown: Promise<void> | undefined;\n #hooked = false;\n\n constructor(\n app: App,\n discovered: readonly DiscoveredRoute[],\n options: HttpOptions,\n websocket?: WebSocketRuntime,\n ) {\n this.#app = app;\n this.#discovered = discovered;\n this.#middleware = [\n ...(options.requestLogging === false ? [] : [RequestLoggingMiddleware]),\n ...(options.middleware ?? []),\n ];\n // The bound Logger, resolved only when the app did not bring its own mapper:\n // a 500's stack belongs in the same stream as everything else.\n this.#onError = options.onError ?? errorMapper(app.get(Logger));\n this.#port = options.port ?? 3000;\n this.#websocket = websocket;\n this.#relay = options.relay;\n this.#relayChannel = options.relayChannel;\n this.gatewayPaths = websocket?.paths ?? [];\n this.closed = new Promise<void>((resolve) => {\n this.#resolveClosed = resolve;\n });\n }\n\n get<T>(token: InjectionToken<T>): T {\n return this.#app.get(token);\n }\n\n setGlobalPrefix(prefix: string): this {\n this.#assertNotStarted('setGlobalPrefix()');\n this.#globalPrefix = prefix;\n return this;\n }\n\n use(...middleware: readonly Ctor<Middleware>[]): this {\n this.#assertNotStarted('use()');\n this.#middleware.push(...middleware);\n return this;\n }\n\n set<K extends keyof AppSettings>(key: K, value: AppSettings[K]): this {\n this.#assertNotStarted('set()');\n this.#settings[key] = value;\n return this;\n }\n\n setting<K extends keyof AppSettings>(key: K): AppSettings[K] {\n return this.#settings[key];\n }\n\n enableCors(options: CorsOptions = {}): this {\n this.#assertNotStarted('enableCors()');\n this.#cors = options;\n return this;\n }\n\n clientIp(req: BunRequest): string | undefined {\n return this.#app.get(ClientAddress).of(req);\n }\n\n /**\n * The one `Bun.serve` call. A gateway's upgrade is a native `GET` route in the\n * same table, so Bun's router - not a hand-written `fetch` fallback - is what\n * matches an upgrade, and no `fetch` handler is needed at all.\n */\n async listen(port = this.#port): Promise<string> {\n this.#assertNotStarted('listen()');\n this.#started = true;\n\n const middleware = this.#middleware.map((entry) => this.#app.get(entry));\n const prefixed = this.#prefixed();\n // A `@UseGuards` class comes from the container too, so a guard injects exactly\n // like global middleware does.\n const routes = buildRoutes(\n prefixed,\n middleware,\n this.#onError,\n this.#cors,\n (guard) => this.#app.get(guard),\n );\n\n const ws = this.#websocket;\n if (ws) assertNoGatewayCollisions(prefixed, ws.paths);\n\n // Bun's own 404 never reaches the middleware chain, so an unmatched path is\n // invisible to request logging. This runs only after Bun has matched nothing,\n // so Bun is still the router - it just puts the global middleware in front of\n // the 404 and returns it in the framework's error shape.\n const fetch = buildFallback(middleware, this.#onError, this.#cors);\n\n // Two literals, one call: a route that may answer `undefined` because it\n // upgraded is only a valid route table when `websocket` is there to receive it,\n // and Bun's own types say so.\n const options: Bun.Serve.Options<SocketData> = ws\n ? {\n port,\n fetch,\n routes: withUpgradeRoutes(routes, ws.routes),\n websocket: ws.websocket,\n }\n : { port, fetch, routes };\n this.#server = Bun.serve(options);\n\n attachAddressSource(this.#app.get(ClientAddress), {\n server: this.#server,\n trustProxy: this.#settings['trust proxy'],\n });\n const pubsub = this.#app.get(PubSub);\n pubsub.attach(this.#server);\n // After attach, so a frame that arrives during the subscribe already has a\n // server to fan out on. Awaited so a two-node deployment is subscribed by the\n // time listen() resolves; an unreachable broker fails fast and degrades.\n if (this.#relay) {\n const logger = this.#app.get(Logger);\n await pubsub.relayThrough(this.#relay, {\n ...(this.#relayChannel !== undefined && {\n channel: this.#relayChannel,\n }),\n onError: (error: unknown, phase: RelayPhase) => {\n logger.warn(\n `the websocket relay could not ${phase}. Fan-out is local to this ` +\n 'process until it recovers.',\n { error },\n );\n },\n });\n }\n return this.#server.url.href;\n }\n\n // Not delegated to the core app: the server has to stop before providers tear\n // down, so the signal handler must land here. With a gateway the stop is forced -\n // a graceful stop waits for open connections and a WebSocket does not close on\n // its own, so it would hang. Those clients see a 1006 close.\n async shutdown(): Promise<void> {\n this.#shuttingDown ??= (async () => {\n await this.#server?.stop(this.#websocket !== undefined);\n this.#server = undefined;\n // Before the container: a relay this app owns holds two Redis sockets, and\n // `maxRetries: 0` means nothing else will ever close them.\n await this.#app.get(PubSub).close();\n await this.#app.shutdown();\n this.#resolveClosed?.();\n })();\n return this.#shuttingDown;\n }\n\n enableShutdownHooks(\n signals: readonly ShutdownSignal[] = ['SIGTERM', 'SIGINT'],\n ): this {\n if (this.#hooked) return this;\n this.#hooked = true;\n for (const signal of signals) {\n process.once(signal, () => void this.shutdown());\n }\n return this;\n }\n\n // Collision detection re-runs inside buildRoutes on these final paths.\n #prefixed(): readonly DiscoveredRoute[] {\n if (this.#globalPrefix === '') return this.#discovered;\n return this.#discovered.map((route) => ({\n ...route,\n path: joinPath(this.#globalPrefix, route.path),\n }));\n }\n\n // #started rather than #server, which shutdown() clears - a hook called after\n // the server stopped is just as ineffective as one called while it ran.\n #assertNotStarted(hook: string): void {\n if (!this.#started) return;\n throw new AppError(\n `${hook} must be called before listen(). The route table and the middleware ` +\n 'chain are folded into one closure per route when the server binds, so ' +\n 'this call could not take effect.',\n );\n }\n}\nObject.defineProperty(HttpApplication, Symbol.for('dunx.deps'), {\n value: () => [{ unresolved: \"app: App\", typeOnly: \"App\" }, { unresolved: \"discovered: readonly DiscoveredRoute[]\" }, { unresolved: \"options: HttpOptions\" }, { unresolved: \"websocket?: WebSocketRuntime\", typeOnly: \"WebSocketRuntime\" }],\n});\n",
23
23
  "import { Logger, RequestContext } from '@dunx/core';\nimport type { BunRequest } from 'bun';\nimport type { RouteContext } from './context.js';\nimport { HttpError } from './errors.js';\nimport type { Middleware, Next } from './middleware.js';\nimport { HttpStatusCode } from './status.js';\n\nexport const REQUEST_ID_HEADER = 'x-request-id';\n\nexport interface RequestLoggingOptions {\n /** Bodies past this many characters are logged as a size. Default 2048. `0` omits them. */\n readonly maxBodyLength?: number;\n /**\n * Log the request body. Default **`false`**.\n *\n * Reading it means `req.clone().text()` - a second copy of every payload,\n * buffered and parsed, on the hot path. Measured on the `validate` scenario in\n * `tools/bench`, turning both body options on costs roughly two thirds of the\n * throughput. It is also the field most likely to contain a password.\n *\n * Turn it on in development, where seeing the payload is the point.\n */\n readonly requestBody?: boolean;\n /** Log the response body. Default **`false`** - same clone-and-buffer cost. */\n readonly responseBody?: boolean;\n /**\n * Paths to skip entirely - a health check polled every second, say.\n *\n * **Entirely** is literal: no entry, no `x-request-id` on the response, and no\n * `AsyncLocalStorage` scope, so anything the handler logs is uncorrelated. That\n * is what makes it free. `correlateIgnored` buys the correlation back.\n */\n readonly ignore?: readonly string[];\n /**\n * Keep the request id and the async scope on an `ignore`d path. Default\n * **`false`**.\n *\n * \"Do not log the health check, but do keep its request id\" is this. The path\n * still writes no entry of its own; it gets an id - inbound or minted - on the\n * response, and everything the handler logs carries it.\n *\n * It is not the default because it is not free: the ignored path pays for\n * reading the header, `crypto.randomUUID()`, the `runWithContext` scope and the\n * response header. On the `bun run logging` decomposition those four rows are\n * ~2.2 µs, against ~5.4 µs for the whole default path - so it costs the half\n * that buys correlation and not the half that builds and serialises the entry.\n */\n readonly correlateIgnored?: boolean;\n}\n\nconst UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * An inbound id is honoured so a trace survives across services - but only if it\n * is a UUID, which is what this middleware would have minted. It is a\n * caller-supplied string that ends up in every line the request writes, so a\n * newline, a megabyte, or a deliberate collision with somebody else's trace is\n * replaced by a fresh one rather than trusted. `nestjs-template` validated it the\n * same way.\n *\n * The length check first: it is what keeps garbage away from the regex, and the\n * common case has no header at all.\n */\nconst traceId = (inbound: string | null): string =>\n inbound !== null && inbound.length === 36 && UUID.test(inbound)\n ? inbound\n : crypto.randomUUID();\n\nconst parse = (text: string, limit: number): unknown => {\n if (limit === 0) return undefined;\n if (text.length === 0) return undefined;\n if (text.length > limit) return `[${text.length} bytes]`;\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n};\n\nconst elapsedMs = (started: number): number =>\n Math.round((Bun.nanoseconds() - started) / 1e6);\n\n/** What the entry's `request` field carries, built in the order it is logged. */\ntype RequestFields = Record<string, unknown>;\n\n/**\n * One structured entry per request, carrying the request and its response.\n *\n * Installed by `HttpFactory.create` unless `requestLogging: false`. It injects\n * `Logger` and `RequestContext` - both `@dunx/core` contracts, both bound by\n * default - so it works with no logging module imported, and picks up\n * `@arkv/logger` automatically once `@dunx/infra/logger` is.\n *\n * **One entry, not two.** Nest needs a middleware for the inbound half and an\n * interceptor for the outbound one, because they are different classes and the\n * interceptor cannot see what the middleware saw. Here they are the same\n * closure, so there is no pair to correlate by `requestId` to find out how a\n * call ended. A 4xx is the same line at `warn`, a 5xx at `error`.\n *\n * Everything the handler logs in between carries `requestId`, `method`, `event`\n * and `context` without being passed anything, because the whole call runs\n * inside `runWithContext`.\n *\n * **Nothing here is `async`.** Reading the request or the response body are the\n * only steps that can ever wait, both are off by default, and both are adopted\n * with `.then` rather than awaited - the same rule `input.ts` follows, for the\n * same measured reason. An `async` scope callback alone cost 0.44 µs/request\n * against a synchronous one on raw `Bun.serve`.\n */\nexport class RequestLoggingMiddleware implements Middleware {\n readonly #limit: number;\n readonly #requestBody: boolean;\n readonly #responseBody: boolean;\n readonly #ignore: ReadonlySet<string>;\n readonly #correlateIgnored: boolean;\n\n constructor(\n private readonly logger: Logger,\n private readonly context: RequestContext,\n options: RequestLoggingOptions = {},\n ) {\n this.#limit = options.maxBodyLength ?? 2048;\n this.#requestBody = options.requestBody ?? false;\n this.#responseBody = options.responseBody ?? false;\n this.#ignore = new Set(options.ignore ?? []);\n this.#correlateIgnored = options.correlateIgnored ?? false;\n }\n\n handle(req: BunRequest, ctx: RouteContext, next: Next): Promise<Response> {\n // `new URL(req.url)` parses the scheme, host, port, query and hash to reach one\n // string. This finds the same two offsets once and slices both the pathname and\n // the query out of them, which is what every request needs and all that most of\n // them need.\n const url = req.url;\n const from = url.indexOf('/', url.indexOf('://') + 3);\n const mark = from === -1 ? -1 : url.indexOf('?', from);\n const path =\n from === -1 ? '/' : mark === -1 ? url.slice(from) : url.slice(from, mark);\n if (this.#ignore.size > 0 && this.#ignore.has(path)) {\n return this.#correlateIgnored\n ? this.#correlated(req, ctx, path, next)\n : next();\n }\n\n const started = Bun.nanoseconds();\n const requestId = traceId(req.headers.get(REQUEST_ID_HEADER));\n\n return this.context.runWithContext(\n {\n requestId,\n method: ctx.method,\n event: path,\n flow: 'http',\n context: `${ctx.controller}.${ctx.handler}`,\n },\n () => {\n const request: RequestFields = {};\n if (mark !== -1) {\n request['query'] = Object.fromEntries(\n new URLSearchParams(url.slice(mark + 1)),\n );\n }\n const body = this.#body(req);\n if (body === undefined) {\n request['userAgent'] = req.headers.get('user-agent');\n return this.#dispatch(req, path, requestId, started, request, next);\n }\n return body.then((value) => {\n if (value !== undefined) request['body'] = value;\n request['userAgent'] = req.headers.get('user-agent');\n return this.#dispatch(req, path, requestId, started, request, next);\n });\n },\n );\n }\n\n /**\n * An ignored path under `correlateIgnored`: the scope and the response header,\n * and no entry. Nothing is timed and no fields are collected, because nothing\n * here is ever logged.\n */\n #correlated(\n req: BunRequest,\n ctx: RouteContext,\n path: string,\n next: Next,\n ): Promise<Response> {\n const requestId = traceId(req.headers.get(REQUEST_ID_HEADER));\n return this.context.runWithContext(\n {\n requestId,\n method: ctx.method,\n event: path,\n flow: 'http',\n context: `${ctx.controller}.${ctx.handler}`,\n },\n () =>\n next().then((response) => {\n response.headers.set(REQUEST_ID_HEADER, requestId);\n return response;\n }),\n );\n }\n\n #dispatch(\n req: BunRequest,\n path: string,\n requestId: string,\n started: number,\n request: RequestFields,\n next: Next,\n ): Promise<Response> {\n // `next()` is only ever a promise once the chain bottoms out in a route, but a\n // user middleware ahead of the route may throw out of `handle` synchronously,\n // and that request is still one this middleware promised to log.\n let settled: Promise<Response>;\n try {\n settled = next();\n } catch (error) {\n this.#failed(req, path, started, request, error);\n throw error;\n }\n return settled.then(\n (response) =>\n this.#succeeded(req, path, requestId, started, request, response),\n (error: unknown) => {\n this.#failed(req, path, started, request, error);\n throw error;\n },\n );\n }\n\n /**\n * Logged and rethrown: the error mapper still owns the status and the response\n * shape. A 404 or a rejected body is the caller's fault, and logging every probe\n * at `error` would drown the ones that matter.\n */\n #failed(\n req: BunRequest,\n path: string,\n started: number,\n request: RequestFields,\n error: unknown,\n ): void {\n const status =\n error instanceof HttpError\n ? error.status\n : HttpStatusCode.INTERNAL_SERVER_ERROR;\n const entry = {\n request,\n err: error,\n statusCode: status,\n elapsedMs: elapsedMs(started),\n };\n const line = `${req.method} ${path} ${status}`;\n if (status < HttpStatusCode.INTERNAL_SERVER_ERROR) {\n this.logger.warn(line, entry);\n } else {\n this.logger.error(line, entry);\n }\n }\n\n #succeeded(\n req: BunRequest,\n path: string,\n requestId: string,\n started: number,\n request: RequestFields,\n response: Response,\n ): Response | Promise<Response> {\n const body = this.#responseFields(response);\n if (body === undefined) {\n this.logger.info(`${req.method} ${path} ${response.status}`, {\n request,\n statusCode: response.status,\n elapsedMs: elapsedMs(started),\n });\n response.headers.set(REQUEST_ID_HEADER, requestId);\n return response;\n }\n return body.then((value) => {\n this.logger.info(`${req.method} ${path} ${response.status}`, {\n request,\n statusCode: response.status,\n ...(value === undefined ? {} : { responseBody: value }),\n elapsedMs: elapsedMs(started),\n });\n response.headers.set(REQUEST_ID_HEADER, requestId);\n return response;\n });\n }\n\n /**\n * `undefined` - the default - means there is nothing to read, and the caller\n * stays on the synchronous path. Clones when there is, so the handler's own\n * stream is never the one that was consumed.\n */\n #body(req: BunRequest): Promise<unknown> | undefined {\n if (!this.#requestBody) return undefined;\n if (req.method === 'GET' || req.method === 'HEAD') return undefined;\n if (!(req.headers.get('content-type') ?? '').includes('application/json')) {\n return undefined;\n }\n return req\n .clone()\n .text()\n .then((text) => parse(text, this.#limit));\n }\n\n #responseFields(response: Response): Promise<unknown> | undefined {\n if (!this.#responseBody) return undefined;\n if (\n !(response.headers.get('content-type') ?? '').includes('application/json')\n ) {\n return undefined;\n }\n return response\n .clone()\n .text()\n .then((text) => parse(text, this.#limit));\n }\n}\nObject.defineProperty(RequestLoggingMiddleware, Symbol.for('dunx.deps'), {\n value: () => [Logger, RequestContext, { unresolved: \"options: RequestLoggingOptions = {}\" }],\n});\n",
24
24
  "import { AppError, type Ctor } from '@dunx/core';\nimport type { BunRequest } from 'bun';\nimport type { DiscoveredRoute } from '../route/discover.js';\nimport type { HttpMethod } from '../route/marker.js';\nimport type { RouteInput } from '../route/schema.js';\nimport type { UpgradeHandler } from '../ws/adapter.js';\nimport { buildContext, type RouteContext } from './context.js';\nimport { preflight, withCors, type CorsOptions } from './cors.js';\nimport { defaultErrorMapper, HttpError, type ErrorMapper } from './errors.js';\nimport { buildInputReader, type InputReader } from './input.js';\nimport {\n compose,\n type Middleware,\n type RouteHandler,\n type ServedHandler,\n} from './middleware.js';\nimport { HttpStatusCode } from './status.js';\n\n/** How a `@UseGuards` class becomes an instance. `listen()` passes `app.get`. */\nexport type GuardResolver = (guard: Ctor<Middleware>) => Middleware;\n\nconst construct: GuardResolver = (guard) =>\n new (guard as new () => Middleware)();\n\n/** `OPTIONS` is never a `@Get`-style route - only CORS mounts one. */\nexport type RouteMethod = HttpMethod | 'OPTIONS';\n\nexport type BunRoutes = Record<\n string,\n Partial<Record<RouteMethod, ServedHandler>>\n>;\n\n/**\n * What `listen()` hands `Bun.serve`: the HTTP table plus one `GET` per gateway,\n * whose handler may answer `undefined` because the socket was upgraded.\n */\nexport type ServeRoutes = Record<\n string,\n Partial<Record<RouteMethod, ServedHandler | UpgradeHandler>>\n>;\n\n/**\n * A `Response` passes through untouched - that is the escape hatch, and nothing\n * about it is worth second-guessing. Nothing at all is a 204: `Response.json(null)`\n * would be a body claiming to be no body.\n */\nconst toResponse = (value: unknown, status: number): Response => {\n if (value instanceof Response) return value;\n if (value === undefined || value === null) {\n return new Response(null, { status: HttpStatusCode.NO_CONTENT });\n }\n return Response.json(value, { status });\n};\n\n/** Nest's rule: an explicit `status`, else 201 for POST, else 200. */\nconst statusFor = (route: DiscoveredRoute): number =>\n route.options?.status ??\n (route.method === 'POST' ? HttpStatusCode.CREATED : HttpStatusCode.OK);\n\n/**\n * Bun silently lets one route win on a collision, so a duplicate method+path is a\n * boot error naming both handlers. Run twice: once at `create()` on the discovered\n * paths, and again from `buildRoutes` at `listen()` on the final, prefixed ones.\n */\nexport const assertNoCollisions = (\n discovered: readonly DiscoveredRoute[],\n): void => {\n const owners = new Map<string, string>();\n\n for (const route of discovered) {\n const key = `${route.method} ${route.path}`;\n const owner = `${route.controller}.${route.handlerName}`;\n const existing = owners.get(key);\n\n if (existing !== undefined) {\n throw new AppError(\n `Route collision: ${key} is declared by ${existing} and by ${owner}. ` +\n 'Bun would keep only one of them.',\n );\n }\n owners.set(key, owner);\n }\n};\n\n/**\n * A gateway's upgrade is a native route like any other, so a path claimed by both a\n * controller and a gateway would lose one of them when the two tables merge.\n */\nexport const assertNoGatewayCollisions = (\n discovered: readonly DiscoveredRoute[],\n gatewayPaths: readonly string[],\n): void => {\n const gateways = new Set(gatewayPaths);\n\n for (const route of discovered) {\n if (gateways.has(route.path)) {\n throw new AppError(\n `Gateway path collision: ${route.path} is served by a gateway and by ` +\n `${route.controller}.${route.handlerName}(). The upgrade is a route too, ` +\n 'so one of them would be dropped.',\n );\n }\n }\n};\n\n/**\n * The two tables in one. A gateway's `GET` is what Bun's router matches on an\n * upgrade - the reason no `fetch` handler is needed for a socket to connect.\n */\nexport const withUpgradeRoutes = (\n routes: BunRoutes,\n gateways: ReadonlyMap<string, UpgradeHandler>,\n): ServeRoutes => {\n const merged: ServeRoutes = { ...routes };\n for (const [path, upgrade] of gateways) merged[path] = { GET: upgrade };\n return merged;\n};\n\n/**\n * The context an unmatched request gets. There is no controller and no handler,\n * and saying so is more useful to a log line than an empty string.\n */\nconst unmatchedContext = (req: Request): RouteContext =>\n Object.freeze({\n controller: '(unmatched)',\n handler: '(none)',\n method: req.method as HttpMethod,\n path: new URL(req.url).pathname,\n get: () => undefined,\n });\n\n/**\n * Bun answers an unmatched path itself, so nothing in the middleware chain ever\n * sees it - which makes a 404 invisible to request logging, metrics and tracing.\n *\n * This is the only `fetch` handler dunx installs, and it is not a router: Bun\n * still does all the matching, and this runs only once Bun has decided nothing\n * matched. It puts the global middleware in front of a 404 in the framework's\n * own error shape.\n *\n * Composed per request rather than at boot, because the context names the path\n * that missed. That allocation is on the 404 path only.\n */\nexport const buildFallback = (\n middleware: readonly Middleware[] = [],\n onError: ErrorMapper = defaultErrorMapper,\n cors?: CorsOptions,\n): RouteHandler => {\n // The canonical status name, not a sentence naming the path back at the\n // caller: an unmatched path is the one place where echoing the request would\n // tell a prober something about the surface it just failed to find.\n const miss: RouteHandler = () => {\n throw new HttpError(HttpStatusCode.NOT_FOUND, 'NOT_FOUND');\n };\n\n const run: RouteHandler = async (req) => {\n try {\n return await compose(middleware, unmatchedContext(req), miss)(req);\n } catch (error) {\n return onError(error, req);\n }\n };\n\n return cors ? withCors(cors, run) : run;\n};\n\n/**\n * The direct path, taken when a route has no middleware and no CORS. Nothing here\n * is `async`: every step looks at what it got and only allocates a promise when\n * there is genuinely something to wait for.\n *\n * The general path is `async (req) => toResponse(await handler(await read(req)))`\n * inside an `async` try/catch - four `await`s across two async frames, on values\n * that are usually not thenable at all. A route with no declared schemas awaits\n * nothing; a route with only `query` or `params` awaits nothing either, because\n * every Standard Schema validator worth using is synchronous. Even a `body` route,\n * which really does have to wait for `req.json()`, pays one promise link instead of\n * six frames.\n *\n * Worth ~6 points of throughput against raw `Bun.serve` on the `params` scenario\n * when it covered only schema-less routes, and a further ~5 on `validate` when it\n * was extended to cover reading ones - which is most of what separated dunx from\n * Elysia, whose whole trick is compiling this shape ahead of time.\n *\n * A handler or a validator that *does* return a promise still works: it is adopted\n * here rather than awaited by a wrapper.\n */\nconst directOr = (\n guarded: RouteHandler,\n route: DiscoveredRoute,\n read: InputReader,\n status: number,\n onError: ErrorMapper,\n noMiddleware: boolean,\n): ServedHandler => {\n if (!noMiddleware) return guarded;\n\n // `toResponse` throws on a value `JSON.stringify` cannot take, so it is inside\n // the mapper's reach on every branch - including the `then` callbacks, where a\n // throw would otherwise escape as an unhandled rejection instead of a 500.\n const settle = (value: unknown, req: BunRequest): Response => {\n try {\n return toResponse(value, status);\n } catch (error) {\n return onError(error, req);\n }\n };\n\n const invoke = (\n input: RouteInput,\n req: BunRequest,\n ): Response | Promise<Response> => {\n try {\n const value = route.handler(input);\n return value instanceof Promise\n ? value.then(\n (resolved) => settle(resolved, req),\n (error: unknown) => onError(error, req),\n )\n : settle(value, req);\n } catch (error) {\n return onError(error, req);\n }\n };\n\n return (req) => {\n try {\n const input = read(req);\n return input instanceof Promise\n ? input.then(\n (resolved) => invoke(resolved, req),\n (error: unknown) => onError(error, req),\n )\n : invoke(input, req);\n } catch (error) {\n return onError(error, req);\n }\n };\n};\n\nexport const buildRoutes = (\n discovered: readonly DiscoveredRoute[],\n middleware: readonly Middleware[] = [],\n onError: ErrorMapper = defaultErrorMapper,\n cors?: CorsOptions,\n resolve: GuardResolver = construct,\n): BunRoutes => {\n assertNoCollisions(discovered);\n const routes: BunRoutes = {};\n // One instance per guard class for the whole table - what the container returns,\n // and what the default resolver has to match to be interchangeable with it.\n const instances = new Map<Ctor<Middleware>, Middleware>();\n const guardOf = (guard: Ctor<Middleware>): Middleware => {\n const existing = instances.get(guard);\n if (existing) return existing;\n const created = resolve(guard);\n instances.set(guard, created);\n return created;\n };\n\n for (const route of discovered) {\n // Schemas, parsers, the status and the route context resolve here, once. What\n // survives into the request path is one closure that reads no metadata.\n const read = buildInputReader(route.options);\n const status = statusFor(route);\n // Global outermost, then the controller's guards, then the method's.\n const chain = [...middleware, ...(route.guards ?? []).map(guardOf)];\n const chained = compose(chain, buildContext(route), async (req) =>\n toResponse(await route.handler(await read(req)), status),\n );\n const guarded: RouteHandler = async (req) => {\n try {\n return await chained(req);\n } catch (error) {\n return onError(error, req);\n }\n };\n\n const byMethod = (routes[route.path] ??= {});\n // Outside the error mapper, so a mapped 500 still carries the CORS headers the\n // browser needs in order to show it.\n byMethod[route.method] = cors\n ? withCors(cors, guarded)\n : directOr(guarded, route, read, status, onError, chain.length === 0);\n }\n\n if (cors) {\n for (const byMethod of Object.values(routes)) {\n byMethod.OPTIONS = preflight(cors, Object.keys(byMethod));\n }\n }\n\n return routes;\n};\n",
25
25
  "import type { BunRequest } from 'bun';\nimport type {\n RouteInput,\n RouteSchemas,\n StandardSchemaIssue,\n StandardSchemaResult,\n StandardSchemaV1,\n} from '../route/schema.js';\nimport {\n HttpError,\n ValidationError,\n type InputSource,\n type ValidationIssue,\n} from './errors.js';\nimport { HttpStatusCode } from './status.js';\n\n/**\n * Built once per route at boot. A route that declares nothing gets the identity\n * reader - no parse, no validation, not even a promise.\n *\n * A reader **returns a promise only when it has something to wait for**. A `body`\n * schema always does; `query` and `params` against a synchronous validator - which\n * zod, Valibot and ArkType all are - resolve without one.\n */\nexport type InputReader = (req: BunRequest) => RouteInput | Promise<RouteInput>;\n\ninterface InputDraft {\n req: BunRequest;\n body?: unknown;\n query?: unknown;\n params?: unknown;\n}\n\n/**\n * One declared schema's contribution to the draft, returning the draft so the\n * steps chain without a wrapper. A bare `InputDraft` means it finished\n * synchronously, which is the common case and the reason this is not `async`:\n * Standard Schema *permits* a promise, so awaiting unconditionally costs an async\n * frame and a microtask tick per schema for a validator that never returns one.\n */\ntype Fill = (draft: InputDraft) => InputDraft | Promise<InputDraft>;\ntype BodyParser = (req: BunRequest) => Promise<unknown>;\n\n/** What `URLSearchParams` and `FormData` both offer, and all {@link grouped} needs. */\ninterface Enumerable {\n forEach(visit: (value: unknown, key: string) => void): void;\n}\n\n/**\n * A repeated key becomes an array, so `?tag=a&tag=b` reaches the schema whole\n * instead of silently losing `a`. Shared by query strings, urlencoded bodies and\n * multipart form data.\n *\n * `forEach` rather than `for…of`: both collections implement it natively, and\n * destructuring an iterator allocates a two-element array per entry. Measured at\n * ~150 ns/request cheaper on a three-pair query string.\n */\nconst grouped = (entries: Enumerable): Record<string, unknown> => {\n const collected: Record<string, unknown> = {};\n\n entries.forEach((value, key) => {\n const existing = collected[key];\n if (existing === undefined) collected[key] = value;\n else if (Array.isArray(existing)) (existing as unknown[]).push(value);\n else collected[key] = [existing, value];\n });\n\n return collected;\n};\n\nconst asJson: BodyParser = (req) => req.json();\nconst asUrlEncoded: BodyParser = async (req) =>\n grouped(new URLSearchParams(await req.text()));\nconst asMultipart: BodyParser = async (req) => grouped(await req.formData());\nconst asText: BodyParser = (req) => req.text();\n\n/** `application/vnd.api+json` and friends parse as JSON; `text/csv` as text. */\nconst parserFor = (media: string): BodyParser | undefined => {\n if (media === 'application/json' || media.endsWith('+json')) return asJson;\n if (media === 'application/x-www-form-urlencoded') return asUrlEncoded;\n if (media === 'multipart/form-data') return asMultipart;\n if (media.startsWith('text/')) return asText;\n return undefined;\n};\n\nconst JSON_MEDIA = 'application/json';\n\n// No content-type reads as JSON: fetch omits the header for a bodyless request and\n// a 415 there would be useless, since the schema is about to reject `undefined`.\nconst mediaTypeOf = (req: BunRequest): string => {\n const header = req.headers.get('content-type');\n // The header almost every JSON client sends, verbatim - worth not slicing,\n // trimming and lowercasing on the hot path.\n if (header === JSON_MEDIA || header === null) return JSON_MEDIA;\n const end = header.indexOf(';');\n const media = (end === -1 ? header : header.slice(0, end)).trim();\n return media === '' ? JSON_MEDIA : media.toLowerCase();\n};\n\nconst flatten = (issue: StandardSchemaIssue): ValidationIssue => {\n const path = issue.path\n ?.map((segment) =>\n String(typeof segment === 'object' ? segment.key : segment),\n )\n .join('.');\n\n return path === undefined || path === ''\n ? { message: issue.message }\n : { message: issue.message, path };\n};\n\n/** A rejected schema is a 400 carrying every issue, path flattened to dots. */\nconst accept = (source: InputSource, result: StandardSchemaResult<unknown>) => {\n if (result.issues !== undefined) {\n throw new ValidationError(source, result.issues.map(flatten));\n }\n return result.value;\n};\n\n/**\n * Validates, assigns, and hands the draft back. Returning the draft rather than\n * `void` is what lets the reader be `(req) => fill({ req })`: a body route then\n * costs one promise link in total, where threading the draft back through a second\n * `then` cost two - worth ~120 ns per request, measured.\n */\nconst fillWith = (\n draft: InputDraft,\n source: InputSource,\n schema: StandardSchemaV1,\n value: unknown,\n): InputDraft | Promise<InputDraft> => {\n const result = schema['~standard'].validate(value);\n\n if (result instanceof Promise) {\n return result.then((settled) => {\n draft[source] = accept(source, settled);\n return draft;\n });\n }\n draft[source] = accept(source, result);\n return draft;\n};\n\nconst bodyFill =\n (schema: StandardSchemaV1): Fill =>\n (draft) => {\n const media = mediaTypeOf(draft.req);\n const parse = parserFor(media);\n\n if (parse === undefined) {\n throw new HttpError(\n HttpStatusCode.UNSUPPORTED_MEDIA_TYPE,\n `Unsupported content type \"${media}\". Declared bodies accept ` +\n 'application/json, application/x-www-form-urlencoded, multipart/form-data or text/*.',\n );\n }\n\n // Both handlers on one `then`, so the parse costs a single promise link. A\n // `ValidationError` from the success handler is deliberately not visible to the\n // rejection handler - only an unreadable or mangled body is a parse failure.\n return parse(draft.req).then(\n (value) => fillWith(draft, 'body', schema, value),\n (error: unknown) => {\n // A body the caller mangled is a 400. Only an unreadable stream would be ours.\n throw new HttpError(\n HttpStatusCode.BAD_REQUEST,\n `Malformed ${media} body`,\n { cause: error },\n );\n },\n );\n };\n\n/**\n * The query string, without parsing the whole URL to reach it. `new URL(req.url)`\n * resolves scheme, host, port, path and fragment to hand back a `searchParams`, and\n * measured **~1,000 ns of the ~1,500 ns** a `query` route used to cost - more than\n * the entire body reader. `RequestLoggingMiddleware` took the same slice for the\n * same reason.\n *\n * The fragment is stripped even though a client is not supposed to send one, because\n * `new URL` stripped it and a hostile request-target should not change what a schema\n * sees.\n */\nconst searchOf = (url: string): string => {\n const start = url.indexOf('?');\n if (start === -1) return '';\n const end = url.indexOf('#', start + 1);\n return end === -1 ? url.slice(start + 1) : url.slice(start + 1, end);\n};\n\nconst queryFill =\n (schema: StandardSchemaV1): Fill =>\n (draft) => {\n const params = new URLSearchParams(searchOf(draft.req.url));\n return fillWith(draft, 'query', schema, grouped(params));\n };\n\nconst paramsFill =\n (schema: StandardSchemaV1): Fill =>\n (draft) =>\n fillWith(draft, 'params', schema, draft.req.params);\n\n/** Sequential, and stays sequential without a promise unless one is produced. */\nconst then =\n (first: Fill, second: Fill): Fill =>\n (draft) => {\n const started = first(draft);\n return started instanceof Promise ? started.then(second) : second(started);\n };\n\n/**\n * Folds the declared schemas into a single closure, the way `compose` folds\n * middleware: which parsers and validators run is decided here, at boot, so per\n * request there is no metadata to read and no branch left to take.\n */\nexport const buildInputReader = (\n options: RouteSchemas | undefined,\n): InputReader => {\n const fills: Fill[] = [];\n if (options?.body !== undefined) fills.push(bodyFill(options.body));\n if (options?.query !== undefined) fills.push(queryFill(options.query));\n if (options?.params !== undefined) fills.push(paramsFill(options.params));\n\n if (fills.length === 0) return (req) => ({ req });\n\n const fill = fills.reduce(then);\n return (req) => fill({ req });\n};\n",
@@ -28,7 +28,7 @@
28
28
  "import { HandlerKind, markGateway, markHandler } from './marker.js';\n\ntype GatewayTarget = abstract new (...args: never[]) => object;\n// never[] is what makes an arbitrary method signature assignable, so a handler\n// may declare the payload type it expects. See the README, \"Typed payloads\".\ntype HandlerMethod = (...args: never[]) => unknown;\n\nexport const Gateway =\n (path = '/') =>\n <T extends GatewayTarget>(target: T): T => {\n markGateway(target, path);\n return target;\n };\n\nconst lifecycle =\n (kind: HandlerKind) =>\n () =>\n <T extends HandlerMethod>(value: T): T => {\n markHandler(value, { kind, event: undefined });\n return value;\n };\n\n/** Runs before the socket exists. Return a `Response` to refuse the upgrade. */\nexport const OnUpgrade = lifecycle(HandlerKind.UPGRADE);\nexport const OnOpen = lifecycle(HandlerKind.OPEN);\nexport const OnClose = lifecycle(HandlerKind.CLOSE);\nexport const OnDrain = lifecycle(HandlerKind.DRAIN);\nexport const OnPing = lifecycle(HandlerKind.PING);\nexport const OnPong = lifecycle(HandlerKind.PONG);\n\n/**\n * With an event name, the handler is routed the `data` of any\n * `{\"event\":\"<name>\",\"data\":...}` frame. With none, it is the raw catch-all and\n * receives every frame no named handler claimed.\n */\nexport const OnMessage =\n (event?: string) =>\n <T extends HandlerMethod>(value: T): T => {\n markHandler(value, { kind: HandlerKind.MESSAGE, event });\n return value;\n };\n",
29
29
  "import { AppError } from '@dunx/core';\nimport type { PubSubRelay } from './relay.js';\n\n/**\n * The schemes `Bun.RedisClient` accepts. Checked here because Bun takes any string\n * and only fails later, at connect time, as an opaque `Connection closed` - which\n * an absence-tolerant relay would swallow, turning a typo into silent single-node\n * fan-out.\n */\nconst PROTOCOLS: readonly string[] = [\n 'redis:',\n 'rediss:',\n 'valkey:',\n 'valkeys:',\n 'redis+tls:',\n 'redis+unix:',\n 'redis+tls+unix:',\n];\n\n/** The same fallback chain `Bun.RedisClient` uses when given no URL. */\nexport const defaultRelayUrl = (): string =>\n process.env['VALKEY_URL'] ??\n process.env['REDIS_URL'] ??\n 'redis://localhost:6379';\n\nexport interface RedisRelayOptions {\n /** @default `$VALKEY_URL`, `$REDIS_URL`, then `redis://localhost:6379` */\n readonly url?: string;\n /**\n * Bun's reconnection budget.\n *\n * `0` by default, and that default is not a preference: a `Bun.RedisClient` that\n * never connects keeps an internal retry timer alive past `close()`, and the\n * process then never exits. A relay is exactly the connection most likely to be\n * absent - a single-node deployment with `REDIS_URL` left over from staging -\n * so the default has to be the one that lets the app boot, degrade, and still\n * exit. Raise it when Redis is a hard requirement and you want Bun to reconnect\n * for you.\n *\n * @default 0\n */\n readonly maxRetries?: number;\n /** @default 10000 */\n readonly connectionTimeout?: number;\n readonly tls?: boolean | Bun.TLSOptions;\n}\n\nconst assertUrl = (url: string): string => {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n throw new AppError(\n `${JSON.stringify(url)} is not a valid URL for the websocket relay. ` +\n 'Expected something like redis://localhost:6379.',\n );\n }\n if (!PROTOCOLS.includes(parsed.protocol)) {\n throw new AppError(\n `Unsupported protocol ${JSON.stringify(parsed.protocol)} in ` +\n `${JSON.stringify(url)}. Expected one of ${PROTOCOLS.join(', ')}.`,\n );\n }\n return url;\n};\n\n/**\n * A {@link PubSubRelay} on `Bun.RedisClient` - a Bun global, so this costs\n * `@dunx/http` no dependency at all.\n *\n * **Two connections, not one.** A client in subscriber mode rejects every data\n * command, and throws synchronously doing it, so the subscription cannot share the\n * socket that publishes. This is the same split the socket.io Redis adapter makes\n * with its `pubClient` / `subClient`.\n *\n * Both are opened lazily, on the first call that needs them, and a failed one is\n * discarded so the next call builds a fresh connection rather than reusing a dead\n * one.\n */\nexport class RedisRelay implements PubSubRelay {\n readonly #url: string;\n readonly #options: Bun.RedisOptions;\n #pub: Bun.RedisClient | undefined;\n #sub: Bun.RedisClient | undefined;\n /** Remembered only so `close()` can leave subscriber mode. See `close()`. */\n #channel: string | undefined;\n\n constructor(options: RedisRelayOptions = {}) {\n this.#url = assertUrl(options.url ?? defaultRelayUrl());\n this.#options = {\n maxRetries: options.maxRetries ?? 0,\n ...(options.connectionTimeout !== undefined && {\n connectionTimeout: options.connectionTimeout,\n }),\n ...(options.tls !== undefined && { tls: options.tls }),\n };\n }\n\n /** The URL with any password removed, for logs and error messages. */\n get url(): string {\n const parsed = new URL(this.#url);\n if (parsed.password) parsed.password = '***';\n return parsed.toString();\n }\n\n async publish(channel: string, message: string): Promise<number> {\n const client = (this.#pub ??= new Bun.RedisClient(\n this.#url,\n this.#options,\n ));\n try {\n return await client.publish(channel, message);\n } catch (error) {\n if (this.#pub === client) {\n this.#pub = undefined;\n client.close();\n }\n throw error;\n }\n }\n\n async subscribe(\n channel: string,\n listener: (message: string) => void,\n ): Promise<void> {\n const client = (this.#sub ??= new Bun.RedisClient(\n this.#url,\n this.#options,\n ));\n try {\n // `connect()` before `subscribe()`, and that order is load-bearing too:\n // measured on Bun 1.3.14, a `subscribe()` that cannot reach the server\n // leaves the client holding the event loop open even after `close()` and\n // even with `maxRetries: 0`, so an app pointed at an absent broker would\n // never exit. Failing at `connect()` instead releases cleanly, and says\n // `Connection closed` rather than `Max reconnection attempts reached`.\n await client.connect();\n await client.subscribe(channel, listener);\n this.#channel = channel;\n } catch (error) {\n if (this.#sub === client) {\n this.#sub = undefined;\n client.close();\n }\n throw error;\n }\n }\n\n /**\n * `UNSUBSCRIBE` before `close()`, and that order is load-bearing: measured on\n * Bun 1.3.14, a `Bun.RedisClient` left in subscriber mode keeps the process\n * alive after `close()`, so an app that shut down cleanly would never exit.\n * Leaving subscriber mode first fixes it. Recorded in docs/bun-apis.md.\n */\n async close(): Promise<void> {\n const sub = this.#sub;\n const channel = this.#channel;\n this.#pub?.close();\n this.#pub = undefined;\n this.#sub = undefined;\n this.#channel = undefined;\n if (!sub) return;\n if (channel !== undefined) {\n try {\n await sub.unsubscribe(channel);\n } catch {\n // A socket that is already gone is not in subscriber mode either, and\n // throwing here would leave the connection below unclosed.\n }\n }\n sub.close();\n }\n}\nObject.defineProperty(RedisRelay, Symbol.for('dunx.deps'), {\n value: () => [{ unresolved: \"options: RedisRelayOptions = {}\" }],\n});\n"
30
30
  ],
31
- "mappings": ";;AAMA,IAAM,QAAQ,OAAO,IAAI,YAAY;AACrC,IAAM,a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;AAAA,OAUJ,MAAK,GAAkB;AAAA,IAC3B,MAAM,MAAM,KAAK;AAAA,IACjB,MAAM,UAAU,KAAK;AAAA,IACrB,KAAK,MAAM,MAAM;AAAA,IACjB,KAAK,OAAO;AAAA,IACZ,KAAK,OAAO;AAAA,IACZ,KAAK,WAAW;AAAA,IAChB,IAAI,CAAC;AAAA,MAAK;AAAA,IACV,IAAI,YAAY,WAAW;AAAA,MACzB,IAAI;AAAA,QACF,MAAM,IAAI,YAAY,OAAO;AAAA,QAC7B,MAAM;AAAA,IAIV;AAAA,IACA,IAAI,MAAM;AAAA;AAEd;AACA,OAAO,eAAe,YAAY,OAAO,IAAI,WAAW,GAAG;AAAA,EACzD,OAAO,MAAM,CAAC,EAAE,YAAY,kCAAkC,CAAC;AACjE,CAAC;",
32
+ "debugId": "F568FED96394ED7164756E2164756E21",
33
33
  "names": []
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dunx/http",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Bun.serve adapter for the dunx framework: controllers, middleware and WebSocket gateways",
5
5
  "keywords": [
6
6
  "bun",
@@ -51,7 +51,7 @@
51
51
  "@dunx/core": "workspace:*"
52
52
  },
53
53
  "peerDependencies": {
54
- "@dunx/core": "^0.2.6",
54
+ "@dunx/core": "^0.2.8",
55
55
  "@types/bun": ">=1.3.0"
56
56
  },
57
57
  "peerDependenciesMeta": {