feat(PROJ-14): POP3-Import — Client, Store, Importer, API-Routen, Frontend-Seite

This commit is contained in:
sysops
2026-03-17 19:48:14 +01:00
parent 5e69c29f16
commit adffff7ee1
9 changed files with 1494 additions and 1 deletions
+72
View File
@@ -384,6 +384,78 @@ export async function updateImapInterval(id: number, intervalMin: number): Promi
});
}
// ── POP3 ──────────────────────────────────────────────────────────────────
export interface Pop3Account {
id: number;
owner: string;
name: string;
host: string;
port: number;
tls: string;
tls_skip_verify: boolean;
username: string;
status: string;
error_msg: string;
last_import_at?: string;
last_import_count: number;
progress_current: number;
progress_total: number;
created_at: string;
}
export interface Pop3TestResult {
ok: boolean;
message: string;
message_count?: number;
total_size_bytes?: number;
}
export async function getPop3Accounts(): Promise<Pop3Account[]> {
return request<Pop3Account[]>("/api/pop3");
}
export async function createPop3Account(data: {
name: string;
host: string;
port: number;
tls: string;
tls_skip_verify: boolean;
username: string;
password: string;
}): Promise<Pop3Account> {
return request<Pop3Account>("/api/pop3", {
method: "POST",
body: JSON.stringify(data),
});
}
export async function deletePop3Account(id: number): Promise<void> {
await request<void>(`/api/pop3/${id}`, { method: "DELETE" });
}
export async function testPop3Connection(data: {
host: string;
port: number;
tls: string;
tls_skip_verify: boolean;
username: string;
password: string;
}): Promise<Pop3TestResult> {
return request<Pop3TestResult>("/api/pop3/test", {
method: "POST",
body: JSON.stringify(data),
});
}
export async function startPop3Import(id: number): Promise<Pop3Account> {
return request<Pop3Account>(`/api/pop3/${id}/import`, { method: "POST" });
}
export async function getPop3Progress(id: number): Promise<Pop3Account> {
return request<Pop3Account>(`/api/pop3/${id}/progress`);
}
// ── System Stats ──────────────────────────────────────────────────────────
export interface SystemStatsCPU {