From 846f9b047735498623bc2d448266119643fe71b8 Mon Sep 17 00:00:00 2001 From: Finley McIlwaine Date: Sat, 16 Dec 2023 11:35:00 -0800 Subject: [PATCH] Rename subregion items to one word, bumps --- ebird-api/CHANGELOG.md | 4 ++ ebird-api/ebird-api.cabal | 2 +- ebird-api/src/Data/EBird/API.hs | 6 +- ebird-api/src/Data/EBird/API/Regions.hs | 2 +- ebird-cli/CHANGELOG.md | 5 ++ ebird-cli/ebird-cli.cabal | 6 +- ebird-cli/src/Data/EBird/CLI.hs | 60 +++++++++---------- ebird-client/CHANGELOG.md | 5 ++ ebird-client/ebird-client.cabal | 4 +- ebird-client/src/Data/EBird/Client.hs | 2 +- .../src/Data/EBird/Client/Generated.hs | 10 ++-- ebird-client/src/Data/EBird/Client/Regions.hs | 14 ++--- 12 files changed, 67 insertions(+), 53 deletions(-) diff --git a/ebird-api/CHANGELOG.md b/ebird-api/CHANGELOG.md index 06bd4e4..859d4e4 100644 --- a/ebird-api/CHANGELOG.md +++ b/ebird-api/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for ebird-api +## 0.2.0.0 -- 2023-12-16 + +* Rename subregion items so subregion is one word. + ## 0.1.0.0 -- 2023-07-30 * First version. Released on an unsuspecting world. diff --git a/ebird-api/ebird-api.cabal b/ebird-api/ebird-api.cabal index 6547468..a179afe 100644 --- a/ebird-api/ebird-api.cabal +++ b/ebird-api/ebird-api.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: ebird-api -version: 0.1.0.0 +version: 0.2.0.0 synopsis: A Haskell description of the eBird API description: diff --git a/ebird-api/src/Data/EBird/API.hs b/ebird-api/src/Data/EBird/API.hs index 6e8f3a5..6866df4 100644 --- a/ebird-api/src/Data/EBird/API.hs +++ b/ebird-api/src/Data/EBird/API.hs @@ -87,7 +87,7 @@ module Data.EBird.API -- section](https://documenter.getpostman.com/view/664302/S1ENwy59#c9947c5c-2dce-4c6d-9911-7d702235506c) -- of the eBird API documentation. , RegionInfoAPI - , SubRegionListAPI + , SubregionListAPI , AdjacentRegionsAPI -- * eBird checklists @@ -194,7 +194,7 @@ type EBirdAPI = -- Region APIs :<|> RegionInfoAPI - :<|> SubRegionListAPI + :<|> SubregionListAPI :<|> AdjacentRegionsAPI -- | Convenient synonym for requiring an @x-ebirdapitoken@ on a route @@ -572,7 +572,7 @@ type RegionInfoAPI = -- -- See the [eBird API documentation for this -- route](https://documenter.getpostman.com/view/664302/S1ENwy59#382da1c8-8bff-4926-936a-a1f8b065e7d5). -type SubRegionListAPI = +type SubregionListAPI = "v2" :> "ref" :> "region" :> "list" :> WithAPIKey diff --git a/ebird-api/src/Data/EBird/API/Regions.hs b/ebird-api/src/Data/EBird/API/Regions.hs index f002ae7..1c69849 100644 --- a/ebird-api/src/Data/EBird/API/Regions.hs +++ b/ebird-api/src/Data/EBird/API/Regions.hs @@ -123,7 +123,7 @@ data RegionBounds = } deriving (Show, Read, Eq) --- | The data structure returned by the eBird 'Data.EBird.API.SubRegionListAPI' and +-- | The data structure returned by the eBird 'Data.EBird.API.SubregionListAPI' and -- 'Data.EBird.API.AdjacentRegionsAPI'. data RegionListEntry = RegionListEntry diff --git a/ebird-cli/CHANGELOG.md b/ebird-cli/CHANGELOG.md index 098d7b3..95153d4 100644 --- a/ebird-cli/CHANGELOG.md +++ b/ebird-cli/CHANGELOG.md @@ -1,5 +1,10 @@ # Revision history for ebird-cli +## 0.3.0.0 -- 2023-12-16 + +* Rename subregion items so subregion is one word. +* Bump `ebird-api` and `ebird-client` constraints. + ## 0.2.0.0 -- 2023-09-27 * Renamed `ebird` executable to `ebird-cli`. diff --git a/ebird-cli/ebird-cli.cabal b/ebird-cli/ebird-cli.cabal index 2b92752..4be2733 100644 --- a/ebird-cli/ebird-cli.cabal +++ b/ebird-cli/ebird-cli.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: ebird-cli -version: 0.2.0.0 +version: 0.3.0.0 synopsis: A command-line utility for interacting with the eBird API. @@ -47,8 +47,8 @@ library exposed-modules: Data.EBird.CLI build-depends: - ebird-api >= 0.1.0.0 && < 0.2 - , ebird-client >= 0.1.0.0 && < 0.2 + ebird-api >= 0.2.0.0 && < 0.3 + , ebird-client >= 0.2.0.0 && < 0.3 , aeson >= 1.5.6.0 && < 2.2 , aeson-pretty >= 0.8.8 && < 0.9 diff --git a/ebird-cli/src/Data/EBird/CLI.hs b/ebird-cli/src/Data/EBird/CLI.hs index 571bd78..9c148ab 100644 --- a/ebird-cli/src/Data/EBird/CLI.hs +++ b/ebird-cli/src/Data/EBird/CLI.hs @@ -63,7 +63,7 @@ eBirdCli = do opts = info (eBirdCommand <**> helper) - ( header "ebird - Go birding on your command line!" + ( header "ebird-cli - Go birding on your command line!" <> progDesc "Query the official eBird API" ) @@ -98,7 +98,7 @@ runEBirdCommand getAPIKey = \case recentObservationsHotspots recentObservationsProvisionals recentObservationsMaxResults - recentObservationsSubRegions + recentObservationsSubregions recentObservationsSPPLocale handleResponse res @@ -111,7 +111,7 @@ runEBirdCommand getAPIKey = \case recentNotableObservationsDetail recentNotableObservationsHotspots recentNotableObservationsMaxResults - recentNotableObservationsSubRegions + recentNotableObservationsSubregions recentNotableObservationsSPPLocale handleResponse res @@ -125,7 +125,7 @@ runEBirdCommand getAPIKey = \case recentSpeciesObservationsHotspots recentSpeciesObservationsProvisionals recentSpeciesObservationsMaxResults - recentSpeciesObservationsSubRegions + recentSpeciesObservationsSubregions recentSpeciesObservationsSPPLocale handleResponse res @@ -204,7 +204,7 @@ runEBirdCommand getAPIKey = \case historicalObservationsProvisionals historicalObservationsMaxResults historicalObservationsRank - historicalObservationsSubRegions + historicalObservationsSubregions historicalObservationsSPPLocale handleResponse res @@ -322,12 +322,12 @@ runEBirdCommand getAPIKey = \case regionInfoRegionNameFormat handleResponse res - SubRegionListCommand SubRegionListOptions{..} -> do + SubregionListCommand SubregionListOptions{..} -> do apiKey <- getAPIKey res <- askEBird $ - subRegionList apiKey - subRegionListRegionType - subRegionListParentRegionCode + subregionList apiKey + subregionListRegionType + subregionListParentRegionCode handleResponse res AdjacentRegionsCommand AdjacentRegionsOptions{..} -> do @@ -389,7 +389,7 @@ data EBirdCommand | TaxonomyVersionsCommand | TaxonomicGroupsCommand TaxonomicGroupsOptions | RegionInfoCommand RegionInfoOptions - | SubRegionListCommand SubRegionListOptions + | SubregionListCommand SubregionListOptions | AdjacentRegionsCommand AdjacentRegionsOptions deriving (Show, Eq) @@ -402,7 +402,7 @@ data RecentObservationsOptions = , recentObservationsHotspots :: Maybe Bool , recentObservationsProvisionals :: Maybe Bool , recentObservationsMaxResults :: Maybe Integer - , recentObservationsSubRegions :: Maybe RegionCode + , recentObservationsSubregions :: Maybe RegionCode , recentObservationsSPPLocale :: Maybe SPPLocale } deriving (Show, Read, Eq) @@ -415,7 +415,7 @@ data RecentNotableObservationsOptions = , recentNotableObservationsDetail :: Maybe DetailLevel , recentNotableObservationsHotspots :: Maybe Bool , recentNotableObservationsMaxResults :: Maybe Integer - , recentNotableObservationsSubRegions :: Maybe RegionCode + , recentNotableObservationsSubregions :: Maybe RegionCode , recentNotableObservationsSPPLocale :: Maybe SPPLocale } deriving (Show, Read, Eq) @@ -429,7 +429,7 @@ data RecentSpeciesObservationsOptions = , recentSpeciesObservationsHotspots :: Maybe Bool , recentSpeciesObservationsProvisionals :: Maybe Bool , recentSpeciesObservationsMaxResults :: Maybe Integer - , recentSpeciesObservationsSubRegions :: Maybe RegionCode + , recentSpeciesObservationsSubregions :: Maybe RegionCode , recentSpeciesObservationsSPPLocale :: Maybe SPPLocale } deriving (Show, Read, Eq) @@ -507,7 +507,7 @@ data HistoricalObservationsOptions = , historicalObservationsProvisionals :: Maybe Bool , historicalObservationsMaxResults :: Maybe Integer , historicalObservationsRank :: Maybe SelectObservation - , historicalObservationsSubRegions :: Maybe RegionCode + , historicalObservationsSubregions :: Maybe RegionCode , historicalObservationsSPPLocale :: Maybe SPPLocale } deriving (Show, Read, Eq) @@ -630,15 +630,15 @@ data RegionInfoOptions = } deriving (Show, Read, Eq) --- | Options for the @sub-regions@ command. -data SubRegionListOptions = - SubRegionListOptions - { subRegionListParentRegionCode :: RegionCode - , subRegionListRegionType :: RegionType +-- | Options for the @subregions@ command. +data SubregionListOptions = + SubregionListOptions + { subregionListParentRegionCode :: RegionCode + , subregionListRegionType :: RegionType } deriving (Show, Read, Eq) --- | Options for the @sub-regions@ command. +-- | Options for the @subregions@ command. newtype AdjacentRegionsOptions = AdjacentRegionsOptions { adjacentRegionsRegion :: Region @@ -699,7 +699,7 @@ eBirdCommand = ( commandGroup "Region commands:" <> command "region-info" regionInfoInfo - <> command "sub-regions" subRegionsInfo + <> command "subregions" subregionsInfo <> command "adjacent-regions" adjacentRegionsInfo <> hidden ) @@ -854,11 +854,11 @@ eBirdCommand = (RegionInfoCommand <$> regionInfoOptions) (progDesc "Get information about a region") - subRegionsInfo :: ParserInfo EBirdCommand - subRegionsInfo = + subregionsInfo :: ParserInfo EBirdCommand + subregionsInfo = info - (SubRegionListCommand <$> subRegionListOptions) - (progDesc "Get the list of sub-regions within a region") + (SubregionListCommand <$> subregionListOptions) + (progDesc "Get the list of subregions within a region") adjacentRegionsInfo :: ParserInfo EBirdCommand adjacentRegionsInfo = @@ -1438,15 +1438,15 @@ regionInfoOptions = <*> optional regionNameFormat <**> helper --- | Parse the options for the @sub-regions@ command. -subRegionListOptions :: Parser SubRegionListOptions -subRegionListOptions = - SubRegionListOptions +-- | Parse the options for the @subregions@ command. +subregionListOptions :: Parser SubregionListOptions +subregionListOptions = + SubregionListOptions <$> regionCode <*> regionType <**> helper --- | Parse the options for the @sub-regions@ command. +-- | Parse the options for the @subregions@ command. adjacentRegionsOptions :: Parser AdjacentRegionsOptions adjacentRegionsOptions = AdjacentRegionsOptions diff --git a/ebird-client/CHANGELOG.md b/ebird-client/CHANGELOG.md index c885b86..e284345 100644 --- a/ebird-client/CHANGELOG.md +++ b/ebird-client/CHANGELOG.md @@ -1,5 +1,10 @@ # Revision history for ebird-client +## 0.2.0.0 -- 2023-12-16 + +* Rename subregion items so that subregion is one word. +* Bump `ebird-api` constraint. + ## 0.1.0.0 -- 2023-07-30 * First version. Released on an unsuspecting world. diff --git a/ebird-client/ebird-client.cabal b/ebird-client/ebird-client.cabal index 591d447..78820f0 100644 --- a/ebird-client/ebird-client.cabal +++ b/ebird-client/ebird-client.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: ebird-client -version: 0.1.0.0 +version: 0.2.0.0 synopsis: Client functions for querying the eBird API. description: @@ -57,7 +57,7 @@ library Data.EBird.Client.Regions Data.EBird.Client.Taxonomy build-depends: - , ebird-api >= 0.1.0.0 && < 0.2 + , ebird-api >= 0.2.0.0 && < 0.3 , data-default >= 0.7.1.1 && < 0.8 , http-client-tls >= 0.3.5.3 && < 0.4 diff --git a/ebird-client/src/Data/EBird/Client.hs b/ebird-client/src/Data/EBird/Client.hs index 076f605..0479a03 100644 --- a/ebird-client/src/Data/EBird/Client.hs +++ b/ebird-client/src/Data/EBird/Client.hs @@ -50,7 +50,7 @@ module Data.EBird.Client ( -- ** Region queries , regionInfo - , subRegionList + , subregionList , adjacentRegions -- * Less convenient, generated queries diff --git a/ebird-client/src/Data/EBird/Client/Generated.hs b/ebird-client/src/Data/EBird/Client/Generated.hs index 12c06c1..a673d68 100644 --- a/ebird-client/src/Data/EBird/Client/Generated.hs +++ b/ebird-client/src/Data/EBird/Client/Generated.hs @@ -1,7 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeApplications #-} -{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas -ddump-verbose-inlinings #-} {-# HLINT ignore "Eta reduce" #-} -- | @@ -56,7 +56,7 @@ module Data.EBird.Client.Generated -- ** Region queries , regionInfo_ - , subRegionList_ + , subregionList_ , adjacentRegions_ ) where @@ -709,13 +709,13 @@ regionInfo_ -- /default: 'Full'/ -> ClientM RegionInfo --- | Get a list of sub-regions of a given region type within a given region. +-- | Get a list of subregions of a given region type within a given region. -- Keep in mind that many combinations of sub region and parent region are -- invalid, e.g. 'CountryType' regions within "US-WY". -- -- See the [eBird API documentation for the corresponding -- endpoint](https://documenter.getpostman.com/view/664302/S1ENwy59#382da1c8-8bff-4926-936a-a1f8b065e7d5). -subRegionList_ +subregionList_ :: Text -- ^ eBird API key -> RegionType @@ -760,5 +760,5 @@ recentObservations_ :<|> taxonomyVersions_ :<|> taxonomicGroups_ :<|> regionInfo_ - :<|> subRegionList_ + :<|> subregionList_ :<|> adjacentRegions_ = client (Proxy @EBirdAPI) diff --git a/ebird-client/src/Data/EBird/Client/Regions.hs b/ebird-client/src/Data/EBird/Client/Regions.hs index ca730a2..1c220ec 100644 --- a/ebird-client/src/Data/EBird/Client/Regions.hs +++ b/ebird-client/src/Data/EBird/Client/Regions.hs @@ -96,22 +96,22 @@ makeFieldLabels ''RegionInfoParams -- * Sub region list ------------------------------------------------------------------------------- --- | Get a list of sub-regions of a given region type within a given region. --- Keep in mind that many combinations of sub-region and parent region are +-- | Get a list of subregions of a given region type within a given region. +-- Keep in mind that many combinations of subregion and parent region are -- invalid, e.g. 'CountryType' regions within \"US-WY\". -- -- For example, get county sub regions of Wyoming (using @-XOverloadedStrings@): -- -- @ --- askEBird $ subRegionList key Subnational2Type "US-WY" +-- askEBird $ subregionList key Subnational2Type "US-WY" -- @ -- --- Note that the endpoint for this query is simple enough that 'subRegionList' --- is equivalent to the generated 'subRegionList_'. +-- Note that the endpoint for this query is simple enough that 'subregionList' +-- is equivalent to the generated 'subregionList_'. -- -- See the [eBird API documentation for the corresponding -- endpoint](https://documenter.getpostman.com/view/664302/S1ENwy59#382da1c8-8bff-4926-936a-a1f8b065e7d5). -subRegionList +subregionList :: Text -- ^ eBird API key -> RegionType @@ -119,7 +119,7 @@ subRegionList -> RegionCode -- ^ Parent 'RegionCode' -> ClientM [RegionListEntry] -subRegionList = subRegionList_ +subregionList = subregionList_ ------------------------------------------------------------------------------- -- * Adjacent regions