/** * Compare the routes a composed app actually serves against the OpenAPI * document committed for it. * * The committed artifacts are the published contract, but nothing ties them to * the runtime, so a new route, a removed route, or a renamed request field can * all land without the document noticing. Re-exported from `./openapi.js` so * consumers keep one import path. */ import type { OpenApiDocument } from "./openapi.js"; /** * One operation, as `"POST /v1/public/finance/bookings"`. */ export type OperationKey = string; export interface OpenApiCoverageDiff { /** Live routes the committed document does not describe. */ undocumented: OperationKey[]; /** Documented operations no longer served by the runtime. */ stale: OperationKey[]; /** Operations whose documented request fields drifted from the live schema. */ requestDrift: Array<{ operation: OperationKey; onlyInRuntime: string[]; onlyInDocument: string[]; }>; /** Operations whose documented parameters drifted from the live route. */ parameterDrift: Array<{ operation: OperationKey; onlyInRuntime: string[]; onlyInDocument: string[]; }>; } /** * Compare a document generated from the live router against the committed one. * * The committed OpenAPI artifacts are the published contract, but nothing ties * them to the routes actually served — so a new route, a removed route, or a * renamed request field can all land without the document noticing. This * compares the two and names the difference. * * Compares operation presence, request-body field names, and parameters * (name + location + required). Bodies and parameters are compared by name * rather than by full schema: generated and hand-authored schemas describe the * same contract in different but equivalent shapes (`nullable` versus `anyOf`), * so a structural diff would report noise, while a name diff catches the drift * that actually breaks a client. * * What this does NOT verify, so callers do not over-trust a green result: * response shapes, security schemes, and anything behind a `$ref` — a * referenced schema contributes no field names, so two `$ref`s compare equal. */ export declare function diffOpenApiCoverage(input: { /** Document generated from the composed router, with relative paths. */ runtime: OpenApiDocument; /** The committed artifact, with absolute published paths. */ committed: OpenApiDocument; /** Absolute mount the runtime paths hang from, e.g. `/v1/public/finance`. */ prefix: string; /** Operations intentionally absent from the document. */ ignore?: readonly OperationKey[]; }): OpenApiCoverageDiff;