CLI red: backup tests, commander + env-paths deps, stub
4 tests for runBackup: full download into collection-named dirs, incremental skip of existing files, resilient continuation after single-file HTTP 500, and metadata.json output. Adds commander 14.0.3 and env-paths 4.0.0 as runtime deps.
This commit is contained in:
25
src/backup.ts
Normal file
25
src/backup.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// Stub: see the README "Development workflow" section for TDD policy.
|
||||
|
||||
import type { Client } from "./client.js";
|
||||
|
||||
export interface BackupError {
|
||||
fileID: number;
|
||||
title: string;
|
||||
collection: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface BackupResult {
|
||||
totalFiles: number;
|
||||
downloaded: number;
|
||||
skipped: number;
|
||||
failed: number;
|
||||
errors: BackupError[];
|
||||
}
|
||||
|
||||
export const runBackup = async (
|
||||
_client: Client,
|
||||
_outDir: string,
|
||||
): Promise<BackupResult> => {
|
||||
throw new Error("backup.runBackup not implemented");
|
||||
};
|
||||
Reference in New Issue
Block a user