import { JSONSchema, SchemaCacheService } from './schema-cache.service.js'; export interface ValidationError { path: string; message: string; keyword: string; params: any; data: any; } export interface ValidationResult { valid: boolean; errors?: ValidationError[]; } export declare class JsonValidatorService { private ajv; private validators; private schemaCacheService; private baseDirectory; constructor(baseDirectory: string, schemaCacheService: SchemaCacheService); private setupCustomFormats; private loadSchemaFromCID; /** * Validate JSON data against a schema * @param data The data to validate * @param schema The schema to validate against * @param currentFilePath Optional path of the file containing this data (for relative path resolution) * @param skipCIDResolution Skip resolving CID pointers (useful when data is already processed) */ validate(data: any, schema: JSONSchema, currentFilePath?: string, skipCIDResolution?: boolean): Promise; /** * Resolve CID references in schemas and track which paths allow CID pointers * Replaces { type: 'string', cid: '...' } with the actual schema from IPFS */ private resolveCIDSchemasAndTrackPaths; /** * Resolve CID references in schemas * Replaces { type: 'string', cid: '...' } with the actual schema from IPFS */ private resolveCIDSchemas; /** * Resolve CID pointers in data * Handles {"/": } pattern by fetching content from IPFS * Handles {"/": } pattern by reading from local filesystem * Only resolves pointers where the corresponding schema part is a CID link * @param data The data to resolve pointers in * @param currentFilePath Optional path of the file containing this data (for relative path resolution) * @param schema The schema corresponding to this data part * @param cidAllowedMap Map of which schema paths allow CID resolution * @param currentPath Current path in the data structure */ private resolveCIDPointers; /** * Get or compile a validator for a schema */ private getValidator; /** * Transform AJV errors to our format */ private transformErrors; /** * Enhance error messages with detailed format descriptions */ private enhanceErrorMessage; /** * Get a human-readable error message from validation errors */ getErrorMessages(errors: ValidationError[]): Array<{ path: string; message: string; data: unknown; }>; /** * Check if a schema allows CID links (has type: 'string' and cid property) */ private isCIDLinkSchema; /** * Check if a schema is valid */ isValidSchema(schema: any): Promise; } //# sourceMappingURL=json-validator.service.d.ts.map