@dataql/node
Version:
DataQL core SDK for unified data management with MongoDB and GraphQL - Production Multi-Cloud Ready
46 lines (45 loc) • 1.47 kB
TypeScript
import { WALEntry, WALTransaction } from "./types.js";
/**
* Generate checksum for WAL entry data integrity
*/
export declare function generateChecksum(data: any): string;
/**
* Verify WAL entry checksum
*/
export declare function verifyChecksum(entry: WALEntry): boolean;
/**
* Create a deep copy of data to prevent mutations
*/
export declare function deepClone<T>(obj: T): T;
/**
* Validate WAL entry structure
*/
export declare function validateWALEntry(entry: Partial<WALEntry>): string[];
/**
* Validate WAL transaction structure
*/
export declare function validateWALTransaction(transaction: Partial<WALTransaction>): string[];
/**
* Generate unique WAL entry ID
*/
export declare function generateWALId(prefix?: string): string;
/**
* Convert operation data to WAL-safe format
*/
export declare function sanitizeOperationData(operation: string, data: any, previousData?: any): any;
/**
* Calculate WAL entry size in bytes
*/
export declare function calculateEntrySize(entry: WALEntry): number;
/**
* Check if WAL entry is expired based on retention policy
*/
export declare function isEntryExpired(entry: WALEntry, maxRetentionDays: number): boolean;
/**
* Group WAL entries by session for batch processing
*/
export declare function groupEntriesBySession(entries: WALEntry[]): Map<string, WALEntry[]>;
/**
* Sort WAL entries by timestamp
*/
export declare function sortEntriesByTimestamp(entries: WALEntry[], ascending?: boolean): WALEntry[];