type HealthStatus = 'connected' | 'disconnected' | 'unknown'; type HealthResult = Record; /** * Postgres health probe: returns `{ postgres: 'connected' }` when the pool's * connection test succeeds, `{ postgres: 'disconnected' }` on any error or * timeout (so `/ready` correctly reports 503). Use as (part of) the * `checkDependencies` option of `createApp()` for any service backed by the * shared pipeline-data Drizzle connection. */ export declare function postgresHealthCheck(timeoutMs?: number): Promise; /** Minimal shape of an ioredis client needed for a health PING. */ interface RedisLike { ping(): Promise; } /** * Source of a redis client: either the client itself, or a (sync/async) getter. * The getter form supports BullMQ's `queue.client` (a `Promise`) * so a service can probe the exact connection its queue uses without opening * a second one. */ type RedisClientSource = RedisLike | (() => RedisLike | Promise); /** * Redis health probe factory: pass the service's EXISTING ioredis connection * (or a getter for it — e.g. `() => queue.client`) and get back a * `checkDependencies` callback that `PING`s it. Mirrors `mongoHealthCheck` — * it probes the real connection rather than opening a throwaway one per call. * The PING is time-boxed so a down redis (whose offline queue would otherwise * buffer the command) reports `disconnected` quickly instead of hanging. */ export declare function redisHealthCheck(source: RedisClientSource, timeoutMs?: number): () => Promise; /** * Combine several dependency probes into one `checkDependencies` callback that * runs them IN PARALLEL and merges their results. A slow/failed probe can't * delay the others or time out the whole `/ready` response. * * CONTRACT: each probe must CATCH internally and RETURN its `{ name: status }` * (as the built-in postgres/redis/mongo probes do). A probe that THROWS is * merged as `{}` — its dependency then vanishes from the map and `/ready` * reports 200 with the dep simply absent (a silent false-healthy), rather than * surfacing it as `disconnected`. The `.catch(() => ({}))` below only exists so * one misbehaving probe can't take down the others, NOT as a substitute for a * probe returning its own disconnected status. */ export declare function combineHealthChecks(...checks: Array<() => Promise>): () => Promise; /** * Minimal shape expected of a mongoose connection for the health probe. * Accepts `mongoose.connection` directly without requiring mongoose as a * dependency of api-server. */ interface MongooseConnectionLike { readyState: number; } /** * MongoDB health probe factory: pass `mongoose.connection` and get back a * `checkDependencies` callback that reports based on mongoose's readyState. * * Mapping (per mongoose docs): 1=connected, 2=connecting, 3=disconnecting, * any other value (0=disconnected, 99=uninitialized) is treated as * 'disconnected' so `/health` returns 503. */ export declare function mongoHealthCheck(connection: MongooseConnectionLike): () => Promise; export {};