@accounter/server
Version:
Accounter GraphQL server
37 lines (36 loc) • 1.2 kB
TypeScript
/**
* API for parsing SHAAM uniform format files
*/
import type { ReportInput } from '../types/index.js';
export type ValidationMode = 'strict' | 'lenient' | 'none';
export interface ValidationError {
recordType: string;
recordIndex: number;
field: string;
message: string;
severity: 'error' | 'warning';
}
export interface ParseOptions {
validationMode?: ValidationMode;
skipUnknownRecords?: boolean;
allowPartialData?: boolean;
}
export interface ParseResult {
data: ReportInput;
summary: {
totalRecords: number;
perType: Record<string, number>;
errors: ValidationError[];
crossValidationPassed: boolean;
};
}
/**
* Parses SHAAM uniform format files (INI.TXT and BKMVDATA.TXT)
* back into structured JSON objects with comprehensive validation.
*
* @param iniContent - Content of the INI.TXT file
* @param dataContent - Content of the BKMVDATA.TXT file
* @param options - Parse options for validation and error handling
* @returns Parsed report input data with validation summary
*/
export declare function parseUniformFormatFiles(iniContent: string, dataContent: string, options?: ParseOptions): ParseResult;