unmock-core
Version:
[][npmjs] [](https://circleci.com/gh/unmock/unmock-js) [](h
33 lines • 1.42 kB
TypeScript
import { OpenAPIObject, Schema } from "loas3/dist/generated/full";
import { CodeAsInt, HTTPMethod, ISerializedRequest, IStateTransformer } from "../interfaces";
import { IRequestResponsePair, ServiceSpy } from "./spy";
export { Header, isOperation, isReference, isSchema, MediaType, OpenAPIObject, Paths, Schema, Operation, Parameter, PathItem, Reference, Response, Responses, } from "loas3/dist/generated/full";
export interface IService {
readonly spy: ServiceSpy;
readonly core: IServiceCore;
reset(): void;
state(...f: IStateTransformer[]): void;
}
export declare type ServiceStoreType = Record<string, IService>;
export declare type ValidEndpointType = string | Array<string | RegExp | [string, RegExp]>;
export interface IObjectToService {
baseUrl: string;
method?: HTTPMethod;
endpoint?: ValidEndpointType;
query?: Record<string, Schema>;
requestHeaders?: Record<string, Schema>;
responseHeaders?: Record<string, Schema>;
body?: Schema;
statusCode?: CodeAsInt | "default";
response?: string | Schema;
name?: string;
}
export interface IServiceCore {
transformer: (req: ISerializedRequest, o: OpenAPIObject) => OpenAPIObject;
readonly name: string;
readonly schema: OpenAPIObject;
readonly spy: ServiceSpy;
hasDefinedPaths: boolean;
track(requestResponsePair: IRequestResponsePair): void;
}
//# sourceMappingURL=interfaces.d.ts.map