diff --git a/servant-multipart-api/servant-multipart-api.cabal b/servant-multipart-api/servant-multipart-api.cabal index 5c6919b..686a27b 100644 --- a/servant-multipart-api/servant-multipart-api.cabal +++ b/servant-multipart-api/servant-multipart-api.cabal @@ -36,7 +36,7 @@ library -- other dependencies build-depends: - servant >=0.16 && <0.20 + servant >=0.16 && <0.21 -- servant-0.19 dropped support for GHC-8.4 (latest GHCJS version), -- due to QuantifiedConstraints diff --git a/servant-multipart-client/servant-multipart-client.cabal b/servant-multipart-client/servant-multipart-client.cabal index 20bd706..7f62bfc 100644 --- a/servant-multipart-client/servant-multipart-client.cabal +++ b/servant-multipart-client/servant-multipart-client.cabal @@ -38,8 +38,8 @@ library build-depends: servant-multipart-api == 0.12.* , http-media >=0.7.1.3 && <0.9 - , servant >=0.16 && <0.20 - , servant-client-core >=0.16 && <0.20 + , servant >=0.16 && <0.21 + , servant-client-core >=0.16 && <0.21 -- servant-0.19 dropped support for GHC-8.4 (latest GHCJS version), -- due to QuantifiedConstraints diff --git a/servant-multipart-client/src/Servant/Multipart/Client.hs b/servant-multipart-client/src/Servant/Multipart/Client.hs index 6eba689..28529d7 100644 --- a/servant-multipart-client/src/Servant/Multipart/Client.hs +++ b/servant-multipart-client/src/Servant/Multipart/Client.hs @@ -74,7 +74,8 @@ instance MultipartClient Tmp where readHandle hdl = fromActionStep LBS.null (LBS.hGet hdl 4096) instance MultipartClient Mem where - loadFile _ = source . pure + loadFile :: Proxy Mem -> MultipartResult Mem -> SourceIO LBS.ByteString + loadFile _ = (source @[]) . pure -- | Generates a boundary to be used to separate parts of the multipart. -- Requires 'IO' because it is randomized. @@ -129,10 +130,12 @@ multipartToBody boundary mp = RequestBodySource $ files' <> source ["--", bounda mempty' = SourceT ($ Stop) crlf = "\r\n" lencode = LBS.fromStrict . encodeUtf8 + + -- renderInput :: _ -> SourceIO LBS.ByteString renderInput input = renderPart (lencode . iName $ input) "text/plain" "" - (source . pure . lencode . iValue $ input) + ((source @[]) . pure . lencode . iValue $ input) inputs' = foldl' (\acc x -> acc `mappend'` renderInput x) mempty' (inputs mp) renderFile :: FileData tag -> SourceIO LBS.ByteString renderFile file = renderPart (lencode . fdInputName $ file) diff --git a/servant-multipart/servant-multipart.cabal b/servant-multipart/servant-multipart.cabal index 31f56a7..e29224d 100644 --- a/servant-multipart/servant-multipart.cabal +++ b/servant-multipart/servant-multipart.cabal @@ -38,10 +38,10 @@ library servant-multipart-api == 0.12.* , lens >=4.17 && <5.3 , resourcet >=1.2.2 && <1.3 - , servant >=0.16 && <0.20 + , servant >=0.16 && <0.21 , servant-docs >=0.10 && <0.20 , servant-foreign >=0.15 && <0.20 - , servant-server >=0.16 && <0.20 + , servant-server >=0.16 && <0.21 , string-conversions >=0.4.0.1 && <0.5 , wai >=3.2.1.2 && <3.3 , wai-extra >=3.0.24.3 && <3.2 diff --git a/stack.yaml b/stack.yaml index 571fa21..6aab341 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,72 +1,41 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# https://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# resolver: ghcjs-0.1.0_ghc-7.10.2 -# resolver: -# name: custom-snapshot -# location: "./custom-snapshot.yaml" -resolver: lts-16.7 - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# - location: -# git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# extra-dep: true -# subdirs: -# - auto-update -# - wai -# -# A package marked 'extra-dep: true' will only be built if demanded by a -# non-dependency (i.e. a user package), and its test suites and benchmarks -# will not be run. This is useful for tweaking upstream packages. +resolver: snapshot.yaml packages: -- . -# Dependency packages to be pulled from upstream that are not in the resolver -# (e.g., acme-missiles-0.3) +- servant-multipart-client +- servant-multipart +- servant-multipart-api extra-deps: -- servant-0.18 -- servant-client-0.18 -- servant-client-core-0.18 -- servant-docs-0.11.6 -- servant-foreign-0.15.2 -- servant-server-0.18 - -# Override default flag values for local packages and extra-deps -flags: {} - -# Extra package databases containing global packages -extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=1.5" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor +#- git: https://github.com/mwotton/roboservant +# commit: 3deefd61396f33270a747643aea713f50315ce7c + #- git: https://github.com/jfischoff/postgres-options + #commit: 45bafb2092bc7a7b3c561608295294d562313dd3 +- git: https://github.com/jfischoff/tmp-postgres + commit: 593e3ebcb7643afd6095f6269de3552d01c7ff40 +- postgres-options-0.2.0.0@sha256:5e2d6408ed3943f9a056b58106186397b9aa1424c56f1f26668305ce8ea2838f,1604 +- git: https://github.com/MonadicSystems/servant-htmx + commit: db30209295bd0446d316cae5880fb7a6b36a733e +- servant-server-0.20 +- servant-0.20 +- lucid-xstatic-0.1.1 +- xstatic-0.2.0 +- git: https://github.com/haskell-servant/servant-lucid + commit: 28faa2b57ab01b105c35f30908630900f55b5576 +- servant-xstatic-0.1.0 +- git: git@github.com:lambdamechanic/dutchelm + commit: c35d25e939aee2ea6e8a28daa0ca22dc1159d51c +- git: git@github.com:lambdamechanic/quickjs-hs + commit: 22048e08b91bab5eaf61255c22d195579813278f + # annoyingly, this appears to be behind the github. +- git: https://github.com/nh2/call-haskell-from-anything + commit: e7c4648bd38d3e61970b916f4760f77e744629b3 + # - call-haskell-from-anything-1.1.0.0 +- posix-escape-0.1 +- git: https://github.com/lambdamechanic/hxt + commit: d063d93d050367dba7617fa5b937ed609c446671 + subdir: hxt-xpath +- openai-hs-0.3.0.1 +- openai-servant-0.3.0.1 +- servant-client-0.20 +- servant-client-core-0.20 +- servant-docs-0.13 +- servant-foreign-0.16 +# - servant-multipart