import { OAS2, OAS3 } from "oas-spec-ts"; import { PontJsonSchema } from "./dataType"; import { Parameter } from "./parameter"; import { ObjectMap } from "./utils"; import { ExternalDocumentationObject } from "oas-spec-ts/lib/oas2.0/swagger2.0"; import { DiffItem } from "./diff"; import _ from "lodash"; export type ResponseObject = { schema?: PontJsonSchema; headers?: OAS2.HeadersObject; description?: string; }; export declare class PontAPI { name?: string; consumes?: string[]; produces?: string[]; parameters?: Parameter[]; description?: string; responses: { [key: string]: ResponseObject; }; method: string; title?: string; summary?: string; path: string; deprecated?: boolean; ext?: any; security?: Array<{ [x: string]: string[]; }>; externalDocs?: { url?: string; description?: string; }; static getUsedStructNames(api: PontAPI): string[]; } export declare enum PontxDirectoryNodeType { Directory = "directory", Api = "api", Struct = "struct", Overview = "overview", MarkDoc = "MarkDoc", Change = "change" } export declare class PontxDirectoryNode { title?: string; titleIntl?: ObjectMap; children: Array; type: PontxDirectoryNodeType; name: string; static constructorPureApiItems(pontxSpec: PontSpec, namespaceName?: string): PontxDirectoryNode[]; static constructorApiDir(pontxSpec: PontSpec): { type: PontxDirectoryNodeType; name: string; title: string; children: PontxDirectoryNode[]; }[]; static constructorPontxDir(pontxSpec: PontSpec): PontxDirectoryNode[]; static removeNode(dirs: PontxDirectoryNode[], nodeType: PontxDirectoryNodeType, nodeName?: string): any; static getAPIsInDir(dir: PontxDirectoryNode): string[]; } export declare class PontNamespace { title: string; titleIntl?: ObjectMap; } export declare const WithoutModsName: unique symbol; export declare class Mod { name: string | Symbol; interfaces: Array; description?: string; } export declare class AgentTools { prompt: string; } export declare class AgentConfig { tools: AgentTools; } export declare class PontSpec { agent?: AgentConfig; name: string; description?: string; title?: string; version?: string; pontx?: string; definitions: ObjectMap; apis: ObjectMap; namespaces: { [x: string]: PontNamespace; }; basePath?: string; host?: string; servers?: OAS3.ServerObject[]; externalDocs?: ExternalDocumentationObject; envs?: { [x: string]: Partial; }; security?: { [x: string]: string[]; }[]; securitySchemes?: { [x: string]: { type?: "apiKey" | "http" | "oauth2" | "openIdConnect"; description?: string; name?: string; in?: "query" | "header" | "cookie"; scheme?: "basic" | "bearer"; bearerFormat?: string; flows?: { implicit?: { authorizationUrl: string; scopes: { [x: string]: string; }; }; password?: { tokenUrl: string; scopes: { [x: string]: string; }; }; clientCredentials?: { tokenUrl: string; scopes: { [x: string]: string; }; }; authorizationCode?: { authorizationUrl: string; tokenUrl: string; scopes: { [x: string]: string; }; }; }; openIdConnectUrl?: string; }; }; docDirectories?: PontxDirectoryNode[]; style?: "RPC" | "RESTFul" | "GraphQL"; ext?: any; static reOrder(ds: PontSpec): PontSpec; static checkHasMods(spec: PontSpec): boolean; static getNamespaceNames(spec: PontSpec): string[]; static merge(spec1: PontSpec, spec2: PontSpec): PontSpec; static addApi(spec: PontSpec, apiName: string, apiSpec: PontAPI): PontSpec; static addStruct(spec: PontSpec, structName: string, struct: PontAPI): PontSpec; static addMod(spec: PontSpec, namespace: string, title: string): PontSpec; static removeApi(spec: PontSpec, apiName: string): PontSpec; static removeStruct(spec: PontSpec, structName: string): PontSpec; static udpateApi(spec: PontSpec, apiName: string, apiSpec: PontAPI): PontSpec; static reNameApi(spec: PontSpec, fullApiName: string, newFullApiName: string): PontSpec; static reNameStruct(spec: PontSpec, structName: any, newStructName: string): PontSpec; static udpateStruct(spec: PontSpec, structName: string, struct: PontJsonSchema): PontSpec; static getModByName(spec: PontSpec, modName: string): Mod; static getApisInNamespace(spec: PontSpec, namespaceName: string): string[]; static getAllApiGroups(spec: PontSpec): string[]; static getMods(spec: PontSpec): Mod[]; static updateMod(spec: PontSpec, mod: Mod): PontSpec; static removeMod(spec: PontSpec, modName: string): PontSpec; static moveApi(spec: PontSpec, apiName: string, namespace: string): PontSpec; static diff(preSpec: PontSpec, newSpec: PontSpec): DiffItem[]; static diffSpecs(preSpecs: PontSpec[], newSpecs: PontSpec[]): DiffItem[]; static _getSpecInfo(spec: PontSpec): { agent?: AgentConfig; name: string; description?: string; title?: string; version?: string; pontx?: string; basePath?: string; host?: string; servers?: OAS3.ServerObject[]; externalDocs?: OAS2.ExternalDocumentationObject; envs?: { [x: string]: Partial; }; security?: { [x: string]: string[]; }[]; securitySchemes?: { [x: string]: { type?: "apiKey" | "http" | "oauth2" | "openIdConnect"; description?: string; name?: string; in?: "query" | "header" | "cookie"; scheme?: "basic" | "bearer"; bearerFormat?: string; flows?: { implicit?: { authorizationUrl: string; scopes: { [x: string]: string; }; }; password?: { tokenUrl: string; scopes: { [x: string]: string; }; }; clientCredentials?: { tokenUrl: string; scopes: { [x: string]: string; }; }; authorizationCode?: { authorizationUrl: string; tokenUrl: string; scopes: { [x: string]: string; }; }; }; openIdConnectUrl?: string; }; }; docDirectories?: PontxDirectoryNode[]; style?: "RPC" | "RESTFul" | "GraphQL"; ext?: any; } | {}; static getDirsDiff(preSpec: PontSpec, nextSpec: PontSpec): DiffItem[]; static getMetaByKey(spec: PontSpec, key: string): PontJsonSchema | PontAPI | PontNamespace; static getMetasDiff(preSpec: PontSpec, newSpec: PontSpec): DiffItem[]; static pickSpecByControllers(spec: PontSpec, controllers: string[]): PontSpec; static getSubSpecWithController(spec: PontSpec, controllerName: string): PontSpec; static getSubSpecWithAPIKey(spec: PontSpec, apiKey: string): PontSpec; static getSubSpecWithAPI(spec: PontSpec, controllerName: string, apiName: string): PontSpec; static getSubSpecWithStruct(spec: PontSpec, structName: string): PontSpec; static removeUnUsedStructs(spec: PontSpec): { definitions: _.Dictionary; agent?: AgentConfig; name: string; description?: string; title?: string; version?: string; pontx?: string; apis: ObjectMap; namespaces: { [x: string]: PontNamespace; }; basePath?: string; host?: string; servers?: OAS3.ServerObject[]; externalDocs?: OAS2.ExternalDocumentationObject; envs?: { [x: string]: Partial; }; security?: { [x: string]: string[]; }[]; securitySchemes?: { [x: string]: { type?: "apiKey" | "http" | "oauth2" | "openIdConnect"; description?: string; name?: string; in?: "query" | "header" | "cookie"; scheme?: "basic" | "bearer"; bearerFormat?: string; flows?: { implicit?: { authorizationUrl: string; scopes: { [x: string]: string; }; }; password?: { tokenUrl: string; scopes: { [x: string]: string; }; }; clientCredentials?: { tokenUrl: string; scopes: { [x: string]: string; }; }; authorizationCode?: { authorizationUrl: string; tokenUrl: string; scopes: { [x: string]: string; }; }; }; openIdConnectUrl?: string; }; }; docDirectories?: PontxDirectoryNode[]; style?: "RPC" | "RESTFul" | "GraphQL"; ext?: any; }; static getCreatedMetas(preSpec: PontSpec, newSpec: PontSpec): DiffItem[]; static validateLock(ds: PontSpec): string[]; static serialize(ds: PontSpec): string; constructor(ds?: PontSpec); static constructorByName(name: string): PontSpec; static isEmptySpec(spec: PontSpec): boolean; static getClazzCnt(spec: PontSpec): number; } export declare class PontSpecs { static updateSpec(specs: PontSpec[], specName: string, newSpec: PontSpec): PontSpec[]; static checkIsSingleSpec(specs: PontSpec[]): boolean; static getSpecByName: (specs: PontSpec[], specName: string) => PontSpec; static getSpecIndex: (specs: PontSpec[], specName: string) => number; static getUpdateSpecIndex: (specs: PontSpec[], specName: string) => number; } //# sourceMappingURL=type.d.ts.map