oas
Version:
Comprehensive tooling for working with OpenAPI definitions
39 lines (36 loc) • 1.57 kB
text/typescript
import { OASDocument } from '../types.cjs';
import { AnalyzerQuery, OASAnalysis } from './types.cjs';
import 'json-schema';
import 'openapi-types';
/**
* Analyze a given OpenAPI or Swagger definition for any, or a specific, OpenAPI or JSON Schema
* feature uses it may contain or utilize.
*
*/
declare function analyzer(definition: OASDocument, query?: AnalyzerQuery[]): Promise<OASAnalysis>;
/**
* Analyze a single operation within a given OpenAPI definition for any, or a specific, OpenAPI or
* JSON Schema feature uses that it, or anything it references, may contain or utilize.
*
* When analyzing many operations out of the same definition, pass the *same* `definition`
* reference to every call — the expensive dereferencing and document-wide JSONPath scans that this
* relies on are cached against that reference, so only the first call pays for them.
*
*/
declare function analyzeOperation(definition: OASDocument, { path, method, query, }: {
path: string;
method: string;
query?: AnalyzerQuery[];
}): Promise<OASAnalysis>;
/**
* Analyze a single webhook operation within a given OpenAPI 3.1 definition for any, or a specific,
* OpenAPI or JSON Schema feature uses that it, or anything it references, may contain or utilize.
*
* @see {@link analyzeOperation}
*/
declare function analyzeWebhookOperation(definition: OASDocument, { webhookName, method, query, }: {
webhookName: string;
method: string;
query?: AnalyzerQuery[];
}): Promise<OASAnalysis>;
export { analyzeOperation, analyzeWebhookOperation, analyzer };