Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marketplace purchase event #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Servant/GitHub/Webhook.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ import Crypto.Hash.Algorithms ( SHA1 )
import Crypto.MAC.HMAC ( hmac, HMAC(..) )
import Data.Aeson ( decode', encode, Value(String, Object) )
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.KeyMap as KeyMap
import qualified Data.Aeson.Types as AesonType
import Data.ByteArray ( convert, constEq )
import qualified Data.Text as T
import qualified Data.ByteString as BS
import Data.ByteString.Lazy ( fromStrict, toStrict )
import qualified Data.ByteString.Base16 as B16
import qualified Data.HashMap.Strict as HashMap
import Data.List ( intercalate )
import Data.Maybe ( catMaybes, fromMaybe )
import Data.Monoid ( (<>) )
Expand Down Expand Up @@ -225,8 +225,8 @@ instance HasRepository Value where

instance HasRepository AesonType.Object where
getFullName o =
do Object r <- HashMap.lookup "repository" o
String n <- HashMap.lookup "full_name" r
do Object r <- KeyMap.lookup "repository" o
String n <- KeyMap.lookup "full_name" r
pure n

-- |For use with 'github-webhooks' package types. Routes would look like:
Expand Down Expand Up @@ -444,6 +444,9 @@ instance Reflect 'WebhookIssueCommentEvent where
instance Reflect 'WebhookIssuesEvent where
reflect _ = WebhookIssuesEvent

instance Reflect 'WebhookMarketplacePurchaseEvent where
reflect _ = WebhookMarketplacePurchaseEvent

instance Reflect 'WebhookMemberEvent where
reflect _ = WebhookMemberEvent

Expand Down
6 changes: 2 additions & 4 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resolver: lts-14.1
resolver: lts-19.2

extra-deps:
- github-0.22
- binary-instances-1
- github-webhooks-0.12.0
- github-webhooks-0.16.0