UNPKG

@mcp-consultant-tools/powerplatform-data

Version:

MCP server for PowerPlatform data CRUD operations (operational use)

152 lines 4.33 kB
/** * Best Practices Validation Module * * Hard-coded SmartImpact CRM best practices for entity and attribute customization. * These rules are enforced during entity and attribute creation/update operations. */ export interface ValidationResult { isValid: boolean; issues: string[]; warnings: string[]; missingColumns?: RequiredColumn[]; } export interface RequiredColumn { schemaName: string; displayName: string; description: string; type: string; maxLength?: number; format?: string; behavior?: string; [key: string]: any; } /** * Hard-coded best practices rules for SmartImpact CRM customizations */ export declare const BEST_PRACTICES: { publisher: { prefix: string; name: string; optionValuePrefix: number; }; entity: { ownershipType: { allowed: string[]; forbidden: string[]; default: string; }; prefix: string; refDataInfix: string; caseRule: string; }; attribute: { lookupSuffix: string; caseRule: string; avoidBooleans: boolean; dateTimeDefaultBehavior: string; }; requiredColumns: { allTables: { schemaName: string; displayName: string; description: string; type: string; maxLength: number; }[]; refDataTables: ({ schemaName: string; displayName: string; description: string; type: string; format: string; behavior: string; maxLength?: undefined; } | { schemaName: string; displayName: string; description: string; type: string; maxLength: number; format?: undefined; behavior?: undefined; })[]; }; form: { firstColumnMustBeName: boolean; standardColumnOrder: string[]; colorPalette: { amber: string; green: string; red: string; grey: string; }; timelineActivityLimit: number; }; status: { preferGlobalOptionSets: boolean; avoidOOTBStateStatus: boolean; }; }; /** * Best Practices Validator Class */ export declare class BestPracticesValidator { /** * Validate entity naming conventions * Pattern for RefData: prefix + "ref_" + tablename (e.g., sic_ref_cancellationreason) * Pattern for BAU: prefix + tablename (e.g., sic_application) */ validateEntityName(schemaName: string, isRefData: boolean): ValidationResult; /** * Validate attribute naming conventions */ validateAttributeName(schemaName: string, isLookup: boolean): ValidationResult; /** * Validate entity ownership type */ validateOwnershipType(ownershipType: string): ValidationResult; /** * Check if required columns are present */ validateRequiredColumns(existingColumns: string[], isRefData: boolean): ValidationResult; /** * Validate boolean usage (discouraged) */ validateBooleanUsage(attributeType: string, schemaName: string): ValidationResult; /** * Validate DateTime behavior */ validateDateTimeBehavior(behavior: string | undefined): ValidationResult; /** * Get required columns for entity type */ getRequiredColumns(isRefData: boolean): RequiredColumn[]; /** * Validate option set value prefix */ validateOptionSetValuePrefix(value: number): ValidationResult; /** * Generate next option set value with proper prefix */ getNextOptionSetValue(existingValues: number[]): number; /** * Comprehensive entity validation */ validateEntity(params: { schemaName: string; displayName: string; ownershipType: string; isRefData: boolean; existingColumns?: string[]; }): ValidationResult; /** * Comprehensive attribute validation */ validateAttribute(params: { schemaName: string; attributeType: string; dateTimeBehavior?: string; }): ValidationResult; } export declare const bestPracticesValidator: BestPracticesValidator; //# sourceMappingURL=bestPractices.d.ts.map