import { Headers } from '../lib/headers/Headers.js';
import { Sdk } from './Sdk.js';
import { ContextDeleteRecord, ContextListOptions, ContextListResult, IBulkOperationResult } from '../events/BaseEvents.js';
import { Exception } from '../exceptions/exception.js';
export interface SdkOptions {
    /**
     * Uses the provided token for authentication.
     */
    token?: string;
}
export interface IStoreRequestOptions extends SdkOptions {
    method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
    headers?: Record<string, string>;
    body?: string;
    /**
     * If there's retry logic involved, this flag tells the engine
     * that the retry logic was triggered.
     */
    retry?: boolean;
}
export interface IStoreResponse {
    status: number;
    headers: Headers;
    body?: string;
}
export declare const E_INVALID_JSON = "Invalid JSON response.";
export declare const E_RESPONSE_NO_VALUE = "The response has no value.";
export declare const E_RESPONSE_STATUS = "Invalid response status: ";
export declare const E_RESPONSE_UNKNOWN = "Unknown response from the server.";
export declare const E_RESPONSE_LOCATION = "The response has no \"location\" header.";
export declare class SdkBase {
    sdk: Sdk;
    constructor(sdk: Sdk);
    protected logInvalidResponse(response: IStoreResponse): void;
    /**
     * Throws unified message for a common error status codes.
     * It handles 404, 403, and 401 status codes.
     */
    protected inspectCommonStatusCodes(response: IStoreResponse): void;
    /**
     * Creates an Exception from the response body.
     * It reads the error details from the body.
     *
     * @param defaultMessage The default message to use if the body does not contain a message.
     * @param body The message returned by the store.
     * @returns The Exception or undefined when not an error.
     */
    protected createApiError(defaultMessage: string, body?: string): Exception;
    /**
     * A generic (common) method to batch-delete object from the store.
     *
     * @param url The URL object to make the request.
     * @param keys The list of keys to delete
     * @param request Optional request options.
     * @returns THe list of context delete records.
     */
    protected genericBatchDelete(url: URL, keys: string[], request?: SdkOptions): Promise<IBulkOperationResult<ContextDeleteRecord>>;
    /**
     * Generic (common) function to delete an entity in the store.
     *
     * @param url The URL to make the DELETE request to.
     * @param request Optional request options.
     */
    protected genericDelete(url: URL, request?: SdkOptions): Promise<void>;
    protected genericList(url: URL, options: ContextListOptions, request?: SdkOptions): Promise<ContextListResult<unknown>>;
    protected readResponseBody(response: IStoreResponse, errorPrefix: string): string;
    protected readResponseJSON(response: IStoreResponse, errorPrefix: string): unknown;
}
//# sourceMappingURL=SdkBase.d.ts.map