import { IResponse, IHeader, IHttpService, IQueryParameter } from '@kentico/kontent-core'; import { IQueryConfig, ISDKInfo, IDeliveryNetworkResponse } from '../models'; import { IDeliveryClientConfig } from '../config'; import { IMappingService } from './mapping.service'; export declare abstract class BaseDeliveryQueryService { /** * Delivery client configuration */ readonly config: IDeliveryClientConfig; /** * Http service for fetching data */ readonly httpService: IHttpService; /** * Information about the SDK */ readonly sdkInfo: ISDKInfo; /** * Mapping service */ readonly mappingService: IMappingService; /** * Default base Url to Kentico Delivery API */ private readonly defaultBaseDeliveryApiUrl; /** * Default preview url to Kentico Delivery API */ private readonly defaultPreviewDeliveryApiUrl; constructor( /** * Delivery client configuration */ config: IDeliveryClientConfig, /** * Http service for fetching data */ httpService: IHttpService, /** * Information about the SDK */ sdkInfo: ISDKInfo, /** * Mapping service */ mappingService: IMappingService); /** * Gets url based on the action, query configuration and options (parameters) * @param action Action (= url part) that will be hit * @param queryConfig Query configuration * @param options Query options */ getUrl(action: string, queryConfig: IQueryConfig, options?: IQueryParameter[]): string; /** * Gets proper set of headers for given request. * @param queryConfig Query configuration * @param additionalHeaders Custom headers */ getHeaders(queryConfig: IQueryConfig, additionalHeaders?: IHeader[]): IHeader[]; /** * Http GET response * @param url Url of request * @param queryConfig Query config configuration */ protected getResponseAsync(url: string, queryConfig?: IQueryConfig, serviceConfig?: { headers?: IHeader[]; }): Promise>; /** * Gets base URL of the request including the project Id * @param queryConfig Query configuration */ protected getBaseUrl(queryConfig: IQueryConfig): string; protected mapNetworkResponse(data: TData, response: IResponse): IDeliveryNetworkResponse; /** * Indicates if current query should use preview mode * @param queryConfig Query configuration */ private isPreviewModeEnabled; private getQueryHeaders; private shouldAddWaitForLoadingNewContentHeader; /** * Indicates if current query should use secured mode * @param queryConfig Query configuration */ private isSecuredModeEnabled; /** * Gets preview or standard URL based on client and query configuration * @param queryConfig Query configuration */ private getDomain; /** * Gets authorization header. This is used for 'preview' functionality */ private getAuthorizationHeader; /** * Header identifying SDK type & version for internal purposes of Kentico */ private getSdkIdHeader; private mapDeliveryError; private getHasStaleContent; private getContinuationToken; }