openapi-directory-mcp
Version:
Model Context Protocol server for accessing enhanced triple-source OpenAPI directory (APIs.guru + additional APIs + custom imports)
104 lines • 2.63 kB
TypeScript
/**
* Import manager for custom OpenAPI specifications
* Handles the complete import process including validation, security scanning, and storage
*/
import { ImportOptions, ImportResult, CustomSpecEntry } from "./types.js";
export declare class ImportManager {
private specProcessor;
private manifestManager;
private onSpecChangeCallback;
constructor(onSpecChangeCallback?: () => Promise<void>);
/**
* Import a custom OpenAPI specification
*/
importSpec(options: ImportOptions): Promise<ImportResult>;
/**
* Remove a custom specification
*/
removeSpec(nameOrId: string, version?: string): Promise<{
success: boolean;
message: string;
}>;
/**
* List all custom specifications
*/
listSpecs(): Array<{
id: string;
name: string;
version: string;
title: string;
description: string;
imported: string;
fileSize: number;
securityIssues: number;
format: string;
source: string;
}>;
/**
* Get detailed information about a specific spec
*/
getSpecDetails(nameOrId: string, version?: string): CustomSpecEntry | null;
/**
* Rescan security for a specific spec
*/
rescanSecurity(nameOrId: string, version?: string): Promise<{
success: boolean;
message: string;
securityScan?: any;
}>;
/**
* Get statistics about custom specs
*/
getStats(): {
totalSpecs: number;
totalSize: number;
byFormat: {
yaml: number;
json: number;
};
bySource: {
file: number;
url: number;
};
lastUpdated: string;
};
/**
* Validate integrity of custom specs
*/
validateIntegrity(): {
valid: boolean;
issues: string[];
};
/**
* Repair integrity issues
*/
repairIntegrity(): {
repaired: string[];
failed: string[];
};
/**
* Validate import options
*/
private validateImportOptions;
/**
* Quick validation of a spec without importing
*/
quickValidate(source: string): Promise<{
valid: boolean;
errors: string[];
warnings: string[];
}>;
/**
* Process import options to auto-generate missing fields
*/
private processImportOptions;
/**
* Extract name from source path or URL
*/
private extractNameFromSource;
/**
* Check if a name is generic
*/
private isGenericName;
}
//# sourceMappingURL=import-manager.d.ts.map