import { m as JsonObject } from "../types-BBQaEPfE.mjs"; import { i as DiagnosticsOptions } from "../diagnostics-mftUZI7c.mjs"; //#region src/openapi/parser.d.ts /** * Parsed OpenAPI document: the raw root JSON plus a cache of resolved * `#/components/schemas/*` (or Swagger 2.0 `#/definitions/*`) entries. * Produced by {@link parseOpenApiDocument} and consumed by every other * parser/resolver helper in this module. */ interface OpenApiDocument { doc: JsonObject; schemas: Map; } /** * Lightweight summary of an OpenAPI operation: its location, identity, * description fields, deprecation flag, and the underlying Operation * Object. Returned by {@link listOperations} / {@link listAllOperations}. */ interface OperationInfo { path: string; method: string; operationId: string | undefined; summary: string | undefined; description: string | undefined; deprecated: boolean; operation: JsonObject; } /** Canonical four-value OpenAPI parameter `in` location. */ type ParameterLocation = "query" | "path" | "header" | "cookie"; /** * Parsed view of an OpenAPI Parameter Object — name, location, * required flag, deprecation flag, description, and resolved schema. */ interface ParameterInfo { name: string; location: ParameterLocation; required: boolean; deprecated: boolean; description: string | undefined; schema: JsonObject | undefined; } /** * Parsed view of an OpenAPI Response Object — status code, description, * declared content types, response schema, and resolved headers. */ interface ResponseInfo { statusCode: string; description: string | undefined; contentTypes: string[]; schema: JsonObject | undefined; headers: Map; } /** * Parsed view of an OpenAPI Request Body Object — required flag, * description, declared content types, and the request body schema. */ interface RequestBodyInfo { required: boolean; description: string | undefined; contentTypes: string[]; schema: JsonObject | undefined; } /** * A single entry in an OpenAPI Security Requirement Object — the name * of a security scheme paired with its list of required scopes. */ interface SecurityRequirement { name: string; scopes: string[]; } /** * Parsed view of an OpenAPI Security Scheme Object covering every * field defined for `apiKey`, `http`, `oauth2`, `openIdConnect`, and * `mutualTLS` schemes. */ interface SecurityScheme { type: string | undefined; description: string | undefined; name: string | undefined; location: string | undefined; scheme: string | undefined; bearerFormat: string | undefined; flows: JsonObject | undefined; openIdConnectUrl: string | undefined; } /** * Parsed view of an OpenAPI Header Object — name, description, required * and deprecated flags, and resolved schema. */ interface HeaderInfo { name: string; description: string | undefined; required: boolean; deprecated: boolean; schema: JsonObject | undefined; } /** * Parsed view of a single OpenAPI 3.1 webhook entry: its name and the * operations declared on its Path Item Object. */ interface WebhookInfo { name: string; operations: OperationInfo[]; } /** Parsed view of an OpenAPI External Documentation Object. */ interface ExternalDocs { url: string; description: string | undefined; } /** * Parsed view of an OpenAPI XML Object — controls how a schema field * is serialised in an XML payload. */ interface XmlInfo { name: string | undefined; namespace: string | undefined; prefix: string | undefined; attribute: boolean; wrapped: boolean; } /** * Parsed view of a single OpenAPI Callback Object: its name and the * operations declared on every callback path. */ interface CallbackInfo { name: string; operations: OperationInfo[]; } /** * Parsed view of an OpenAPI Link Object — name, target operation * (`operationId` or `operationRef`), description, parameter mappings, * and the optional request body expression. */ interface LinkInfo { name: string; operationId: string | undefined; operationRef: string | undefined; description: string | undefined; parameters: Map; requestBody: string | undefined; } /** * Build an {@link OpenApiDocument} from a raw OpenAPI JSON object. * * Eagerly indexes the document's `#/components/schemas/*` entries and * lazily caches any other `$ref` lookup on first request. Used by * every other helper in this module as the single entry point for * structured access to an OpenAPI document. */ declare function parseOpenApiDocument(doc: JsonObject): OpenApiDocument; /** * Resolve a `$ref` string against a parsed OpenAPI document. Returns * the cached entry for `#/components/schemas/*` refs (or the lazily * resolved value for arbitrary fragment refs), or `undefined` when the * ref cannot be resolved. */ declare function extractSchema(parsed: OpenApiDocument, ref: string): JsonObject | undefined; /** * List every operation declared under the document's `paths` map. * Follows Path Item `$ref` chains internally; cycles and over-deep * chains surface as diagnostics when a sink is supplied. */ declare function listOperations(parsed: OpenApiDocument, diagnostics?: DiagnosticsOptions, seenIds?: Map): OperationInfo[]; /** * Resolve the parameters of a single operation, merging path-level * parameters with operation-level overrides and following any * Parameter Object `$ref` chains. */ declare function extractParameters(parsed: OpenApiDocument, path: string, method: string, diagnostics?: DiagnosticsOptions): ParameterInfo[]; /** * Resolve the request body of a single operation, including its * declared content types and schema. Returns `undefined` when the * operation declares no request body. */ declare function extractRequestBody(parsed: OpenApiDocument, path: string, method: string): RequestBodyInfo | undefined; /** * Resolve the responses of a single operation, returning one * {@link ResponseInfo} per declared status code (including class * wildcards and `default`). */ declare function extractResponses(parsed: OpenApiDocument, path: string, method: string, diagnostics?: DiagnosticsOptions): ResponseInfo[]; /** * Resolve the effective security requirements for a single operation. * Operation-level requirements override the document-level defaults * when present. */ declare function extractSecurityRequirements(parsed: OpenApiDocument, path: string, method: string): SecurityRequirement[]; /** * Read the document's `components.securitySchemes` map as a map of * scheme names to {@link SecurityScheme} entries. */ declare function extractSecuritySchemes(parsed: OpenApiDocument): Map; /** * Resolve the headers of a single OpenAPI Response Object as a map of * header name to {@link HeaderInfo}. Follows Header Object `$ref` * chains via the optional document root. */ declare function extractResponseHeaders(response: JsonObject, doc?: JsonObject, diagnostics?: DiagnosticsOptions): Map; /** * List every OpenAPI 3.1 webhook declared under the document's * `webhooks` map, each with its name and resolved operations. */ declare function listWebhooks(parsed: OpenApiDocument, diagnostics?: DiagnosticsOptions, seenIds?: Map): WebhookInfo[]; /** * Enumerate every operation in the document — both the `paths` map and * the OpenAPI 3.1 `webhooks` map — sharing a single `seenIds` cache so * cross-list `operationId` collisions surface the same way as same-list * collisions. Returns the path-operation list followed by webhook * operations (flattened); callers that need the structured webhook * grouping should call `listWebhooks` directly. */ declare function listAllOperations(parsed: OpenApiDocument, diagnostics?: DiagnosticsOptions): OperationInfo[]; /** * Read the optional `externalDocs` field on an OpenAPI object * (document, operation, tag, schema, ...) into an {@link ExternalDocs} * record. Returns `undefined` when absent or malformed. */ declare function extractExternalDocs(obj: JsonObject): ExternalDocs | undefined; /** * Read the optional `xml` keyword on a JSON Schema object into an * {@link XmlInfo} record describing how the field is serialised in an * XML payload. Returns `undefined` when absent or malformed. */ declare function extractXmlInfo(schema: JsonObject): XmlInfo | undefined; /** * List the OpenAPI callback definitions declared on a single * operation. Each entry carries the callback name and the operations * declared on its Path Item Object. */ declare function listCallbacks(parsed: OpenApiDocument, path: string, method: string, diagnostics?: DiagnosticsOptions): CallbackInfo[]; /** * List the OpenAPI link definitions declared on a specific response of * a single operation, returning each link's parsed * {@link LinkInfo} entry. */ declare function extractLinks(parsed: OpenApiDocument, path: string, method: string, statusCode: string, diagnostics?: DiagnosticsOptions): LinkInfo[]; //#endregion export { CallbackInfo, ExternalDocs, HeaderInfo, LinkInfo, OpenApiDocument, OperationInfo, ParameterInfo, ParameterLocation, RequestBodyInfo, ResponseInfo, SecurityRequirement, SecurityScheme, WebhookInfo, XmlInfo, extractExternalDocs, extractLinks, extractParameters, extractRequestBody, extractResponseHeaders, extractResponses, extractSchema, extractSecurityRequirements, extractSecuritySchemes, extractXmlInfo, listAllOperations, listCallbacks, listOperations, listWebhooks, parseOpenApiDocument };