import { utc as moment, Moment } from 'moment'; export enum ProductModuleCodeRunLogItemLevel { Info = 'info', Warning = 'warning', Error = 'error', Debug = 'debug', } export interface NetworkProductModuleCodeRunLogItem { product_module_code_run_id: string; created_at: string; level: ProductModuleCodeRunLogItemLevel; content: string; } export interface ProductModuleCodeRunLogItem { productModuleCodeRunId: string; createdAt: Moment; level: ProductModuleCodeRunLogItemLevel; content: string; } export const productModuleCodeRunLogItemFromNetwork = ( networkCodeRunLog: NetworkProductModuleCodeRunLogItem, ): ProductModuleCodeRunLogItem => { return { productModuleCodeRunId: networkCodeRunLog.product_module_code_run_id, createdAt: moment(networkCodeRunLog.created_at), level: networkCodeRunLog.level, content: networkCodeRunLog.content, }; };