sfcc-dev-mcp
Version:
MCP server for Salesforce B2C Commerce Cloud development assistance including logs, debugging, and development tools
128 lines • 3.73 kB
TypeScript
/**
* SFCC Documentation Client
*
* This module provides functionality to query and retrieve SFCC class documentation
* from the converted Markdown files. It enables AI assistants to access detailed
* information about SFCC classes, methods, properties, and usage examples.
*/
import { CacheManager } from '../utils/cache.js';
export interface SFCCClassInfo {
className: string;
packageName: string;
filePath: string;
content: string;
}
export interface SFCCMethod {
name: string;
signature: string;
description: string;
parameters?: string[];
returnType?: string;
deprecated?: boolean;
deprecationMessage?: string;
}
export interface SFCCProperty {
name: string;
type: string;
description: string;
modifiers?: string[];
deprecated?: boolean;
deprecationMessage?: string;
}
export interface SFCCClassDetails {
className: string;
packageName: string;
description: string;
properties: SFCCProperty[];
methods: SFCCMethod[];
inheritance?: string[];
constructorInfo?: string;
}
export declare class SFCCDocumentationClient {
private docsPath;
private classCache;
private cacheManager;
private initialized;
constructor();
/**
* Initialize the documentation client by scanning all available classes
*/
initialize(): Promise<void>;
/**
* Scan the docs directory and index all SFCC classes
*/
private scanDocumentation;
/**
* Get a list of all available SFCC classes
*/
getAvailableClasses(): Promise<string[]>;
/**
* Search for classes by name (partial matching)
*/
searchClasses(query: string): Promise<string[]>;
/**
* Get the raw documentation content for a class
*/
getClassDocumentation(className: string): Promise<string | null>;
/**
* Normalize class name to handle both dot and underscore formats
* Examples:
* - dw.content.ContentMgr -> dw_content.ContentMgr
* - dw_content.ContentMgr -> dw_content.ContentMgr (unchanged)
* - ContentMgr -> ContentMgr (unchanged)
*/
private normalizeClassName;
/**
* Extract simple class name from full class name
* Examples:
* - dw_content.ContentMgr -> ContentMgr
* - ContentMgr -> ContentMgr
*/
private extractSimpleClassName;
/**
* Parse class documentation and extract structured information
*/
getClassDetails(className: string): Promise<SFCCClassDetails | null>;
/**
* Parse markdown content and extract structured class information
*/
private parseClassContent;
/**
* Parse markdown content and extract referenced types from a class
*/
private extractReferencedTypes;
/**
* Get class details with optional expansion of referenced types
*/
getClassDetailsExpanded(className: string, expand?: boolean): Promise<SFCCClassDetails & {
referencedTypes?: SFCCClassDetails[];
} | null>;
/**
* Get methods for a specific class
*/
getClassMethods(className: string): Promise<SFCCMethod[]>;
/**
* Get properties for a specific class
*/
getClassProperties(className: string): Promise<SFCCProperty[]>;
/**
* Search for methods across all classes
*/
searchMethods(methodName: string): Promise<{
className: string;
method: SFCCMethod;
}[]>;
/**
* Get cache statistics for monitoring performance
*/
getCacheStats(): ReturnType<CacheManager['getAllStats']>;
/**
* Clear all caches
*/
clearCache(): void;
/**
* Cleanup resources and destroy caches
*/
destroy(): void;
}
//# sourceMappingURL=docs-client.d.ts.map