Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

52 lines
1.2 KiB
TypeScript

/**
* PDF Provider Constants
* Separated from pdf-providers.ts to avoid importing sharp in client components
*/
import type { PDFProviderId, PDFProviderConfig } from './types';
export const MINERU_CLOUD_DEFAULT_BASE = 'https://mineru.net/api/v4';
/**
* PDF Provider Registry
*/
export const PDF_PROVIDERS: Record<PDFProviderId, PDFProviderConfig> = {
unpdf: {
id: 'unpdf',
name: 'unpdf',
requiresApiKey: false,
icon: '/logos/unpdf.svg',
features: ['text', 'images', 'metadata'],
},
mineru: {
id: 'mineru',
name: 'MinerU',
requiresApiKey: false,
icon: '/logos/mineru.png',
features: ['text', 'images', 'tables', 'formulas', 'layout-analysis'],
},
'mineru-cloud': {
id: 'mineru-cloud',
name: 'MinerU (Cloud)',
requiresApiKey: true,
icon: '/logos/mineru.png',
features: ['text', 'images', 'tables', 'formulas', 'layout-analysis'],
},
};
/**
* Get all available PDF providers
*/
export function getAllPDFProviders(): PDFProviderConfig[] {
return Object.values(PDF_PROVIDERS);
}
/**
* Get PDF provider by ID
*/
export function getPDFProvider(providerId: PDFProviderId): PDFProviderConfig | undefined {
return PDF_PROVIDERS[providerId];
}