UNPKG

@redocly/respect-core

Version:
30 lines 1.43 kB
import { type VerboseLog, type TestContext, type ResponseContext, type Step } from '../types.js'; import type { RequestData } from '../modules/flow-runner/index.js'; interface IFetcher { verboseLogs?: VerboseLog; verboseResponseLogs?: VerboseLog; fetch?: typeof fetch; } export declare function normalizeHeaders(headers: Record<string, string> | undefined): Record<string, string>; export declare function isJsonContentType(contentType: string): boolean; export declare function isXmlContentType(contentType: string): boolean; export declare function trimTrailingSlash(str: string): string; export declare class ApiFetcher implements IFetcher { verboseLogs?: VerboseLog; verboseResponseLogs?: VerboseLog; fetch?: typeof fetch; constructor(params: IFetcher); initVerboseLogs: ({ headerParams, host, path, method, body }: VerboseLog) => void; getVerboseLogs: () => VerboseLog | undefined; updateVerboseLogs: (params: Partial<VerboseLog>) => void; initVerboseResponseLogs: ({ headerParams, host, path, method, body, statusCode, responseTime, }: VerboseLog) => void; getVerboseResponseLogs: () => VerboseLog | undefined; fetchResult: ({ ctx, step, requestData, workflowId, }: { ctx: TestContext; step: Step; requestData: RequestData; workflowId: string; }) => Promise<ResponseContext | never>; } export {}; //# sourceMappingURL=api-fetcher.d.ts.map