18 | %hide Utils.Streaming.infixl.(:>)
28 | with_client : {e : _} -> IO (HttpClient e) -> (HttpClient e -> EitherT (HttpError e) IO a) -> EitherT (HttpError e) IO a
36 | export
45 | export
46 | getPath : (path: String) -> (accept: Type) -> (t: Type) -> {auto prf: MimeUnrender accept t} -> Result t
61 | GetGenerateLinkFunType (Capture name ty :/ rest) resType = ty -> GetGenerateLinkFunType rest resType
68 | generateLink : (comp: Component t ts r) -> {auto allprf : All ToHttpApiData ts} -> (acc: String) -> (accept: Type) -> (resType: Type) -> {auto prf: MimeUnrender accept resType} -> GetGenerateLinkFunType comp resType
70 | generateLink (Capture name ty) {allprf = prf :: restPrf} acc accept resType = (\x: ty => getPath "\{acc}/\{toUrlPiece x}" accept resType)
72 | generateLink (StaticPath path :/ rest) {allprf = prf :: restPrf} acc accept resType = generateLink rest "\{acc}/\{path}" accept resType
73 | generateLink (Capture name ty :/ rest) {allprf = prf :: restPrf} acc accept resType = (\x: ty => generateLink rest "\{acc}/\{toUrlPiece x}" accept resType)
74 | generateLink (ReqBody _ :/ _) acc accept resType = assert_total $ idris_crash "ReqBody is not supported"
77 | generateLinkByAPI : (api: API) -> {allprf : All ToHttpApiData api.types} -> {verbPrf: MimeUnrender (VerbAccept api.verb) (VerbResponse api.verb)} -> GetGenerateLinkByAPI api