UNPKG

@dotcms/client

Version:

Official JavaScript library for interacting with DotCMS REST APIs.

43 lines (42 loc) 1.43 kB
import { DotCMSClientConfig, DotHttpClient, DotRequestOptions } from '@dotcms/types'; /** * Base class for all DotCMS API clients. * Provides common constructor parameters and properties that all API clients need. * Uses JavaScript private fields (#) for true runtime privacy. */ export declare abstract class BaseApiClient { #private; /** * Creates a new API client instance. * * @param {DotCMSClientConfig} config - Configuration options for the DotCMS client * @param {DotRequestOptions} requestOptions - Options for fetch requests including authorization headers * @param {DotHttpClient} httpClient - HTTP client for making requests */ constructor(config: DotCMSClientConfig, requestOptions: DotRequestOptions | undefined, httpClient: DotHttpClient); /** * Gets the request options including authorization headers. * @protected */ protected get requestOptions(): DotRequestOptions; /** * Gets the DotCMS client configuration. * @protected */ protected get config(): DotCMSClientConfig; /** * Gets the HTTP client for making requests. * @protected */ protected get httpClient(): DotHttpClient; /** * Gets the DotCMS URL from config. * @protected */ protected get dotcmsUrl(): string; /** * Gets the site ID from config. * @protected */ protected get siteId(): string; }