/** * Network representation of a collection module log item (snake_case) */ export interface NetworkCmLogItem { log_id: string; collection_module_key: string; organization_id: string; environment: string; function_name: string; timestamp: string; level: string; message: string; policy_id?: string; collection_module_id?: string; } /** * Local representation of a collection module log item (camelCase) */ export interface CmLogItem { logId: string; collectionModuleKey: string; organizationId: string; environment: string; functionName: string; timestamp: string; level: string; message: string; policyId?: string; collectionModuleId?: string; } /** * Converts a network CM log item (snake_case) to local representation (camelCase) */ export const cmLogItemFromNetwork = (item: NetworkCmLogItem): CmLogItem => { return { logId: item.log_id, collectionModuleKey: item.collection_module_key, organizationId: item.organization_id, environment: item.environment, functionName: item.function_name, timestamp: item.timestamp, level: item.level, message: item.message, policyId: item.policy_id, collectionModuleId: item.collection_module_id, }; };