import { IMockedRequestResponse, Method } from './types/internalTypes'; import { IWireMockFeatures } from './types/IWireMockFeatures'; import { IWireMockRequest } from './types/IWireMockRequest'; import { IWireMockResponse } from './types/IWireMockResponse'; import { MatchingAttributes } from './types/externalTypes'; export declare class WireMock { protected readonly baseUrl: string; protected readonly features: IWireMockFeatures; constructor(baseUrl: string, features?: Omit); /** * Creates a new stub with desired request and response match * @param request Request object for the stub mapping * @param response AxiosResponse object for the stub mapping * @param features Additional options to be used for creation of stub mapping * @returns Created wiremock stub mapping. Contains `id` which is needed to delete a mapping */ register(request: IWireMockRequest, response: IWireMockResponse, features?: IWireMockFeatures): Promise; /** * Removes all the existing stubs and logs of incoming requests */ clearAll(): Promise; /** * Removes all the non-default mappings (not defined in backing store) * and logs of incoming requests */ clearAllExceptDefault(): Promise; /** * Removes all existing stubs */ clearAllMappings(): Promise; /** * Removes log of all past incoming requests */ clearAllRequests(): Promise; /** * Deletes a stub mapping * @param id ID of the stub to be deleted. Can be obtained when from response of `register()` */ deleteMapping(id: string): Promise; /** * Returns all the request and response mappings attached to the wiremock instance * @returns Collection of all mappings for the wiremock instance */ getAllMappings(): Promise; /** * @returns List of all requests made to the mocked instance */ getAllRequests(): Promise; /** * @returns List of all scenarios in place for the mocked instance */ getAllScenarios(): Promise; /** * Returns information about the mocked request and response corresponding to the `id` * @param id Mapping ID to get the mapping info for * @returns Single object mapping corresponding to the input `id` */ getMapping(id: string): Promise; /** * Returns list of request(s) made to the WireMock API * @param method Method to match the request(s) made against * @param endpointUrl URL to get the request(s) made against * @returns List of wiremock requests made to the endpoint with given method */ getRequestsForAPI(method: Method, endpointUrl: string): Promise; /** * Returns list of unmatched request(s) * @returns List of wiremock requests made that did not match any mapping */ getUnmatchedRequests(): Promise; /** * Resets all the scenarios to the original state */ resetAllScenarios(): Promise; /** * Restores stub mappings to the defaults defined back in the backing store */ resetMappings(): Promise; /** * Finds a mapping by metadata. * @param matchObject - The object containing metadata to match. * @param matchType - The type of matching attributes. * @returns The found mappings. */ findMappingByMetadata(matchObject: Record, matchType: MatchingAttributes): Promise; /** * Removes a mapping by metadata. * @param matchObject - The object containing metadata to match. * @param matchType - The type of matching attributes. * @returns The result of the removal operation. */ removeMappingByMetadata(matchObject: Record, matchType: MatchingAttributes): Promise; protected makeUrl(endpoint: string): string; private mergeWireMockFeatures; }