import { AxiosRequestConfig, AxiosResponse } from 'axios'; import https from 'https'; import { ApiWrapper } from './ApiWrapper.mjs'; import { ApiProps } from '../models/types.mjs'; import { IMgmErrorMessage } from '../models/interfaces.mjs'; export interface IApiRepository { logInfo(msg: string): void; getKeyForSaving(key: string): string; handleAxiosError(fname: string, err: any, relativePath: string, saveKey: string, requestBody: any, errorMessage?: IMgmErrorMessage): void; httpGet(fname: string, keyForSaving: string, relativePath?: string, requestConfig?: AxiosRequestConfig, errorMessage?: IMgmErrorMessage): Promise; httpGetRaw(fname: string, keyForSaving: string, relativePath?: string, requestConfig?: AxiosRequestConfig, errorMessage?: IMgmErrorMessage): Promise>; httpPost(fname: string, keyForSaving: string, relativePath: string | undefined, requestConfig: AxiosRequestConfig, requestBody?: TReguestBody, errorMessage?: IMgmErrorMessage): Promise; httpPostRaw(fname: string, keyForSaving: string, relativePath: string | undefined, requestConfig: AxiosRequestConfig, requestBody?: TRequestBody, errorMessage?: IMgmErrorMessage): Promise>; sendApiSuccess(returnData?: T): ApiWrapper; sendApiWrappedResponse(result: string, msg: string, responseCode: number, returnData?: T): ApiWrapper; } export declare class ApiRepository implements IApiRepository { apiProps: ApiProps; loggerComponentName: string; saveKeyPrefix: string; private logger; constructor(apiProps: ApiProps, loggerComponentName?: string, saveKeyPrefix?: string); logInfo(msg: string): void; getApiUrl(path?: string): string; getKeyForSaving(key: string): string; handleAxiosErrorRaw(fname: string, err: any, url: string, saveKey: string, requestBody: any, errorMessage?: IMgmErrorMessage): { errmsg: string; fname: string; jsonError: Record | undefined; }; handleAxiosError(fname: string, err: any, url: string, saveKey: string, requestBody: any, errorMessage?: IMgmErrorMessage): void; httpGet(fname: string, keyForSaving: string, relativePath: string | undefined, requestConfig: AxiosRequestConfig, errorMessage?: IMgmErrorMessage): Promise; httpGetRaw(fname: string, keyForSaving: string, relativePath: string | undefined, requestConfig: AxiosRequestConfig, errorMessage?: IMgmErrorMessage): Promise>; httpPost(fname: string, keyForSaving: string, relativePath: string | undefined, requestConfig: AxiosRequestConfig, requestBody?: TRequestBody, errorMessage?: IMgmErrorMessage): Promise; /** * Handle this problem with Node 18 * write EPROTO B8150000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled * see https://stackoverflow.com/questions/74324019/allow-legacy-renegotiation-for-nodejs/74600467#74600467 **/ allowLegacyRenegotiationforNodeJsOptions: { httpsAgent: https.Agent; }; httpPostRaw(fname: string, keyForSaving: string, relativePath: string | undefined, requestConfig: AxiosRequestConfig, requestBody?: TRequestBody, errorMessage?: IMgmErrorMessage): Promise>; sendApiSuccess(returnData?: T): ApiWrapper; sendApiWrappedResponse(result?: string, msg?: string, responseCode?: number, returnData?: T): ApiWrapper; } //# sourceMappingURL=ApiRepository.d.mts.map