Creates a new instance of the DecoupledRouterClient.
The base URL of the API. BaseUrl
Optional
options: ApiClientOptions(Optional) Additional options for configuring the API client. ApiClientOptions
Private
#privateApiClientOptions.apiPrefix
ApiClientOptions.authentication
BaseUrl
ApiClientOptions.cache
ApiClientOptions.customFetch
ApiClientOptions.debug
ApiClientOptions.defaultLocale
ApiClientOptions.logger
ApiClientOptions.serializer
Adds an authorization header to the provided RequestInit options if authentication of type "Basic" is configured. If the authentication type is "OAuth", it will fetch a new access token or use the stored access token if it exists and is still valid. if the authentication type is "Custom", it will use the provided value.
The RequestInit options to which the authorization header should be added.
The updated RequestInit options with the authorization header, if applicable.
Generates an endpoint URL based on the provided parameters.
Optional
localeThe endpoint URL as a string.
params - The parameters to use for creating the URL.
Protected
getRetrieves a cached response from the cache.
The cache key to use for retrieving the cached response.
A promise wrapping the cached response as a generic type.
Translates a path in the consuming application to a Drupal entity.
the path to translate
Optional
options: GetOptionsA Promise that resolves to the JSON data provided by the router.
Static
createGenerates a cache key based on the provided parameters.
Optional
localeThe generated cache key as a string.
params - The parameters to use for generating the cache key.
const key1 = await this.createCacheKey('en', '/articles/give-your-oatmeal-the-ultimate-makeover');
// key1: 'en--/articles/give-your-oatmeal-the-ultimate-makeover'
Generated using TypeDoc
Decoupled Router Client class provides functionality specific to the decoupled-router module.
See