feat(api,shared): métadonnées multi-providers et automatisation des scans/enrichissements

Chaîne de résolution metadata (local, Open Library, Google Books, BNF)
avec activation/priorité/clé API par provider, colonnes isbn13 et
identifiers sur les livres, et intégration au scanner pour compléter
métadonnées et jaquettes manquantes. Module automation: réglages
persistés, planifications scan/enrichissement et déclenchement manuel,
exposés via des endpoints admin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Git Agent
2026-08-23 13:10:45 +02:00
parent 1ac4144d0e
commit 48e9459cf3
23 changed files with 1029 additions and 24 deletions

View File

@ -0,0 +1,20 @@
import { describe, expect, it } from "vitest";
import { MetadataProvider } from "./metadata.types.js";
import { ResolveProviderChain } from "./use-cases/resolve-provider-chain.js";
const provider = (id: MetadataProvider["id"]): MetadataProvider => ({
id,
lookup: async () => null
});
describe("ResolveProviderChain", () => {
it("keeps local active and orders enabled remote providers by priority", () => {
const chain = new ResolveProviderChain([provider("googlebooks"), provider("local"), provider("bnf")]).resolve([
{ provider: "local", enabled: false, priority: 99, apiKey: null },
{ provider: "googlebooks", enabled: true, priority: 2, apiKey: null },
{ provider: "bnf", enabled: true, priority: 1, apiKey: null }
]);
expect(chain.map((entry) => entry.provider.id)).toEqual(["bnf", "googlebooks", "local"]);
});
});