Optionalshared: EPSharedResourcesProtected ReadonlybaseEuropean Parliament API base URL.
Protected ReadonlycacheLRU cache for API responses.
Protected ReadonlyenableEnable automatic retry on transient failures.
Protected ReadonlymaxMaximum allowed response body size in bytes.
Protected ReadonlymaxMaximum number of retry attempts.
Protected ReadonlyrateToken bucket rate limiter.
Protected ReadonlytimeoutRequest timeout in milliseconds.
Clears all entries from the LRU cache.
ProtectedevictEvicts a single cache entry matching the given endpoint and params. Sub-clients use this when they detect that a successfully-fetched payload is a content-pending sentinel that must not be served from cache for the remainder of the TTL — eviction lets availability recover as soon as the upstream document is enriched.
ProtectedgetExecutes a cached, rate-limited GET request to the EP API.
Expected response type (extends Record<string, unknown>)
API endpoint path (relative to baseURL)
Optionalparams: Record<string, unknown>Optional query parameters
OptionalminimumTimeoutMs: numberOptional per-request minimum timeout in milliseconds.
When provided, the effective timeout is Math.max(minimumTimeoutMs, this.timeoutMs),
so the global timeout (set via --timeout or EP_REQUEST_TIMEOUT_MS) can still
extend it beyond the per-endpoint minimum.
Use for known slow EP API endpoints such as procedures/feed.
Promise resolving to the typed API response
Returns a single adopted text by document ID.
EP API Endpoint: GET /adopted-texts/{doc-id}
Content-pending detection: The EP Open Data Portal will sometimes respond with HTTP 200 for a document that is indexed in the feed but whose detail enrichment has not yet completed — every transformable field comes back empty. Returning that shape to callers would emit a response that passes JSON-schema validation but carries no data, leading to blank titles/dates/references being rendered downstream. We treat this sentinel as a 404 so callers get the same error semantics they would for a truly missing document, and we also evict the cached empty payload so availability recovers as soon as the upstream document is enriched (instead of blocking for the full cache TTL).
404 in two cases:
docId
(re-thrown by BaseEPClient.get); orReturns adopted texts.
EP API Endpoint: GET /adopted-texts
year, limit, offset
Retrieves recently updated adopted texts via the feed endpoint.
EP API Endpoint: GET /adopted-texts/feed
Configurable-window feed. Extended timeout applied for one-month.
Returns cache statistics for monitoring and debugging.
{ size, maxSize, hitRate, hits, misses }
Returns a single procedure by ID.
The EP API wraps single-item responses in a JSON-LD data array,
so this method extracts data[0] before transforming.
EP API Endpoint: GET /procedures/{process-id}
Procedure process-id in "YYYY-NNNN" format (e.g. "2024-0006").
This is different from the human-readable Procedure.id ("COD/YYYY/NNNN") or
Procedure.reference ("YYYY/NNNN(COD)") fields.
Returns events linked to a procedure.
EP API Endpoint: GET /procedures/{process-id}/events
Procedure process ID
limit, offset
Returns legislative procedures.
EP API Endpoint: GET /procedures
Note: The EP API /procedures endpoint does not support a
year query parameter per the OpenAPI spec — it only has
process-type. Callers needing year-specific counts must filter
client-side.
limit, offset
Paginated list of procedures
Retrieves recently updated procedures via the feed endpoint.
EP API Endpoint: GET /procedures/feed
Note: The EP API procedures/feed endpoint is significantly slower
than other feed endpoints — it typically takes 25–40 s even for one-week
and 120+ seconds for one-month. An extended minimum timeout of 120 s
is always applied.
PrivatetransformPrivatetransformPrivatetransform
Sub-client for legislative procedures and adopted-texts EP API endpoints.