/** * Cross-Language Schema Validator * Validates schema consistency across language boundaries */ import { CrossLanguageEntity } from '../../types/crossLanguage.js'; import { Violation } from '../../types.js'; export interface SchemaDefinition { id: string; name: string; type: 'protobuf' | 'graphql' | 'json-schema' | 'openapi' | 'typescript-interface' | 'go-struct'; language: string; file: string; line: number; fields: SchemaField[]; version?: string; deprecated?: boolean; } export interface SchemaField { name: string; type: string; required: boolean; description?: string; constraints?: FieldConstraints; deprecated?: boolean; } export interface FieldConstraints { minLength?: number; maxLength?: number; pattern?: string; minimum?: number; maximum?: number; enum?: string[]; } export interface SchemaViolation extends Violation { violationType: 'field-mismatch' | 'schema-field-mismatch' | 'missing-field' | 'extra-field' | 'constraint-mismatch' | 'version-mismatch'; schemas: SchemaDefinition[]; fieldName?: string; expectedType?: string; actualType?: string; suggestion: string; } export interface SchemaValidationOptions { strictTypeChecking?: boolean; allowAdditionalFields?: boolean; checkDeprecated?: boolean; versionTolerance?: 'strict' | 'minor' | 'major'; ignoreOptionalFields?: boolean; } export declare class SchemaValidator { private options; constructor(options?: SchemaValidationOptions); /** * Validate schema consistency across multiple languages */ validateSchemas(schemas: SchemaDefinition[]): Promise; /** * Extract schema definitions from entities */ static extractSchemas(entities: CrossLanguageEntity[]): SchemaDefinition[]; /** * Validate a group of schemas that should be equivalent */ private validateSchemaGroup; /** * Compare two schemas for compatibility */ private compareSchemas; /** * Validate individual schema for internal consistency */ private validateIndividualSchema; /** * Check version compatibility between schemas */ private checkVersionCompatibility; /** * Compare field types between schemas */ private compareFieldTypes; /** * Compare field constraints */ private compareFieldConstraints; /** * Check field naming consistency */ private checkFieldNaming; /** * Group schemas by name */ private groupSchemasByName; /** * Normalize schema name for comparison */ private normalizeSchemaName; /** * Normalize type names across languages */ private normalizeType; /** * Check if types are compatible across languages */ private areTypesCompatible; /** * Parse version string */ private parseVersion; /** * Check if versions are compatible */ private areVersionsCompatible; /** * Check if field name follows language conventions */ private isConsistentNaming; /** * Get recommended naming convention */ private getRecommendedNaming; private static extractTypeScriptInterface; private static extractGoStruct; private static extractProtobufMessage; private static extractGraphQLType; private static extractJSONSchema; } //# sourceMappingURL=SchemaValidator.d.ts.map