@the_cfdude/productboard-mcp
Version:
Model Context Protocol server for Productboard REST API with dynamic tool loading
44 lines (43 loc) • 1.66 kB
TypeScript
/**
* Utilities for handling wildcard patterns and advanced search functionality
*/
export type PatternMatchMode = 'exact' | 'wildcard' | 'regex';
export interface WildcardPattern {
pattern: string;
isWildcard: boolean;
regex: RegExp;
mode: PatternMatchMode;
}
export interface PatternMatchOptions {
caseSensitive?: boolean;
maxComplexity?: number;
timeout?: number;
}
/**
* Compile a pattern string into a reusable pattern matcher
*/
export declare function compilePattern(pattern: string, mode?: PatternMatchMode, options?: PatternMatchOptions): WildcardPattern;
/**
* Test if a value matches the compiled pattern
*/
export declare function matchesPattern(value: string | null | undefined, compiledPattern: WildcardPattern): boolean;
/**
* Enhanced filter application with pattern support
*/
export declare function applyPatternFilter(item: any, field: string, pattern: WildcardPattern, operator?: string): boolean;
/**
* Generate search suggestions based on partial matches and typos
*/
export declare function generateSearchSuggestions(searchTerm: string, availableFields: string[], maxSuggestions?: number): string[];
/**
* Check if a field name might be a wildcard pattern for field selection
*/
export declare function isFieldPattern(fieldName: string): boolean;
/**
* Expand field patterns to matching field names
*/
export declare function expandFieldPatterns(patterns: string[], availableFields: string[]): string[];
/**
* Validate pattern complexity to prevent performance issues
*/
export declare function validatePatternComplexity(pattern: string, maxStars?: number, maxQuestions?: number): boolean;