hal 1.0.0 → 1.0.0.1
raw patch · 3 files changed
+51/−39 lines, 3 filesdep ~base64-bytestringdep ~bytestringdep ~case-insensitivePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base64-bytestring, bytestring, case-insensitive, conduit, conduit-extra, containers, exceptions, hashable, hspec, http-client, http-types, mtl, scientific, text, time, transformers, unordered-containers
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- hal.cabal +5/−3
- src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs +42/−36
CHANGELOG.md view
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog][chg] and this project adheres to [Haskell's Package Versioning Policy][pvp] +## `1.0.0.1` - 2022-09-10++ - Support GHC 9.4 by eliminating compiler errors+ ## `1.0.0` - 2022-05-21 - Remove deprecated functions and classes:
hal.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1cebfef05fdb7e4d5c45fee9770d3078f6d204cc9dde85b12386562678670e51+-- hash: ad8fc8a238617cbdd4eddfdc78fdd3504dbe32daee2ac49e5e853ae3f3860fa8 name: hal-version: 1.0.0+version: 1.0.0.1 synopsis: A runtime environment for Haskell applications running on AWS Lambda. description: This library uniquely supports different types of AWS Lambda Handlers for your needs/comfort with advanced Haskell. Instead of exposing a single function@@ -58,6 +58,7 @@ DeriveGeneric DeriveLift DeriveTraversable+ DisambiguateRecordFields DuplicateRecordFields EmptyCase GeneralizedNewtypeDeriving@@ -117,6 +118,7 @@ DeriveGeneric DeriveLift DeriveTraversable+ DisambiguateRecordFields DuplicateRecordFields EmptyCase GeneralizedNewtypeDeriving@@ -129,7 +131,7 @@ ScopedTypeVariables ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-partial-type-signatures -fno-warn-name-shadowing -fwarn-tabs -fwarn-unused-imports -fwarn-missing-signatures -fwarn-incomplete-patterns -threaded -rtsopts -with-rtsopts=-N build-depends:- aeson >=1.2.0.0 && <1.6 || >=2.0.0.0 && <2.1+ aeson >=1.2.0.0 && <1.6 || >=2.0.0.0 && <2.2.0.0 , base >=4.7 && <5 , base64-bytestring , bytestring
src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs view
@@ -93,21 +93,24 @@ -- | @since 0.4.8 instance ToJSON a => ToJSON (RequestContext a) where- toJSON r = object $ catMaybes- [ Just $ "path" .= path (r :: RequestContext a)- , Just $ "accountId" .= accountId (r :: RequestContext a)- , ("authorizer" .=) <$> authorizer r- , Just $ "resourceId" .= resourceId r- , Just $ "stage" .= stage r- , ("domainPrefix" .=) <$> domainPrefix r- , Just $ "requestId" .= requestId r- , Just $ "identity" .= identity r- , ("domainName" .=) <$> domainName r- , Just $ "resourcePath" .= resourcePath r- , Just $ "httpMethod" .= httpMethod (r :: RequestContext a)- , ("extendedRequestId" .=) <$> extendedRequestId r- , Just $ "apiId" .= apiId r- ]+ toJSON r = object $ catMaybes $+ let+ RequestContext { path = p, accountId = a, httpMethod = h } = r+ in+ [ Just $ "path" .= p+ , Just $ "accountId" .= a+ , ("authorizer" .=) <$> authorizer r+ , Just $ "resourceId" .= resourceId r+ , Just $ "stage" .= stage r+ , ("domainPrefix" .=) <$> domainPrefix r+ , Just $ "requestId" .= requestId r+ , Just $ "identity" .= identity r+ , ("domainName" .=) <$> domainName r+ , Just $ "resourcePath" .= resourcePath r+ , Just $ "httpMethod" .= h+ , ("extendedRequestId" .=) <$> extendedRequestId r+ , Just $ "apiId" .= apiId r+ ] -- TODO: Should also include websocket fields -- | This type is for representing events that come from API Gateway via the@@ -203,24 +206,27 @@ -- | @since 0.4.8 instance ToJSON a => ToJSON (ProxyRequest a) where- toJSON r = object $ catMaybes- [ Just $ "path" .= path (r :: ProxyRequest a)- , toMaybe (not . null $ headers r) $- "headers" .= fromCIHashMap (headers r)- , toMaybe (not . null $ multiValueHeaders r) $- "multiValueHeaders" .= fromCIHashMap (multiValueHeaders r)- , toMaybe (not . null $ pathParameters r) $- "pathParameters" .= pathParameters r- , toMaybe (not . null $ stageVariables r) $- "stageVariables" .= stageVariables r- , Just $ "requestContext" .= requestContext r- , Just $ "resource" .= resource r- , Just $ "httpMethod" .= httpMethod (r :: ProxyRequest a)- , toMaybe (not . null $ queryStringParameters r) $- "queryStringParameters" .= queryStringParameters r- , toMaybe (not . null $ multiValueQueryStringParameters r) $- "multiValueQueryStringParameters" .=- multiValueQueryStringParameters r- , Just $ "isBase64Encoded" .= True- , Just $ "body" .= TLE.decodeUtf8 (encode (body r))- ]+ toJSON r = object $ catMaybes $+ let+ ProxyRequest { path = p, httpMethod = h } = r+ in+ [ Just $ "path" .= p+ , toMaybe (not . null $ headers r) $+ "headers" .= fromCIHashMap (headers r)+ , toMaybe (not . null $ multiValueHeaders r) $+ "multiValueHeaders" .= fromCIHashMap (multiValueHeaders r)+ , toMaybe (not . null $ pathParameters r) $+ "pathParameters" .= pathParameters r+ , toMaybe (not . null $ stageVariables r) $+ "stageVariables" .= stageVariables r+ , Just $ "requestContext" .= requestContext r+ , Just $ "resource" .= resource r+ , Just $ "httpMethod" .= h+ , toMaybe (not . null $ queryStringParameters r) $+ "queryStringParameters" .= queryStringParameters r+ , toMaybe (not . null $ multiValueQueryStringParameters r) $+ "multiValueQueryStringParameters" .=+ multiValueQueryStringParameters r+ , Just $ "isBase64Encoded" .= True+ , Just $ "body" .= TLE.decodeUtf8 (encode (body r))+ ]