UNPKG

unmock-core

Version:

[![npm](https://img.shields.io/npm/v/unmock-core.svg)][npmjs] [![CircleCI](https://circleci.com/gh/unmock/unmock-js.svg?style=svg)](https://circleci.com/gh/unmock/unmock-js) [![codecov](https://codecov.io/gh/unmock/unmock-js/branch/dev/graph/badge.svg)](h

32 lines 2.55 kB
import { Option } from "fp-ts/lib/Option"; import { Getter, Lens, Optional } from "monocle-ts"; import { MethodNames } from "openapi-refinements"; import { IFakerOptions } from "./faker"; import { CreateResponse, IListener, ISerializedRequest, IUnmockOptions } from "./interfaces"; import { Header, OpenAPIObject, Operation, Parameter, PathItem, Reference, Schema } from "./service/interfaces"; import { ServiceStore } from "./service/serviceStore"; export declare const matchUrls: (protocol: string, host: string, o: OpenAPIObject) => string[]; export declare const getPathItemWithMethod: (m: MethodNames, p: PathItem) => PathItem; export declare const matchesInternal: (path: string[], pathItemKey: string[], pathItem: PathItem, operation: MethodNames, o: OpenAPIObject) => boolean; export declare const matches: (path: string, pathItemKey: string, pathItem: PathItem, method: MethodNames, oas: OpenAPIObject) => boolean; export declare const refName: (r: Reference) => string; export declare const firstElementOptional: <T>() => Optional<T[], T>; export declare const keyLens: <A, T>() => Lens<[A, T], A>; export declare const getFirstMethod: (p: PathItem) => Option<[MethodNames, Operation]>; export declare const operationOptional: Optional<PathItem, [MethodNames, Operation]>; export declare const getHeaderFromRef: (o: OpenAPIObject, d: string) => Option<Header>; export declare const internalGetHeaderFromRef: (o: OpenAPIObject, i: Reference | Header) => Option<Header>; export declare const useIfHeaderLastMile: (p: Parameter, r: Option<Schema>) => Option<[string, Schema]>; export declare const useIfHeader: (o: OpenAPIObject, p: Parameter) => Option<[string, Schema]>; export declare const identityGetter: <T>() => Getter<T, T>; export declare const parameterSchema: (o: OpenAPIObject) => Optional<Parameter, [string, Schema]>; export declare const truncatePath: (path: string, o: OpenAPIObject, i: ISerializedRequest) => string; export declare const matcher: (req: ISerializedRequest, r: Record<string, OpenAPIObject>) => Record<string, OpenAPIObject>; export declare const hoistTransformer: (f: (req: ISerializedRequest, r: OpenAPIObject) => OpenAPIObject, name: string) => (req: ISerializedRequest, r: Record<string, OpenAPIObject>) => Record<string, OpenAPIObject>; export declare function responseCreatorFactory({ listeners, options, fakerOptions, store, }: { listeners?: IListener[]; options: IUnmockOptions; fakerOptions: IFakerOptions; store: ServiceStore; }): CreateResponse; //# sourceMappingURL=generator.d.ts.map