/** * Europe PMC Provider Adapter — science search + get via the REST * search JSON endpoint. * * Credential model (DESIGN D2 supplier table): keyless — no credential * model exists for Europe PMC at all. `credentialEnvVars` is `[]` and * the cache fingerprint is ALWAYS `""` (DESIGN D4b note: keyless * responses are user-independent; no keyed partition exists to * re-partition into). The env flows through `create({ env })`, never * the transport seam. * * Politeness (DESIGN D2 politeness bullet): the plain house * `scoutline/${VERSION}` User-Agent rides every request — no mailto * variant (those are OpenAlex/Crossref specifics). * * Controls (DESIGN D7 table europepmc column): `author`, `year`, and * `type` are ALL wire-consumed together on ONE search call, composed * into the EuropePMC query language (`AUTH:"…"`, `PUB_YEAR:` range, * `PUB_TYPE:"…"`). `venue` is REJECTED at validate with * `UnsupportedOptionError` — never accept-and-drop (PRD AC-3; * `--venue` is crossref-only in v1). The `type` VALUE is rewritten per * the D7 round-2 translation table; EuropePMC consumes ALL seven union * values — no rejection row. * * Parsing (DESIGN D2/D3, PRD AC-7c/AC-7d): deterministic JSON field * mapping. `authorString` is a comma-separated display list with a * trailing `;` — split on `,`, strip the trailing `;`. * `firstPublicationDate` → `year` (NOT the `pubYear` string — TASKS T5 * pin; the first-publication date is authoritative even when the two * disagree). `citedByCount` → `citationCount` (verbatim pin); * `isOpenAccess` `"Y"` → `openAccess: true`; `journalTitle` → `venue`; * `abstractText` → `summary` (the richest-fields supplier carries * abstracts). Absent supplier fields stay absent, never undefined- * valued and never fabricated. * * Identifiers (DESIGN D10 ruling 3): bare PMID → * `EXT_ID: AND SRC:MED` on the search endpoint; bare DOI → the * DOI as a query term. arXiv ids do NOT route to Europe PMC — * rejected at validate with `UnsupportedOptionError`. */ import type { ScienceCacheIdentity, ScienceGetRequest, ScienceSearchRequest, ScienceWork } from "../../capabilities/science.js"; import type { ProviderCapability, ProviderContext } from "../types.js"; import { type EuropepmcTransportDeps } from "./client.js"; import { createEuropepmcDiagnosticsCapability } from "./diagnostics.js"; /** Local science search contract — see the module header. */ interface EuropepmcScienceSearchCapability { validate(request: ScienceSearchRequest): void; cacheIdentity(request: ScienceSearchRequest): ScienceCacheIdentity; invoke(request: ScienceSearchRequest, signal?: AbortSignal): Promise; } /** Local science get contract — see the module header. */ interface EuropepmcScienceGetCapability { validate(request: ScienceGetRequest): void; cacheIdentity(request: ScienceGetRequest): ScienceCacheIdentity; invoke(request: ScienceGetRequest, signal?: AbortSignal): Promise; } /** Local ScienceCapability surface. */ interface EuropepmcScienceCapability { readonly search: EuropepmcScienceSearchCapability; readonly get: EuropepmcScienceGetCapability; } /** * Dependencies the EuropePMC Adapter accepts. The unified `transport` * seam carries `fetch` and timer injection (house spider/arXiv/OpenAlex * pattern); credentials do not exist for Europe PMC, so nothing flows * through `create({ env })` beyond the context itself. */ export interface EuropepmcAdapterDependencies { readonly transport?: EuropepmcTransportDeps; } /** Local Adapter contract — see the module header. */ interface EuropepmcAdapter { readonly id: "europepmc"; readonly science: EuropepmcScienceCapability; readonly diagnostics: ReturnType; } /** Local Descriptor contract — see the module header. */ interface EuropepmcDescriptor { readonly id: "europepmc"; isConfigured(env: NodeJS.ProcessEnv, capabilityId?: ProviderCapability): boolean; capabilities(): ReadonlySet; create(context: ProviderContext): EuropepmcAdapter; readonly credentialEnvVars: readonly string[]; } /** * Build the Europe PMC Provider Descriptor. Keyless — no credential * model exists — so `isConfigured` is true for the no-capability form * (doctor) and the science duo + diagnostics — never `quota` or * non-science capabilities. `create()` is side-effect-free; transport * runs per capability call. */ export declare function createEuropepmcDescriptor(dependencies?: EuropepmcAdapterDependencies): EuropepmcDescriptor; export {}; //# sourceMappingURL=adapter.d.ts.map