UNPKG

openapi-graph-core

Version:

A TS library to manage large API projects defined by OpenAPIv3 specification.

33 lines (32 loc) 1.38 kB
/** * The main goal is to find all openAPI specification given a path. * Therefore, it will loop over all files and creating a structured object * as a result * */ import { OpenAPIContent } from 'openapi-graph-types'; export declare function fetcher(paths: string[]): Promise<OpenAPIContent[]>; export declare function fetcher(path: string): Promise<OpenAPIContent[]>; /** * Finds all the valid OpenApi specifications given a directory and returns a * list of all the specification contents * * @param projectPath of the project where the specifications are suppose to be * @returns a list of OpenAPIContent which has the path, openAPI version * and the content for every specification found inside of the given path */ declare function loadsSwaggerFiles(projectPath: string): Promise<OpenAPIContent[]>; declare function getFiles(fromPath?: string, paths?: string[]): Promise<string[]>; /** * reads the contents of all given paths. The files will be validated. * * @param paths of the .yaml|.yml files. The paths should exists. * @returns the contents of the files as JSON with their path */ declare function getOpenApisContent(paths: string[]): Promise<OpenAPIContent[]>; export declare const testables: { loadsSwaggerFiles: typeof loadsSwaggerFiles; getFiles: typeof getFiles; getOpenApisContent: typeof getOpenApisContent; }; export {};