UNPKG

openapi-ts-mock-generator

Version:
1 lines 1.85 kB
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import { OpenAPIV3_1 } from \"openapi-types\"\n\nexport type Options = {\n path: string\n arrayMinLength?: number\n arrayMaxLength?: number\n isStatic: boolean\n includeCodes?: number[]\n baseDir?: string\n specialPath?: string\n handlerUrl: string\n fakerLocale: string\n generateTarget: string\n clear?: boolean\n}\n\nexport type SchemaOutputType = string | number | boolean | null | undefined | Date\n\ntype NestedSchemaOutputType<T> =\n | {\n [K in keyof T]: T[K] extends object ? NestedSchemaOutputType<T[K]> : T[K]\n }\n | SchemaOutputType\n | {}\n\nexport type ParseSchemaType = NestedSchemaOutputType<string>\n\nexport enum HttpMethods {\n GET = \"get\",\n PUT = \"put\",\n POST = \"post\",\n DELETE = \"delete\",\n OPTIONS = \"options\",\n HEAD = \"head\",\n PATCH = \"patch\",\n TRACE = \"trace\",\n}\n\nexport type ResponseSchemaType =\n | {\n type: \"anyOf\" | \"oneOf\" | \"array\"\n value: OpenAPIV3_1.SchemaObject\n }\n | {\n type: \"ref\"\n value: OpenAPIV3_1.ReferenceObject\n }\n | undefined\n\nexport type PathNormalizedType = {\n pathname: string\n operationId: string\n summary: string\n method: HttpMethods\n responses: {\n statusCode: number\n description: string\n schema: ResponseSchemaType\n }[]\n tags: string[]\n}\n\nexport const isNotNullish = <TValue>(value: TValue | null | undefined): value is TValue => {\n return value !== null && value !== undefined\n}\n"],"mappings":";AA2BO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,aAAA,SAAM;AACN,EAAAA,aAAA,SAAM;AACN,EAAAA,aAAA,UAAO;AACP,EAAAA,aAAA,YAAS;AACT,EAAAA,aAAA,aAAU;AACV,EAAAA,aAAA,UAAO;AACP,EAAAA,aAAA,WAAQ;AACR,EAAAA,aAAA,WAAQ;AARE,SAAAA;AAAA,GAAA;AAmCL,IAAM,eAAe,CAAS,UAAsD;AACzF,SAAO,UAAU,QAAQ,UAAU;AACrC;","names":["HttpMethods"]}