export declare const PROXY_ROUTING_INVALIDATION_PATH = "/_proxy/internal/routing-invalidation"; export declare const PROXY_ROUTING_INVALIDATION_PLATFORM = "proxy-routing"; export declare const PROXY_ROUTING_INVALIDATION_SUBJECT = "deployment-routing-invalidation"; export interface ProxyRoutingInvalidationRequest { readonly version: 1; readonly projectId: string; readonly projectSlug: string; readonly deploymentId: string; readonly environmentId: string; readonly environmentName: string; readonly releaseId: string; } export interface ProxyRoutingInvalidationEvent extends ProxyRoutingInvalidationRequest { readonly eventId: string; } export interface ProxyRoutingInvalidationPublishResult { readonly acknowledged: number; readonly converged: boolean; readonly recipients: number; } export interface ProxyRoutingInvalidationPublisher { publish(event: ProxyRoutingInvalidationEvent): Promise; } /** * Warning sink for rejected invalidations. * * Structurally compatible with `proxyLogger`, which is what `src/proxy/main.ts` * passes in. */ export interface ProxyRoutingInvalidationLogger { warn(message: string, extra?: Record): void; } /** * Coalescer for rejection warnings. * * This endpoint sits on the public listener with no source-IP guard, so an * unauthenticated caller can drive one log write per request. Without this, * every rejection is a separate line in the log pipeline. */ export interface ProxyRoutingInvalidationRejectionThrottle { /** * Open a warning window for `rejectionClass`, or coalesce into the window * that is already open. * * Returns the number of warnings coalesced away since the previous emission, * or `null` when this rejection should stay silent. */ admit(rejectionClass: string): number | null; } interface ProxyRoutingInvalidationHandlerOptions { bodyReadTimeoutMs?: number; createEventId?: () => string; logger?: ProxyRoutingInvalidationLogger; publicKeyPem?: string; publisher: ProxyRoutingInvalidationPublisher | null; /** * Omit to warn on every rejection. `src/proxy/main.ts` passes one so a flood * against the public listener cannot flood the log pipeline with it. */ rejectionThrottle?: ProxyRoutingInvalidationRejectionThrottle; } /** * Build a rejection throttle that emits at most one warning per class per * window and counts the rest. * * The first rejection of a class always warns, so a new failure mode is never * hidden — this endpoint stayed inert for a month precisely because rejections * were silent, and suppressing the first occurrence would rebuild that trap. * Repeats inside the window are counted and reported on the next emission. * * Classes are bounded and never caller-chosen (see `classifySignatureRejection`), * but the tracking map is capped anyway: an unforeseen error type carrying a * dynamic `name` must not turn this into a memory leak. */ export declare function createProxyRoutingInvalidationRejectionThrottle(options?: { nowMs?: () => number; windowMs?: number; }): ProxyRoutingInvalidationRejectionThrottle; export declare function parseProxyRoutingInvalidationRequest(body: string): ProxyRoutingInvalidationRequest | null; export declare function parseProxyRoutingInvalidationEvent(value: unknown): ProxyRoutingInvalidationEvent | null; export declare function parseProxyRoutingInvalidationPublishResult(value: unknown): ProxyRoutingInvalidationPublishResult | null; export declare function handleProxyRoutingInvalidationRequest(req: Request, options: ProxyRoutingInvalidationHandlerOptions): Promise; export {}; //# sourceMappingURL=routing-invalidation.d.ts.map