packages feed

ip2location-io 1.3.0 → 1.4.0

raw patch · 4 files changed

+19/−3 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ IPGeolocation: ASInfo :: String -> String -> String -> String -> String -> ASInfo
+ IPGeolocation: [as_cidr] :: ASInfo -> String
+ IPGeolocation: [as_domain] :: ASInfo -> String
+ IPGeolocation: [as_info] :: ResponseObj -> Maybe ASInfo
+ IPGeolocation: [as_name] :: ASInfo -> String
+ IPGeolocation: [as_number] :: ASInfo -> String
+ IPGeolocation: [as_usage_type] :: ASInfo -> String
+ IPGeolocation: data ASInfo
+ IPGeolocation: instance Data.Aeson.Types.FromJSON.FromJSON IPGeolocation.ASInfo
+ IPGeolocation: instance GHC.Generics.Generic IPGeolocation.ASInfo
+ IPGeolocation: instance GHC.Show.Show IPGeolocation.ASInfo
- IPGeolocation: ResponseObj :: String -> String -> String -> String -> String -> Float -> Float -> String -> String -> String -> String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Int -> Maybe String -> Maybe String -> Maybe Continent -> Maybe Country -> Maybe Region -> Maybe City -> Maybe TimeZoneInfo -> Maybe GeoTargeting -> Maybe String -> Maybe String -> Maybe String -> Bool -> Maybe Int -> Maybe ProxyObj -> ResponseObj
+ IPGeolocation: ResponseObj :: String -> String -> String -> String -> String -> Float -> Float -> String -> String -> String -> String -> Maybe ASInfo -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Int -> Maybe String -> Maybe String -> Maybe Continent -> Maybe Country -> Maybe Region -> Maybe City -> Maybe TimeZoneInfo -> Maybe GeoTargeting -> Maybe String -> Maybe String -> Maybe String -> Bool -> Maybe Int -> Maybe ProxyObj -> ResponseObj

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for ip2location.io +## 1.4.0  -- 2025-09-26++* Added support for as_info section.++ ## 1.3.0  -- 2025-08-05  * Added support for is_bogon field.
Configuration.hs view
@@ -28,4 +28,4 @@ -}
 open :: String -> IO Config
 open apikey = do
-    return (Config apikey "sdk-haskell-iplio" "1.3.0")
+    return (Config apikey "sdk-haskell-iplio" "1.4.0")
IPGeolocation.hs view
@@ -11,7 +11,7 @@ 
 IP2Location.io API subscription at https://www.ip2location.io
 -}
-module IPGeolocation (IPResult(..), ResponseObj(..), ErrorObj(..), ErrorInfo(..), Continent(..), Translation(..), Country(..), Currency(..), Language(..), Region(..), City(..), TimeZoneInfo(..), GeoTargeting(..), ProxyObj(..), lookUpIP) where
+module IPGeolocation (IPResult(..), ResponseObj(..), ErrorObj(..), ErrorInfo(..), ASInfo(..),  Continent(..), Translation(..), Country(..), Currency(..), Language(..), Region(..), City(..), TimeZoneInfo(..), GeoTargeting(..), ProxyObj(..), lookUpIP) where
 
 import Control.Exception
 import System.Exit
@@ -25,6 +25,15 @@ import GHC.Generics (Generic)
 import Control.Applicative ((<|>))
 
+-- | AS info
+data ASInfo = ASInfo {
+    as_number :: String,
+    as_name :: String,
+    as_domain :: String,
+    as_usage_type :: String,
+    as_cidr :: String
+} deriving (Show, Generic)
+
 -- | Translation
 data Translation = Translation {
     lang :: Maybe String,
@@ -133,6 +142,7 @@     time_zone :: String,
     asn :: String,
     as :: String,
+    as_info :: Maybe ASInfo,
     isp :: Maybe String,
     domain :: Maybe String,
     net_speed :: Maybe String,
@@ -178,6 +188,7 @@     deriving (Show, Generic)
 
 -- Derive FromJSON instances
+instance FromJSON ASInfo
 instance FromJSON Translation
 instance FromJSON Continent
 instance FromJSON Currency
ip2location-io.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             1.3.0+version:             1.4.0  -- A short (one-line) description of the package. synopsis:            IP2Location.io Haskell package for IP geolocation and domain WHOIS.