feat(metadata): introduce provider architecture for book metadata

This commit is contained in:
neon
2026-02-19 01:55:40 -06:00
parent 3ff1cd5882
commit 1dd6381325
28 changed files with 700 additions and 13 deletions
+8 -2
View File
@@ -2,6 +2,12 @@
"name": "@projectx/types",
"version": "0.0.1",
"private": true,
"main": "./src/index.ts",
"types": "./src/index.ts"
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"devDependencies": {
"typescript": "^5.0.0"
},
"scripts": {
"build": "tsc"
}
}
+1
View File
@@ -2,6 +2,7 @@ export * from "./auth";
export * from "./book";
export * from "./collection";
export * from "./library";
export * from "./metadata-fetch";
export * from "./query";
export * from "./reader-settings";
export * from "./scanner";
+35
View File
@@ -0,0 +1,35 @@
export const MetadataProviderKey = {
GOOGLE: 'google',
GOODREADS: 'goodreads',
AMAZON: 'amazon',
HARDCOVER: 'hardcover',
OPEN_LIBRARY: 'openLibrary',
} as const;
export type MetadataProviderKey = (typeof MetadataProviderKey)[keyof typeof MetadataProviderKey];
export interface MetadataCandidate {
provider: MetadataProviderKey;
providerId: string;
title: string;
subtitle?: string;
authors?: string[];
description?: string;
publisher?: string;
publishedYear?: number;
language?: string;
pageCount?: number;
isbn10?: string;
isbn13?: string;
seriesName?: string;
seriesIndex?: number;
tags?: string[];
coverUrl?: string;
sourceUrl?: string;
}
export interface MetadataProviderInfo {
key: MetadataProviderKey;
label: string;
identifiable: boolean;
}
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "CommonJS",
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"strict": false,
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}