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:
2026-05-13 18:36:07 -07:00
parent c1b1d12bcc
commit 30a13eeeaf
4 changed files with 483 additions and 1 deletions

25
src/backup.ts Normal file
View 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");
};