# Class VocabularyClient

Sub-client for EP controlled-vocabularies endpoints.

#### Hierarchy (View Summary)

- BaseEPClient
  - VocabularyClient

- Defined in clients/ep/vocabularyClient.ts:24

##### Index

### Constructors

constructor

### Properties

baseURL
cache
enableRetry
maxResponseBytes
maxRetries
rateLimiter
timeoutMs

### Methods

clearCache
evictFromCache
get
getCacheStats
getControlledVocabularies
getControlledVocabulariesFeed
getControlledVocabularyById

## Constructors

### constructor

- new VocabularyClient(
  config?: EPClientConfig,
  shared?: EPSharedResources,
  ): VocabularyClient

  #### Parameters

  - config: EPClientConfig = {}
  - `Optional` shared: EPSharedResources

  #### Returns VocabularyClient

  Overrides BaseEPClient.constructor

  - Defined in clients/ep/vocabularyClient.ts:25

## Properties

### `Protected` `Readonly` baseURL

baseURL: string

European Parliament API base URL.

Inherited from BaseEPClient.baseURL

- Defined in clients/ep/baseClient.ts:217

### `Protected` `Readonly` cache

cache: LRUCache<string, Record<string, unknown>>

LRU cache for API responses.

Inherited from BaseEPClient.cache

- Defined in clients/ep/baseClient.ts:215

### `Protected` `Readonly` enableRetry

enableRetry: boolean

Enable automatic retry on transient failures.

Inherited from BaseEPClient.enableRetry

- Defined in clients/ep/baseClient.ts:223

### `Protected` `Readonly` maxResponseBytes

maxResponseBytes: number

Maximum allowed response body size in bytes.

Inherited from BaseEPClient.maxResponseBytes

- Defined in clients/ep/baseClient.ts:227

### `Protected` `Readonly` maxRetries

maxRetries: number

Maximum number of retry attempts.

Inherited from BaseEPClient.maxRetries

- Defined in clients/ep/baseClient.ts:225

### `Protected` `Readonly` rateLimiter

rateLimiter: RateLimiter

Token bucket rate limiter.

Inherited from BaseEPClient.rateLimiter

- Defined in clients/ep/baseClient.ts:219

### `Protected` `Readonly` timeoutMs

timeoutMs: number

Request timeout in milliseconds.

Inherited from BaseEPClient.timeoutMs

- Defined in clients/ep/baseClient.ts:221

## Methods

### clearCache

- clearCache(): void

  Clears all entries from the LRU cache.

  #### Returns void

  Inherited from BaseEPClient.clearCache

  - Defined in clients/ep/baseClient.ts:666

### `Protected` evictFromCache

- evictFromCache(endpoint: string, params?: Record<string, unknown>): void

  Evicts 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.

  #### Parameters

  - endpoint: string

    API endpoint path (same value passed to get)

  - `Optional` params: Record<string, unknown>

    Optional query parameters (same value passed to get)

  #### Returns void

  #### Protected

  Inherited from BaseEPClient.evictFromCache

  - Defined in clients/ep/baseClient.ts:681

### `Protected` get

- get<T extends Record<string, unknown>>(
  endpoint: string,
  params?: Record<string, unknown>,
  minimumTimeoutMs?: number,
  ): Promise<T>

  Executes a cached, rate-limited GET request to the EP API.

  #### Type Parameters

  - T extends Record<string, unknown>

    Expected response type (extends `Record<string, unknown>`)

  #### Parameters

  - endpoint: string

    API endpoint path (relative to `baseURL`)

  - `Optional` params: Record<string, unknown>

    Optional query parameters

  - `Optional` minimumTimeoutMs: number

    Optional 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`.

  #### Returns Promise<T>

  Promise resolving to the typed API response

  #### Throws

  On HTTP errors, network failures, or parse failures

  #### Protected

  Inherited from BaseEPClient.get

  - Defined in clients/ep/baseClient.ts:606

### getCacheStats

- getCacheStats(): {
  hitRate: number;
  hits: number;
  maxSize: number;
  misses: number;
  size: number;
  }

  Returns cache statistics for monitoring and debugging.

  #### Returns { hitRate: number; hits: number; maxSize: number; misses: number; size: number }

  `{ size, maxSize, hitRate, hits, misses }`

  Inherited from BaseEPClient.getCacheStats

  - Defined in clients/ep/baseClient.ts:690

### getControlledVocabularies

- getControlledVocabularies(
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<Record<string, unknown>>>

  Returns EP controlled vocabularies. EP API Endpoint: `GET /controlled-vocabularies`

  #### Parameters

  - params: { limit?: number; offset?: number } = {}

    limit, offset

  #### Returns Promise<PaginatedResponse<Record<string, unknown>>>

  Raw API response with vocabulary items

  - Defined in clients/ep/vocabularyClient.ts:36

### getControlledVocabulariesFeed

- getControlledVocabulariesFeed(): Promise<
  JSONLDResponse<Record<string, unknown>>,
  >

  Retrieves recently updated controlled vocabularies via the feed endpoint. EP API Endpoint: `GET /controlled-vocabularies/feed`

  Fixed-window feed — no `timeframe` parameter per OpenAPI spec. Returns HTTP 204 No Content when no updates exist (handled by baseClient).

  #### Returns Promise<JSONLDResponse<Record<string, unknown>>>

  - Defined in clients/ep/vocabularyClient.ts:61

### getControlledVocabularyById

- getControlledVocabularyById(vocId: string): Promise<Record<string, unknown>>

  Returns a single EP Controlled Vocabulary by ID. EP API Endpoint: `GET /controlled-vocabularies/{voc-id}`

  #### Parameters

  - vocId: string

    Vocabulary identifier

  #### Returns Promise<Record<string, unknown>>

  Single vocabulary entry

  - Defined in clients/ep/vocabularyClient.ts:74