syncthing-hs 0.2.0.0 → 0.3.0.0
raw patch · 7 files changed
+34/−18 lines, 7 filesdep +time-locale-compatdep −old-localedep ~timedep ~wreqPVP ok
version bump matches the API change (PVP)
Dependencies added: time-locale-compat
Dependencies removed: old-locale
Dependency ranges changed: time, wreq
API changes (from Hackage documentation)
- Network.Syncthing.Types: getLenientMtimes :: FolderConfig -> Bool
- Network.Syncthing.Post: scan :: MonadSync m => FolderName -> Maybe Path -> SyncM m ()
+ Network.Syncthing.Post: scan :: MonadSync m => FolderName -> Maybe Path -> Maybe Int -> SyncM m ()
- Network.Syncthing.Types: FolderConfig :: FolderName -> Path -> [Device] -> Bool -> Int -> Bool -> Bool -> VersioningConfig -> Bool -> Int -> Int -> Int -> Text -> Text -> FolderConfig
+ Network.Syncthing.Types: FolderConfig :: FolderName -> Path -> [Device] -> Bool -> Int -> Bool -> Bool -> VersioningConfig -> Int -> Int -> Int -> Text -> Text -> FolderConfig
Files
- Network/Syncthing/Internal/Utils.hs +1/−1
- Network/Syncthing/Post.hs +12/−7
- Network/Syncthing/Types/Config.hs +0/−3
- changelog.md +5/−0
- syncthing-hs.cabal +5/−5
- tests/Properties/ErrorProperties.hs +1/−0
- tests/UnitTests/Requests.hs +10/−2
Network/Syncthing/Internal/Utils.hs view
@@ -12,8 +12,8 @@ import Data.Maybe (fromMaybe) import qualified Data.Text as T import Data.Time.Clock (UTCTime)+import Data.Time.Locale.Compat (defaultTimeLocale) import Data.Time.Format (formatTime, parseTime)-import System.Locale (defaultTimeLocale) import Text.Regex.Posix ((=~)) import Network.Syncthing.Types.Common
Network/Syncthing/Post.hs view
@@ -36,8 +36,8 @@ import Control.Applicative ((<$>)) import Control.Monad (join, (>=>)) import qualified Data.Map as Map-import Data.Maybe (maybeToList)-import Data.Text (Text)+import Data.Maybe (catMaybes)+import Data.Text (Text, pack) import Network.Syncthing.Internal.Monad import Network.Syncthing.Internal.Request@@ -95,13 +95,18 @@ ignoresMap = Map.singleton "ignore" ignoresList -- | Request rescan of a folder. Restrict the scan to a relative subpath--- within the folder by specifying the optional path parameter.-scan:: MonadSync m => FolderName -> Maybe Path -> SyncM m ()-scan folder subPath =+-- within the folder by specifying the optional path parameter. The+-- optional int argument delays Syncthing's automated rescan interval for a +-- given amount of seconds.+scan:: MonadSync m => FolderName -> Maybe Path -> Maybe Int-> SyncM m ()+scan folder subPath next = send postRequest { path = "/rest/db/scan"- , params = [("folder", folder)]- ++ maybeToList (("sub",) <$> subPath)+ , params = ("folder", folder) : optionalParams }+ where + optionalParams = catMaybes [ ("sub",) <$> subPath+ , ("next",) . pack . show <$> next+ ] -- | Restart Syncthing. restart :: MonadSync m => SyncM m SystemMsg
Network/Syncthing/Types/Config.hs view
@@ -89,7 +89,6 @@ , getIgnorePerms :: Bool , getAutoNormalize :: Bool , getVersioning :: VersioningConfig- , getLenientMtimes :: Bool , getCopiers :: Int , getPullers :: Int , getHashers :: Int@@ -107,7 +106,6 @@ <*> (v .: "ignorePerms") <*> (v .: "autoNormalize") <*> (v .: "versioning")- <*> (v .: "lenientMTimes") <*> (v .: "copiers") <*> (v .: "pullers") <*> (v .: "hashers")@@ -125,7 +123,6 @@ , "ignorePerms" .= getIgnorePerms , "autoNormalize" .= getAutoNormalize , "versioning" .= getVersioning- , "lenientMTimes" .= getLenientMtimes , "copiers" .= getCopiers , "pullers" .= getPullers , "hashers" .= getHashers
changelog.md view
@@ -1,3 +1,8 @@+0.3.0.0+-------+* Add support for GHC 7.10+* Update Get.config and Post.scan requests+ 0.2.0.0 ------- * Update library for Syncthing v0.11
syncthing-hs.cabal view
@@ -1,5 +1,5 @@ name: syncthing-hs-version: 0.2.0.0+version: 0.3.0.0 synopsis: Haskell bindings for the Syncthing REST API description: .@@ -67,14 +67,14 @@ , http-client >=0.4.6 , http-client-tls >=0.2.2 , lens >=4.5- , old-locale >=1.0.0.6+ , time-locale-compat , regex-posix >=0.95.2 , text >=1.1.1.0- , time >=1.4.2+ , time , transformers >=0.2.2.1 , unordered-containers >=0.2.3.3 , vector >= 0.10.12.3- , wreq >=0.3.0.0+ , wreq >=0.4.0.0 -- hs-source-dirs: default-language: Haskell2010 @@ -101,7 +101,7 @@ , text >=1.1.1.0 , transformers >=0.2.2.1 , vector >= 0.10.12.3- , wreq >=0.3.0.0+ , wreq >=0.4.0.0 other-modules: Properties.ErrorProperties Properties.JsonArbitrary Properties.JsonInstances
tests/Properties/ErrorProperties.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleContexts #-} module Properties.ErrorProperties ( errorProps
tests/UnitTests/Requests.hs view
@@ -271,11 +271,19 @@ , testPost "/rest/db/scan" [("folder", "default")] noPayload - (Post.scan "default" Nothing)+ (Post.scan "default" Nothing Nothing) , testPost "/rest/db/scan" [("folder", "default"), ("sub", "foo/bar")] noPayload - (Post.scan "default" (Just "foo/bar"))+ (Post.scan "default" (Just "foo/bar") Nothing)+ , testPost "/rest/db/scan"+ [("folder", "default"), ("next", "10")] + noPayload + (Post.scan "default" Nothing (Just 10))+ , testPost "/rest/db/scan"+ [("folder", "default"), ("sub", "foo/bar"), ("next", "10")] + noPayload + (Post.scan "default" (Just "foo/bar") (Just 10)) , testPost "/rest/system/restart" noParams noPayload Post.restart , testPost "/rest/system/shutdown" noParams noPayload Post.shutdown , testPost "/rest/system/reset" noParams noPayload Post.reset