import SwaggerParser from "@apidevtools/swagger-parser"; import { OpenAPIV3 } from "openapi-types"; import { APIInfo, GenerateResult, ParseOptions, ValidateResult, ListAPIResult } from "./interfaces"; /** * A class that parses an OpenAPI specification file and provides methods to validate, list, and generate artifacts. */ export declare class SpecParser { readonly pathOrSpec: string | OpenAPIV3.Document; readonly parser: SwaggerParser; readonly options: Required; private spec; private validator; private unResolveSpec; private isSwaggerFile; private defaultOptions; /** * Creates a new instance of the SpecParser class. * @param pathOrDoc The path to the OpenAPI specification file or the OpenAPI specification object. * @param options The options for parsing the OpenAPI specification file. */ constructor(pathOrDoc: string | OpenAPIV3.Document, options?: ParseOptions); /** * Validates the OpenAPI specification file and returns a validation result. * * @returns A validation result object that contains information about any errors or warnings in the specification file. */ validate(): Promise; listSupportedAPIInfo(): Promise; /** * Lists all the OpenAPI operations in the specification file. * @returns A string array that represents the HTTP method and path of each operation, such as ['GET /pets/{petId}', 'GET /user/{userId}'] * according to copilot plugin spec, only list get and post method without auth */ list(): Promise; /** * Generate specs according to the filters. * @param filter An array of strings that represent the filters to apply when generating the artifacts. If filter is empty, it would process nothing. */ getFilteredSpecs(filter: string[], signal?: AbortSignal): Promise<[OpenAPIV3.Document, OpenAPIV3.Document]>; /** * Generates and update artifacts from the OpenAPI specification file. Generate Adaptive Cards, update Teams app manifest, and generate a new OpenAPI specification file. * @param manifestPath A file path of the Teams app manifest file to update. * @param filter An array of strings that represent the filters to apply when generating the artifacts. If filter is empty, it would process nothing. * @param outputSpecPath File path of the new OpenAPI specification file to generate. If not specified or empty, no spec file will be generated. * @param pluginFilePath File path of the api plugin file to generate. */ generateForCopilot(manifestPath: string, filter: string[], outputSpecPath: string, pluginFilePath: string, signal?: AbortSignal): Promise; /** * Generates and update artifacts from the OpenAPI specification file. Generate Adaptive Cards, update Teams app manifest, and generate a new OpenAPI specification file. * @param manifestPath A file path of the Teams app manifest file to update. * @param filter An array of strings that represent the filters to apply when generating the artifacts. If filter is empty, it would process nothing. * @param outputSpecPath File path of the new OpenAPI specification file to generate. If not specified or empty, no spec file will be generated. * @param adaptiveCardFolder Folder path where the Adaptive Card files will be generated. If not specified or empty, Adaptive Card files will not be generated. * @param isMe Boolean that indicates whether the project is an Messaging Extension. For Messaging Extension, composeExtensions will be added in Teams app manifest. */ generate(manifestPath: string, filter: string[], outputSpecPath: string, adaptiveCardFolder?: string, signal?: AbortSignal): Promise; private loadSpec; private getAPIs; private getValidator; }