@dudousxd/nestjs-telescope
Version:
Laravel Telescope-style observability console for NestJS — core: watchers, recorder, correlation, SQLite store, headless API.
22 lines • 1.17 kB
TypeScript
import type { RequestContent } from '../entry/content.js';
/** Outcome of a request replay (see {@link TelescopeController.replay}). */
export interface ReplayResult {
/** HTTP status of the replayed response, or `0` when the call never completed. */
status: number;
/** Wall-clock duration of the replay in ms. */
durationMs: number;
/** The response body, capped at {@link REPLAY_BODY_CAP} bytes. */
body: string;
/** Present when the replay failed to complete (timeout / network error). */
error?: string;
}
/**
* Re-issue a captured request against the LOCAL server (127.0.0.1:<port>) so a
* developer can reproduce it from the dashboard. The replay carries a
* `x-telescope-replay: 1` header (so the host can recognize/skip it) and strips
* cookie/authorization/host headers — a replay must not silently reuse the
* original caller's credentials. Bounded by a 30s timeout; the body is capped at
* 4 KB. Never throws — a failed call returns `status: 0` with an `error`.
*/
export declare function replayRequest(content: RequestContent, request: unknown): Promise<ReplayResult>;
//# sourceMappingURL=request-replay.d.ts.map