export interface EmailInstruction { email: string; username: string; password: string; server: string; } export interface EmailFromInstruction extends EmailInstruction { send_port: number; } export interface EmailToInstruction extends EmailInstruction { read_port: number; } export interface EmailJob { from: EmailFromInstruction; to: EmailToInstruction; readRetry: Retry; } export interface Retry { retries: number; interval: number; } export const redact = (instruction: T): T => ({ ...instruction, password: "REDACTED", username: "REDACTED", }); export const redactJob = (job: EmailJob): EmailJob => ({ ...job, from: redact(job.from), to: redact(job.to), });