feat(PROJ-14): POP3-Import — Client, Store, Importer, API-Routen, Frontend-Seite
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user