extism-manifest 1.1.0.0 → 1.2.0.0
raw patch · 2 files changed
+27/−17 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Extism.Manifest: [memoryMaxVarBytes] :: Memory -> Nullable Int
+ Extism.Manifest: withMaxVarBytes :: Manifest -> Int -> Manifest
- Extism.JSON: (.=) :: JSON a => a -> a -> (a, JSValue)
+ Extism.JSON: (.=) :: JSON a1 => a2 -> a1 -> (a2, JSValue)
- Extism.JSON: (.??) :: Eq a => [(a, a)] -> a -> Nullable a
+ Extism.JSON: (.??) :: Eq a1 => [(a1, a2)] -> a1 -> Nullable a2
- Extism.JSON: class () => Typeable (a :: k)
+ Extism.JSON: class Typeable (a :: k)
- Extism.Manifest: Memory :: Nullable Int -> Nullable Int -> Memory
+ Extism.Manifest: Memory :: Nullable Int -> Nullable Int -> Nullable Int -> Memory
Files
- Extism/Manifest.hs +26/−16
- extism-manifest.cabal +1/−1
Extism/Manifest.hs view
@@ -9,21 +9,23 @@ -- | Memory options data Memory = Memory { memoryMaxPages :: Nullable Int,- memoryMaxHttpResponseBytes :: Nullable Int+ memoryMaxHttpResponseBytes :: Nullable Int,+ memoryMaxVarBytes :: Nullable Int } deriving (Eq, Show) instance JSON Memory where- showJSON (Memory max maxHttp) =+ showJSON (Memory max maxHttp maxVar) = object [ "max_pages" .= max,- "max_http_response_bytes" .= maxHttp+ "max_http_response_bytes" .= maxHttp,+ "max_var_bytes" .= maxVar ] readJSON obj =- let - max = obj .? "max_pages"- httpMax = obj .? "max_http_response_bytes"- in Ok (Memory max httpMax)+ let max = obj .? "max_pages"+ httpMax = obj .? "max_http_response_bytes"+ maxVar = obj .? "max_var_bytes"+ in Ok (Memory max httpMax maxVar) -- | HTTP request data HTTPRequest = HTTPRequest@@ -240,20 +242,28 @@ withMaxPages :: Manifest -> Int -> Manifest withMaxPages m pages = case memory m of- Null ->- m {memory = NotNull $ Memory (NotNull pages) Null}- NotNull (Memory _ x) ->- m {memory = NotNull $ Memory (NotNull pages) x}+ Null ->+ m {memory = NotNull $ Memory (NotNull pages) Null Null}+ NotNull (Memory _ x y) ->+ m {memory = NotNull $ Memory (NotNull pages) x y} - -- | Set memory.max_http_response_bytes withMaxHttpResponseBytes :: Manifest -> Int -> Manifest withMaxHttpResponseBytes m max = case memory m of- Null ->- m {memory = NotNull $ Memory Null (NotNull max)}- NotNull (Memory x _) ->- m {memory = NotNull $ Memory x (NotNull max)}+ Null ->+ m {memory = NotNull $ Memory Null (NotNull max) Null}+ NotNull (Memory x _ y) ->+ m {memory = NotNull $ Memory x (NotNull max) y}++-- | Set memory.max_var_bytes+withMaxVarBytes :: Manifest -> Int -> Manifest+withMaxVarBytes m max =+ case memory m of+ Null ->+ m {memory = NotNull $ Memory Null Null (NotNull max)}+ NotNull (Memory x y _) ->+ m {memory = NotNull $ Memory x y (NotNull max)} fromString :: String -> Either String Manifest fromString s = do
extism-manifest.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: extism-manifest-version: 1.1.0.0+version: 1.2.0.0 license: BSD-3-Clause maintainer: oss@extism.org author: Extism authors