mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 08:21:39 -06:00
feat(metadata): introduce provider architecture for book metadata
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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"]
|
||||
}
|
||||
Reference in New Issue
Block a user