h&hO]      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                  Safe-Inferred "%1? umig3Values that can be parsed from request byte string.mig9Values that can be rendered to response body byte string.migSignifies any media. It prescribes the server renderer to lookup media-type at run-time in the "Conten-Type" header. As media-type it is rendered to "*/*".It is useful for values for which we want to derive content type from run-time values. For example it is used for static file servers to get media type from file extension.migType-level tag for FORM url encoded media-type. It is converted to "application/x-www-form-urlencoded"migType-level tag for JSON media type It is converted to "application/json"migMedia type octet stream is for passing raw byte-strings in the request body. It is converted to "application/octet-stream" mig2Conversion of type-level tags to media type values   Safe-Inferred "%1? migValues convertible to lazy text"mig'Map of query parameters for fast-accessmigCaptures as map#migHeaders as map$mig Http request&migURI path'migquery parameters(migcapture from path)migrequest headers*migrequest method+miglazy body reader. Error can happen if size is too big (configured on running the server),mig)was this request made over SSL connection-migHttp response body1mig Http response3migstatus4migheaders5mig response body6migResponse with no content7migBad request response8migHeaders to set content type9migSets response status;migRespond with ok 200-status<migBad response qith given status !"#$%()*&'+,-./0125436789:;<=$%()*&'+,12543-./0#" !;<7869:= Safe-Inferred "%1?Gmig2Set cookie params. For explanation see an article https://web.archive.org/web/20170122122852/https://www.nczonline.net/blog/2009/05/05/http-cookies-explained/Omig3Values that can be converted to low-level response./The repsonse value is usually one of two cases:Resp a+ -- for routes which always produce a value RespOr err a6 - for routes that can also produce an error or value.Response - low-level HTTP-response.Pmigthe type of response body valueQmigthe type of an errorRmigthe media tpye of respSmig&Returns valid repsonse with 200 statusTmig"Returns an error with given statusUmigresponse with no contentVmigAdd some header to the responseWmigGet response headersXmigSets repsonse statusYmigGet response bodyZmigGet response error[migGet response status\mig"Set the media type of the response]mig%Reads the media type by response type^mig$Converts value to low-level response_migResponse that can contain an error. The error is represented with left case of an Either-type.bmig5Response with info on the media-type encoded as type.dmigresponse statusemigresponse headersfmig5response body. Nothing means "no content" in the bodygmigSet header for responsehmigBad request. The bad response with 400 status.imigInternal server error. The bad response with 500 status.jmigNot implemented route. The bad response with 501 status.kmigRedirect to url. It is bad, response with 302 status and set header of Location to a given URL.lmig5Set cookie as http header from form url encoded valuemmig1Default cookie which sets only the cookie itself.'GHILJKMNOPQRSTUVWXYZ[\]^_`abcfedghijklm'bcfed_`aOPQRSTUVWXYZ[\]^hijkgGHILJKMNml Safe-Inferred "%1?D'ymig7Schem definition with references to the used sub-values}mig Output schema~mig Route outputmig http statusmig media typemigopen-api schemamig Input schemamig Route inputsmig-Values which have human-readable description.migInformation on routemig http methodmig route inputsmig route outputsmig open-api tagsmigopen-api descriptionmigopen-api summarymigno description providedmigAppends descriptiton for the info special name request-body is dedicated to request body input nd raw-input is dedicated to raw inputmigGet input media-typemigCreate schema definitionmigAn empty schema definitionmig,Add route input to route info list of inputsmig!Adds route input with descriptionmigDefault empty route info. We update it as we construct the route with type-safe DSL. Almost all values are derived from type signaturesmigSet http-method of the routemig#Set output meida-type for the routemig(Add parameter to the inputs of the routemig'Adds required header info to API schemamig'Adds optional header info to API schemamig&Adds required query info to API schemamig&Adds optional query info to API schemamigAdds capture info to API schemamigAdds query flag to API schemamigAdds request body to API schemamig*Check that route has query with given namemig*Check that route has query with given namemig*Check that route has query with given namemig*Check that route has query with given namemig"Check that route has certain input4yz{|}~4~}yz{| Safe-Inferred "%1?migInfix synonym for pair. It can be useful to stack together many client functions in the output of toClient function. Safe-Inferred "%1?*mig,Converts type-level tag for methods to valuemig trace requestmig Path requestmig Head requestmigOptions requestmigDelete requestmig Put requestmig Post requestmig Get requestmigtype-level TRACE-method tagmigtype-level PATCH-method tagmigtype-level HEAD-method tagmigtype-level OPTIONS-method tagmigtype-level DELETE-method tagmigtype-level PUT-method tagmigtype-level POST-method tagmigtype-level GET-method tagmigRoute response type. It encodes the route method in the type and which monad is used and which type the response has./The repsonse value is usually one of two cases: Resp media a+ -- for routes which always produce a valueRespOr media err a6 - for routes that can also produce an error or value.See the class IsResp$ for more details on response types.mig?Reads info on weather the connection is secure (made over SSL).migRead low-level request. Note that it does not affect the API schemamig*Reads current full-path info with queries. "api/foo/bar?param=value" ==> FullPathInfo "api/foo/bar?param=value"migReads current path info. )"api/foo/bar" ==> PathInfo ["foo", "bar"]mig2Reads a cookie. It's an optional header with name Cookie. The cookie is URL-encoded and read with instnace of FromForm class. data MyCookie = MyCookie { secret :: Text , count :: Int } deriving (Generic, FromForm) > "secret=lolkek&count=101" (Cookie (Just (MyCookie { secret = "lolkek", count = 101 }))) :: Cookie MyCookiemigReads value from the optional header by name. For example if the request has header:  "foo": "bar"It reads the value: ;(OptionalHeader (Just bar)) :: OptionalHeader "foo" barTypemigReads value from the required header by name. For example if the request has header:  "foo": "bar"It reads the value: $(Header bar) :: Header "foo" barTypemig#Argument of capture from the query. "api/route/{foo} if api/route/bar passed" ==> (Capture bar) :: Capture "Foo" barTypemigQuery flag. It is a boolean value in the URL-query. If it is missing it is False9 if it is in the query but does not have any value it is True. Also it can have values  true/false in the query.migOptional URL parameter query. <"api/route?foo=bar" ==> (Optional maybeBar) :: Query "foo" amigRequired URL parameter query. 4"api/route?foo=bar" ==> (Query bar) :: Query "foo" amigGeneric case for request body. The type encodes a media type and value of the request body.-- Safe-Inferred "%1?+l !"#$,+'&*)%(-0./134256789:;<=y|z{}~ Safe-Inferred "%1?/migLow-level representation of the server. Missing route for a given request returns Nothing.migReads request body.mig+Reads low-level request body as byte stringmigReads required query parametermigReads query flagmigThe first maybe means that query with that name is missing the second maybe is weather value is present or empty in the querymigreads optional query parametermigGeneric query parameter readermigReads capture from the pathmigreads request headermigReads optional request headermig)Reads full path (without qury parameters)mig)Reads full path (without qury parameters)migRuns response getter action and returns it for any input requestmig Handle errors Safe-Inferred "%1?0   Safe-Inferred "%1?2qmig)Route contains API-info and how to run itmig7definition of the API (to use it in OpenApi or clients)mighow to run a servermigValues that represent routes. A route is a function of arbitrary number of arguments. Where each argument is one of the special newtype-wrappers that read type-safe information from HTTP-request and return type of the route function is a value of something convertible to HTTP-request.migUpdate API infomigConvert to routemig#converts route-like value to route.  Safe-Inferred "%1?7migMap of capture values extracted from path. Keys are capture names.mig0Path can be a static item or capture with a namemigPath is a chain of elements which can be static types or capture. There is IsString instance which allows us to create paths from strings. Examples: "api/v1/foo" ==> Path [StaticPath "api", StaticPath "v1", StaticPath "foo"] "api/v1/*" ==> Path [StaticPath "api", StaticPath "v1", CapturePath "*"]migMap by media typemigfilter by Accept headermigfilter by Content-Type headermig Mthod mapmig/Efficient representation of API to fetch routesmigHTTP API containermigalternative between two API'smigan empty API that does nothingmigpath prefix for an APImig handle routemig(Filters routes in the API with predicatemigconverts API to efficient representation to fetch the route handlers by pathmig9Read sub-api by HTTP method, accept-type and content-typemigLookup value by media type keymigFind an api item by path. Also it accumulates capture map along the way.mig>Flattens API. Creates a flat list of paths and route handlers.migConstructs API from flat list of pairs of paths and route handlers.  Safe-Inferred "%1?:mig Route cachemig2which route to cache (if True the route is cached)mig cache mapmig Cache valuemig#extracted capture map from the pathmig route handlermig1Route key identidfies the single item for cachingmigvalue of "Content-Type" headermig value of Accept headermig http methodmig)path to route (includes inlined captures)mig Cache configmig'how many items are allowed in the cachemigwhich route to cachemigAllocates new cachemig#Caches the function of route finder  Safe-Inferred "%1?<migCapture case alternativemigThis form of API encodes path switch points as Map's so it does not retraverse the routes and can find the right branch on switch. In the plain api it tries the routes one by one until it finds the right one.mig.Get a route by path, also extracts capture mapmig Converts api to tree normal form    Safe-Inferred "%1?JmigAPI route finder strategy. The API can be transformed to some normal form for faster route lookup. So far we have two normal forms. One is plain Api type as it is. And another one is tree-structure where path switches are encoded with Map's.migServer type. It is a function fron request to response. Some servers does not return valid value. We use it to find right path.Example: server :: Server IO server = "api/v1" /. [ "foo" /. handleFoo , "bar" /. handleBar ] handleFoo :: Query "name" Int -> Get IO (Resp Json Text) handleBar :: Post Json IO TextNote that server is monoid and it can be constructed with Monoid functions and path constructor (/.). To pass inputs for handler we can use special newtype wrappers:Query - for required query parametersOptional - for optional query parameters QueryFlag - for boolean query flagsCapture - for parsing elements of URIHeader - for parsing headersOptionalHeader - for parsing optional headersBody - fot request-body inputand other request types.To distinguish by HTTP-method we use corresponding constructors: Get, Post, Put, etc. Let's discuss the structure of the constructor. Let's take Get for example: type Get m a = Send GET m a newtype Send method m a = Send (m a)&Let's look at the arguments of he typemethod= - type tag of the HTTP-method (GET, POST, PUT, DELETE, etc.)m - underlying server monada - response type. It should be convertible to the type of the response (see IsResp class).mig%Applies server function to all routesmigMapps response of the servermig;Use TreeApi normal form. Path switches are encoded as Maps.mig+Use plain api type. Just Api type as it is.migConverts server to server function. Server function can be used to implement low-level handlers in various server-libraries.migConverts server to server function. Server function can be used to implement low-level handlers in various server-libraries. This function also uses LRU-cache to cache fetching of the routesmigSubstitutes all stars * for corresponding names in captures if there are more captures in the route than in the path it adds additional captures from the route to the pathmigAdds tag to the routemigSets description of the routemigSets summary of the routemigMaps over route API-informationmigAdds OpenApi tag to the routemig9Appends descriptiton for the inputs. It passes pairs for (input-name, input-description). special name request-body is dedicated to request body input nd raw-input is dedicated to raw inputmigServes static files. The file path is a path to where to server the file. The media-type is derived from the extension. There is a special case if we need to server the file from the rooot of the server we can omit everything from the path but keep extension. Otherwise it is not able to derive the media type.)It is convenient to use it with function embedRecursiveDir from the library  file-embed or file-embed-lzma.migSub-server for a server on given path it might be usefule to emulate links from one route to another within the server or reuse part of the server inside another server.mig)Returns a list of all paths in the servermigLinks one route of the server to another so that every call to first path is redirected to the second path Safe-Inferred "%1?LMmig!Reads OpenApi schema for a servermig0Add RequestBody to every operations in the spec.mig-Add parameter to every operation in the spec.mig-Format given text as inline code in Markdown. Safe-Inferred "%1?PmigConverts server to safe url. We can use it to generate safe URL constructors to be used in HTML templates An example of how we can create safe URL's. Note that order of URL's should be the same as in server definition: type GreetingRoute = Get Html type BlogPostRoute = Optional "id" BlogPostId -> Get Html type ListPostsRoute = Get Html data Routes = Routes { greeting :: GreetingRoute , blogPost :: BlogPostRoute , listPosts :: ListPostsRoute } -- URLs data Urls = Urls { greeting :: UrlOf GreetingRoute , blogPost :: UrlOf BlogPostRoute , listPosts :: UrlOf ListPostsRoute } {\-| Site URL's URL's should be listed in the same order as they appear in the server -\} urls :: Urls urls = Urls{..} where greeting :| blogPost :| listPosts toUrl (server undefined)mig#Converts route type to URL functionmigUrl-template type.mig relative pathmigqueries in the URLmigmap of capturesmig Render URL to string-like value.TODO: use Text.Builder   Safe-Inferred "%1?UmigClass contains types which can be converted to IO-based server to run as with WAI-interface.We can run plain IO-servers and ReaderT over IO based servers. Readers can be wrapped in newtypes. In that case we can derive automatically  HasServer instance.mig&Values that can be converted to servermigConvert value to servermig7Constructs server which can handle given path. Example: "api/v1/get/info" /. handleInfoFor captures we use wild-cards: !"api/v1/get/info/*" /. handleInfo%And handle info has capture argument: 9handleInfo :: Capture "nameA" -> Get IO (Resp Json value)The name for the capture is derived from the type signature of the route handler. Note that if capture is in the last position of the path we can omit wild cards. The proper amount of captures will be derived from the type signature of the handler.mig Map internal monad of the servermig'Render reader server to IO-based servermig3Render reader with expetT server to IO-based server  4 Safe-Inferred "%1?YnmigRead low-level response. Note that it does not affect the API schemamigValues that can represent a plugin. We use various newtype-wrappers to query type-safe info from request.migPlugin can convert all routes of the server. It is wrapper on top of ServerFun m -> ServerFun m'. We can apply plugins to servers with  applyPlugin function also plugin has Monoid instance which is like Monoid.Endo or functional composition (.).migupdate api schemamigrun the pluginmigLow-level plugin function.migInfix operator for  applyPluginmig+Applies plugin to all routes of the server.mig$Convert plugin-like value to plugin.migPrepends action to the servermig!Post appends action to the servermig&Applies transformation to the responsemig?Execute request only if it is secure (made with SSL connection)migSets default response if server response with Nothing. If it can not handle the request. Safe-Inferred "%1?Y GNMKJLHIO^]\[ZYXWVUTSRPQPQR_`abdecfghijklm Safe-Inferred "%1?Z !"#$,+'&*)%(-0./134256789:;<=GNMKJLHIO^]\[ZYXWVUTSRPQPQR_`abdecfghijklmy|z{}~ Safe-Inferred "%1?\ !"#$%&'()*+,-./0123456789:;<<=>?@ABCDEFGHHIJKLMNOPQRSTUVWXYZ[\]]^_`abcdefghijklmnopqrsttuvvwxyz{|}~                                                                                                                                                    "mig-0.2.1.0-K7MhR9Tz3md2STjS1LlBUNMig.Core.Class.MediaTypeMig.Core.Types.HttpMig.Core.Class.ResponseMig.Core.Types.InfoMig.Core.Types.PairMig.Core.Types.RouteMig.Core.ServerFunMig.Core.Class.MonadMig.Core.Class.Route Mig.Core.ApiMig.Core.Server.CacheMig.Core.Api.NormalForm.TreeApiMig.Core.ServerMig.Core.OpenApiMig.Core.Class.UrlMig.Core.Class.ServerMig.Core.Class.PluginMig.Core.TypesMig.Core.ClassMig.Core Paths_mig)http-media-0.8.1.1-6uZF3PUE2adDK2apScQG3N%Network.HTTP.Media.MediaType.Internal MediaType FromReqBody fromReqBody ToRespBody toRespBodyAnyMediaFormUrlEncodedJson OctetStream ToMediaType toMediaType$fToMediaTypeTYPEByteString$fToMediaTypeTYPEMarkupM$fToMediaTypeTYPEText$fToMediaTypeTYPEOctetStream$fToMediaTypeTYPEJson$fToMediaTypeTYPEFormUrlEncoded$fToMediaTypeTYPEAnyMedia"$fToRespBodyTYPEAnyMediaByteString#$fToRespBodyTYPEAnyMediaByteString0$fToRespBodyTYPEFormUrlEncodeda%$fToRespBodyTYPEOctetStreamByteString&$fToRespBodyTYPEOctetStreamByteString0$fToRespBodyTYPEMarkupMa$fToRespBodyTYPETextText$fToRespBodyTYPETextText0$fToRespBodyTYPEJsona $fFromReqBodyTYPEFormUrlEncodeda$fFromReqBodyTYPEJsona&$fFromReqBodyTYPEOctetStreamByteString'$fFromReqBodyTYPEOctetStreamByteString0$fFromReqBodyTYPETextTextToTexttoTextQueryMap HeaderMapRequest$sel:path:Request$sel:query:Request$sel:capture:Request$sel:headers:Request$sel:method:Request$sel:readBody:Request$sel:isSecure:Request ResponseBodyRawRespFileResp StreamRespResponse$sel:status:Response$sel:headers:Response$sel:body:ResponsenoContentResponse badRequest setContent setRespStatusaddRespHeaders okResponse badResponse toFullPath $fToText[] $fToTextFloat $fToTextInt $fToTextText $fToTextText0$fShowResponse $fEqResponse$fShowResponseBody$fEqResponseBody SetCookie$sel:cookie:SetCookie$sel:expires:SetCookie$sel:domain:SetCookie$sel:path:SetCookie$sel:secure:SetCookie$sel:httpOnly:SetCookieIsRespRespBody RespError RespMediaokbad noContent addHeaders getHeaders setStatus getRespBody getRespError getStatussetMediagetMedia toResponseRespOr$sel:unRespOr:RespOrResp$sel:status:Resp$sel:headers:Resp$sel:body:Resp setHeaderbadReqinternalServerErrornotImplementedredirect setCookie defCookie$fIsRespRespOr$fIsRespResponse $fIsRespResp$fShowSetCookie $fEqSetCookie $fShowRespOr $fEqRespOr$fFunctorRespOr $fShowResp$fEqResp $fFunctorResp SchemaDefs$sel:defs:SchemaDefs$sel:ref:SchemaDefs OutputSchema RouteOutput$sel:status:RouteOutput$sel:media:RouteOutput$sel:schema:RouteOutput InputSchema RouteInput ReqBodyInput RawBodyInput CaptureInput QueryInputQueryFlagInput HeaderInputDescribe$sel:description:Describe$sel:content:Describe IsRequired RouteInfo$sel:method:RouteInfo$sel:inputs:RouteInfo$sel:output:RouteInfo$sel:tags:RouteInfo$sel:description:RouteInfo$sel:summary:RouteInfo noDescriptiondescribeInfoInputs getInputType toSchemaDefsemptySchemaDefs addRouteInputemptyRouteInfo setMethodsetOutputMedia addHeaderInfoaddOptionalHeaderInfo addQueryInfoaddOptionalInfoaddCaptureInfoaddQueryFlagInfo addBodyInfo routeHasQueryrouteHasOptionalQueryrouteHasQueryFlagrouteHasCapture$fShowRouteInfo $fEqRouteInfo$fShowRouteInput$fEqRouteInput$fShowRouteOutput$fEqRouteOutput$fShowSchemaDefs$fEqSchemaDefs$fShowDescribe $fEqDescribe$fShowIsRequired$fEqIsRequired:|IsMethodtoMethodTracePatchHeadOptionsDeletePutPostGetTRACEPATCHHEADOPTIONSDELETEPUTPOSTGETSend$sel:unSend:SendIsSecure RawRequest FullPathInfoPathInfoCookieOptionalHeaderHeaderCapture QueryFlagOptionalQueryBody$fMonadTransSend$fIsMethodTYPETRACE$fIsMethodTYPEPATCH$fIsMethodTYPEHEAD$fIsMethodTYPEOPTIONS$fIsMethodTYPEDELETE$fIsMethodTYPEPUT$fIsMethodTYPEPOST$fIsMethodTYPEGET $fFunctorSend$fApplicativeSend $fMonadSend $fMonadIOSend ServerFunwithBody withRawBody withQuery withQueryFlag withOptional withCapture withHeaderwithOptionalHeader withCookie withPathInfowithFullPathInfo sendResponsehandleServerErrorMonadOfRoute$sel:info:Route$sel:run:RouteToRoute toRouteInfo toRouteFuntoRoute $fToRouteSend $fToRouteFUN $fToRouteFUN0 $fToRouteFUN1 $fToRouteFUN2 $fToRouteFUN3 $fToRouteFUN4 $fToRouteFUN5 $fToRouteFUN6 $fToRouteFUN7 $fToRouteFUN8 $fToRouteFUN9$fToRouteFUN10$fToRouteRoute CaptureMapPathItem StaticPath CapturePathPath$sel:unPath:PathMediaMap$sel:mapValues:MediaMap$sel:matchAll:MediaMapOutputMediaMap InputMediaMap MethodMap ApiNormalApiAppendEmptyWithPath HandleRoute toNormalApi fromNormalApigetPathflatApi fromFlatApi$fToHttpApiDataPathItem$fIsStringPath$fToHttpApiDataPath$fSemigroupApi $fMonoidApi $fFunctorApi $fFoldableApi$fTraversableApi $fShowApi$fEqApi $fShowPath$fEqPath $fOrdPath$fSemigroupPath $fMonoidPath$fShowPathItem $fEqPathItem $fOrdPathItem$fShowApiNormal $fEqApiNormal$fFunctorApiNormal$fShowInputMediaMap$fEqInputMediaMap$fFunctorInputMediaMap$fShowOutputMediaMap$fEqOutputMediaMap$fFunctorOutputMediaMap$fShowMediaMap $fEqMediaMap$fFunctorMediaMap RouteCache$sel:cacheFilter:RouteCache$sel:cache:RouteCache CacheValue$sel:captures:CacheValue$sel:route:CacheValueCacheKey$sel:inputType:CacheKey$sel:outputType:CacheKey$sel:method:CacheKey$sel:path:CacheKey CacheConfig$sel:size:CacheConfig$sel:cacheFilter:CacheConfig newRouteCache withCache$fShowCacheKey $fEqCacheKey $fOrdCacheKey CaptureCase$sel:name:CaptureCase$sel:api:CaptureCaseTreeApiWithStaticPathWithCapturePath SwitchApi toTreeApi$fEqCaptureCase$fShowCaptureCase$fFunctorCaptureCase $fEqTreeApi $fShowTreeApi$fFunctorTreeApi FindRoute$sel:toNormalForm:FindRoute$sel:getPath:FindRouteServer$sel:unServer:Server mapServerFun mapResponsetreeApiStrategyplainApiStrategy fromServerfromServerWithCache fillCapturesaddTagsetDescription setSummary mapRouteInfodescribeInputs staticFilesatPath filterPathgetServerPaths addPathLink$fSemigroupServer$fMonoidServer toOpenApiToUrltoUrlmapUrlurlArityUrlOfUrl $sel:path:Url$sel:queries:Url$sel:captures:Url renderUrl $fToJSONUrl $fToUrlFUN $fToUrlFUN0 $fToUrlFUN1 $fToUrlFUN2 $fToUrlUrl $fToUrl(,,,) $fToUrl(,,) $fToUrl(,) $fToUrl:| HasServer ServerResult renderServerToServertoServer/. hoistServer fromReaderfromReaderExcept $fToServera $fToServer[]$fToServerServer$fHasServerReaderT$fHasServerReaderT0 $fHasServerIO RawResponseToPlugin toPluginInfo toPluginFunPlugin$sel:info:Plugin$sel:run:Plugin PluginFun$: applyPlugintoPlugin fromPluginFunprependServerActionappendServerActionprocessResponse whenSecureprocessNoResponse$fSemigroupPlugin$fMonoidPlugin $fToPluginFUN$fToPluginFUN0$fToPluginFUN1$fToPluginFUN2$fToPluginFUN3$fToPluginFUN4$fToPluginFUN5$fToPluginFUN6$fToPluginFUN7$fToPluginFUN8$fToPluginFUN9$fToPluginFUN10$fToPluginPlugin$fToPluginFUN11$fToPluginFUN12addRouteInputWithDescriptitonaddParamInfoBy routeHasInputgetQuery withQueryBy filterApilookupMediaMapBy insertTagaddRequestBodyaddParam markdownCodeversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir