UNPKG

@dotcms/client

Version:

Official JavaScript library for interacting with DotCMS REST APIs.

22 lines (21 loc) 1.31 kB
import { DotCMSClientConfig, DotCMSNavigationRequestParams, DotRequestOptions, DotCMSNavigationItem, DotHttpClient } from '@dotcms/types'; import { BaseApiClient } from '../base/api/base-api'; export declare class NavigationClient extends BaseApiClient { private BASE_URL; /** * Creates a new NavigationClient 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, httpClient: DotHttpClient); /** * Retrieves information about the dotCMS file and folder tree. * @param {string} path - The path to retrieve navigation for. * @param {DotCMSNavigationRequestParams} params - The options for the Navigation API call. * @returns {Promise<DotCMSNavigationItem[]>} - A Promise that resolves to the response from the DotCMS API. * @throws {DotErrorNavigation} - Throws a navigation-specific error if the request fails. */ get(path: string, params?: DotCMSNavigationRequestParams): Promise<DotCMSNavigationItem[]>; private mapToBackendParams; }