import { AxiosResponse } from 'axios'; import { ICaptureResponse } from './CaptureResponse.mjs'; import { JSONValue } from '../models/types.mjs'; export type HttpMethod = 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT'; export type FetchDataTypesAllowed = JSONValue | object | undefined; /** * Parameters for making an HTTP call. */ export type HttpFetchRequestProps = { /** * bearerToken An optional security token to add as Authorization to the HTTP header. */ bearerToken?: string; /** * The object of the data to pass to the API. */ data?: Tdata; /** * An array of HTTP Return Codes that you can use to bypass the standard error handling. * Useful if you want to send back codes like Unauthorized, File too large, ... */ statusCodesToBypassErrorHandler?: number[]; }; /** * Makes an HTTP call to an API using the given HTTP method. * @param url The URL endpoint of the API call. * @param method The HTTP method to be used. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param data Optional body to send with the request. Can be a JSON object or a string. * @returns The returned Response object in a Promise. */ export declare function fetchHttp(url: string, sourceFunctionName: string, method: HttpMethod, { data, bearerToken }: HttpFetchRequestProps): Promise, any>>; export declare function fetchData(url: string, sourceFunctionName: string, method: HttpMethod, settings?: HttpFetchRequestProps): Promise>; export declare function fetchJson(url: string, sourceFunctionName: string, method: HttpMethod, settings?: HttpFetchRequestProps): Promise>; /** * DELETEs data to an API using an HTTP DELETE. * @param url The URL endpoint of the API call. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param settings The HTTP parameters for making the HTTP call. * @returns The returned Response object in a Promise. */ export declare function fetchDelete(url: string, sourceFunctionName: string, settings: HttpFetchRequestProps): Promise>; /** * DELETEs data to an API using an HTTP DELETE. * @param url The URL endpoint of the API call. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param settings The HTTP parameters for making the HTTP call. * @returns The returned Response object in a Promise. */ export declare function fetchDeleteJson(url: string, sourceFunctionName: string, settings: HttpFetchRequestProps): Promise>; /** * Fetches data from an API using an HTTP GET. * Returns the JSON data from the API call. * @param url The URL endpoint of the API call. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param settings The HTTP parameters for making the HTTP call. * @returns The returned JSON object. */ export declare function fetchGet(url: string, sourceFunctionName: string, settings?: HttpFetchRequestProps): Promise>; /** * PATCHs data to an API using an HTTP POST. * @param url The URL endpoint of the API call. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param settings The HTTP parameters for making the HTTP call. * @returns The returned Response object in a Promise. */ export declare function fetchPatch(url: string, sourceFunctionName: string, settings: HttpFetchRequestProps): Promise>; /** * Fetches data from an API using an HTTP POST. * Returns the JSON data from the API call. * @param url The URL endpoint of the API call. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param settings The HTTP parameters for making the HTTP call. * @returns The returned JSON object. */ export declare function fetchPost(url: string, sourceFunctionName: string, settings?: HttpFetchRequestProps): Promise>; /** * PUTs data to an API using an HTTP POST. * @param url The URL endpoint of the API call. * @param sourceFunctionName The callers function name for outputting in potential error calls. * @param settings The HTTP parameters for making the HTTP call. * @returns The returned Response object in a Promise. */ export declare function fetchPut(url: string, sourceFunctionName: string, settings: HttpFetchRequestProps): Promise>; //# sourceMappingURL=fetch-http.d.mts.map