vcs-web-hook-parse 0.1.0.0 → 0.2.0.0
raw patch · 3 files changed
+296/−131 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Web.Hook.GitLab: authorEmail :: Author -> Text
- Web.Hook.GitLab: authorName :: Author -> Text
- Web.Hook.GitLab: commitAuthor :: Commit -> Author
- Web.Hook.GitLab: commitId :: Commit -> CommitID
- Web.Hook.GitLab: commitMessage :: Commit -> Text
- Web.Hook.GitLab: commitTimestamp :: Commit -> Text
- Web.Hook.GitLab: commitUrl :: Commit -> Url
- Web.Hook.GitLab: ieAction :: IssueEvent -> Text
- Web.Hook.GitLab: ieIssue :: IssueEvent -> Issue
- Web.Hook.GitLab: ieUser :: IssueEvent -> User
- Web.Hook.GitLab: instance FromJSON Author
- Web.Hook.GitLab: instance FromJSON Commit
- Web.Hook.GitLab: instance FromJSON Event
- Web.Hook.GitLab: instance FromJSON Issue
- Web.Hook.GitLab: instance FromJSON IssueEvent
- Web.Hook.GitLab: instance FromJSON MergeEndpoint
- Web.Hook.GitLab: instance FromJSON MergeRequest
- Web.Hook.GitLab: instance FromJSON MergeRequestEvent
- Web.Hook.GitLab: instance FromJSON Push
- Web.Hook.GitLab: instance FromJSON Repository
- Web.Hook.GitLab: instance FromJSON User
- Web.Hook.GitLab: issueAssigneeId :: Issue -> Int
- Web.Hook.GitLab: issueAuthorId :: Issue -> Int
- Web.Hook.GitLab: issueBranch :: Issue -> Maybe Text
- Web.Hook.GitLab: issueCreatedAt :: Issue -> Text
- Web.Hook.GitLab: issueDescription :: Issue -> Text
- Web.Hook.GitLab: issueId :: Issue -> Int
- Web.Hook.GitLab: issueInternalId :: Issue -> Int
- Web.Hook.GitLab: issueMilestoneId :: Issue -> Maybe Int
- Web.Hook.GitLab: issuePosition :: Issue -> Int
- Web.Hook.GitLab: issueProjectId :: Issue -> Int
- Web.Hook.GitLab: issueState :: Issue -> Text
- Web.Hook.GitLab: issueTitle :: Issue -> Text
- Web.Hook.GitLab: issueUpdatedAt :: Issue -> Text
- Web.Hook.GitLab: issueUrl :: Issue -> Url
- Web.Hook.GitLab: mepHttpurl :: MergeEndpoint -> Url
- Web.Hook.GitLab: mepName :: MergeEndpoint -> Text
- Web.Hook.GitLab: mepNamespace :: MergeEndpoint -> Text
- Web.Hook.GitLab: mepSshUrl :: MergeEndpoint -> Url
- Web.Hook.GitLab: mepVisibility :: MergeEndpoint -> Int
- Web.Hook.GitLab: mrAssigneeId :: MergeRequest -> Maybe Int
- Web.Hook.GitLab: mrAuthorId :: MergeRequest -> Int
- Web.Hook.GitLab: mrCreatedAt :: MergeRequest -> Text
- Web.Hook.GitLab: mrDescription :: MergeRequest -> Text
- Web.Hook.GitLab: mrId :: MergeRequest -> Int
- Web.Hook.GitLab: mrInternalId :: MergeRequest -> Int
- Web.Hook.GitLab: mrLastCommit :: MergeRequest -> Commit
- Web.Hook.GitLab: mrMergeStatus :: MergeRequest -> Text
- Web.Hook.GitLab: mrMilestoneId :: MergeRequest -> Maybe Int
- Web.Hook.GitLab: mrSource :: MergeRequest -> MergeEndpoint
- Web.Hook.GitLab: mrSourceBranch :: MergeRequest -> Text
- Web.Hook.GitLab: mrSourceProjectId :: MergeRequest -> Int
- Web.Hook.GitLab: mrState :: MergeRequest -> Text
- Web.Hook.GitLab: mrTarget :: MergeRequest -> MergeEndpoint
- Web.Hook.GitLab: mrTargetBranch :: MergeRequest -> Text
- Web.Hook.GitLab: mrTargetProjectId :: MergeRequest -> Int
- Web.Hook.GitLab: mrTitle :: MergeRequest -> Text
- Web.Hook.GitLab: mrUpdatedAt :: MergeRequest -> Text
- Web.Hook.GitLab: mrUrl :: MergeRequest -> Url
- Web.Hook.GitLab: mreAction :: MergeRequestEvent -> Text
- Web.Hook.GitLab: mreRequest :: MergeRequestEvent -> MergeRequest
- Web.Hook.GitLab: mreUser :: MergeRequestEvent -> User
- Web.Hook.GitLab: pushAfter :: Push -> CommitID
- Web.Hook.GitLab: pushBefore :: Push -> CommitID
- Web.Hook.GitLab: pushCommits :: Push -> [Commit]
- Web.Hook.GitLab: pushCommitsTotal :: Push -> Int
- Web.Hook.GitLab: pushProjectId :: Push -> Int
- Web.Hook.GitLab: pushRef :: Push -> Text
- Web.Hook.GitLab: pushRepository :: Push -> Repository
- Web.Hook.GitLab: pushUserEmail :: Push -> Text
- Web.Hook.GitLab: pushUserId :: Push -> Int
- Web.Hook.GitLab: pushUserName :: Push -> Text
- Web.Hook.GitLab: repoDesc :: Repository -> Text
- Web.Hook.GitLab: repoGitHttpUrl :: Repository -> Url
- Web.Hook.GitLab: repoGitSshUrl :: Repository -> Url
- Web.Hook.GitLab: repoHomepage :: Repository -> Url
- Web.Hook.GitLab: repoName :: Repository -> Text
- Web.Hook.GitLab: repoUrl :: Repository -> Url
- Web.Hook.GitLab: repoVisibility :: Repository -> Int
- Web.Hook.GitLab: userAvatar :: User -> Url
- Web.Hook.GitLab: userName :: User -> Text
- Web.Hook.GitLab: userUsername :: User -> Text
- Web.Hook.Gogs: commitAuthor :: Commit -> User
- Web.Hook.Gogs: commitId :: Commit -> CommitID
- Web.Hook.Gogs: commitMessage :: Commit -> Text
- Web.Hook.Gogs: commitUrl :: Commit -> Url
- Web.Hook.Gogs: instance FromJSON Commit
- Web.Hook.Gogs: instance FromJSON Push
- Web.Hook.Gogs: instance FromJSON Repository
- Web.Hook.Gogs: instance FromJSON User
- Web.Hook.Gogs: instance Show Commit
- Web.Hook.Gogs: instance Show Push
- Web.Hook.Gogs: instance Show Repository
- Web.Hook.Gogs: instance Show User
- Web.Hook.Gogs: pushAfter :: Push -> CommitID
- Web.Hook.Gogs: pushBefore :: Push -> CommitID
- Web.Hook.Gogs: pushCommits :: Push -> [Commit]
- Web.Hook.Gogs: pushCompareUrl :: Push -> Url
- Web.Hook.Gogs: pushPusher :: Push -> User
- Web.Hook.Gogs: pushRef :: Push -> Text
- Web.Hook.Gogs: pushRepository :: Push -> Repository
- Web.Hook.Gogs: pushSecret :: Push -> Text
- Web.Hook.Gogs: repoDescription :: Repository -> Text
- Web.Hook.Gogs: repoId :: Repository -> Int
- Web.Hook.Gogs: repoName :: Repository -> Text
- Web.Hook.Gogs: repoOwner :: Repository -> User
- Web.Hook.Gogs: repoPrivate :: Repository -> Bool
- Web.Hook.Gogs: repoUrl :: Repository -> Url
- Web.Hook.Gogs: repoWatchers :: Repository -> Int
- Web.Hook.Gogs: repoWebsite :: Repository -> Url
- Web.Hook.Gogs: userEmail :: User -> Text
- Web.Hook.Gogs: userName :: User -> Text
- Web.Hook.Gogs: userUsername :: User -> Text
+ Web.Hook.GitLab: Diff :: Text -> Text -> Text -> Text -> Text -> Bool -> Bool -> Bool -> Diff
+ Web.Hook.GitLab: EventNote :: NoteEvent -> Event
+ Web.Hook.GitLab: NTCommit :: Commit -> NoteTarget
+ Web.Hook.GitLab: NTIssue :: Issue -> NoteTarget
+ Web.Hook.GitLab: NTMergeRequest :: MergeRequest -> NoteTarget
+ Web.Hook.GitLab: NTSnippet :: Snippet -> NoteTarget
+ Web.Hook.GitLab: Note :: Int -> Text -> Int -> Text -> Text -> Int -> Maybe Text -> CommitID -> Maybe Int -> Bool -> Maybe Diff -> Url -> Note
+ Web.Hook.GitLab: NoteEvent :: User -> Int -> Repository -> Note -> NoteTarget -> NoteEvent
+ Web.Hook.GitLab: Snippet :: Int -> Text -> Text -> Int -> Int -> Text -> Text -> Text -> Maybe Text -> Text -> Int -> Snippet
+ Web.Hook.GitLab: [authorEmail] :: Author -> Text
+ Web.Hook.GitLab: [authorName] :: Author -> Text
+ Web.Hook.GitLab: [commitAdded] :: Commit -> [File]
+ Web.Hook.GitLab: [commitAuthor] :: Commit -> Author
+ Web.Hook.GitLab: [commitId] :: Commit -> CommitID
+ Web.Hook.GitLab: [commitMessage] :: Commit -> Text
+ Web.Hook.GitLab: [commitModified] :: Commit -> [File]
+ Web.Hook.GitLab: [commitRemoved] :: Commit -> [File]
+ Web.Hook.GitLab: [commitTimestamp] :: Commit -> Text
+ Web.Hook.GitLab: [commitUrl] :: Commit -> Url
+ Web.Hook.GitLab: [diffAMode] :: Diff -> Text
+ Web.Hook.GitLab: [diffBMode] :: Diff -> Text
+ Web.Hook.GitLab: [diffDeletedFile] :: Diff -> Bool
+ Web.Hook.GitLab: [diffDiff] :: Diff -> Text
+ Web.Hook.GitLab: [diffNewFile] :: Diff -> Bool
+ Web.Hook.GitLab: [diffNewPath] :: Diff -> Text
+ Web.Hook.GitLab: [diffOldPath] :: Diff -> Text
+ Web.Hook.GitLab: [diffRenamedFile] :: Diff -> Bool
+ Web.Hook.GitLab: [ieAction] :: IssueEvent -> Text
+ Web.Hook.GitLab: [ieIssue] :: IssueEvent -> Issue
+ Web.Hook.GitLab: [ieRepo] :: IssueEvent -> Repository
+ Web.Hook.GitLab: [ieUser] :: IssueEvent -> User
+ Web.Hook.GitLab: [issueAssigneeId] :: Issue -> Int
+ Web.Hook.GitLab: [issueAuthorId] :: Issue -> Int
+ Web.Hook.GitLab: [issueBranch] :: Issue -> Maybe Text
+ Web.Hook.GitLab: [issueCreatedAt] :: Issue -> Text
+ Web.Hook.GitLab: [issueDescription] :: Issue -> Text
+ Web.Hook.GitLab: [issueId] :: Issue -> Int
+ Web.Hook.GitLab: [issueInternalId] :: Issue -> Int
+ Web.Hook.GitLab: [issueMilestoneId] :: Issue -> Maybe Int
+ Web.Hook.GitLab: [issuePosition] :: Issue -> Int
+ Web.Hook.GitLab: [issueProjectId] :: Issue -> Int
+ Web.Hook.GitLab: [issueState] :: Issue -> Text
+ Web.Hook.GitLab: [issueTitle] :: Issue -> Text
+ Web.Hook.GitLab: [issueUpdatedAt] :: Issue -> Text
+ Web.Hook.GitLab: [issueUrl] :: Issue -> Url
+ Web.Hook.GitLab: [mepHttpUrl] :: MergeEndpoint -> Url
+ Web.Hook.GitLab: [mepName] :: MergeEndpoint -> Text
+ Web.Hook.GitLab: [mepNamespace] :: MergeEndpoint -> Text
+ Web.Hook.GitLab: [mepSshUrl] :: MergeEndpoint -> Url
+ Web.Hook.GitLab: [mepVisibility] :: MergeEndpoint -> Int
+ Web.Hook.GitLab: [mepWebUrl] :: MergeEndpoint -> Url
+ Web.Hook.GitLab: [mrAssigneeId] :: MergeRequest -> Maybe Int
+ Web.Hook.GitLab: [mrAuthorId] :: MergeRequest -> Int
+ Web.Hook.GitLab: [mrCreatedAt] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrDescription] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrId] :: MergeRequest -> Int
+ Web.Hook.GitLab: [mrInternalId] :: MergeRequest -> Int
+ Web.Hook.GitLab: [mrLastCommit] :: MergeRequest -> Commit
+ Web.Hook.GitLab: [mrMergeStatus] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrMilestoneId] :: MergeRequest -> Maybe Int
+ Web.Hook.GitLab: [mrSourceBranch] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrSourceProjectId] :: MergeRequest -> Int
+ Web.Hook.GitLab: [mrSource] :: MergeRequest -> MergeEndpoint
+ Web.Hook.GitLab: [mrState] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrTargetBranch] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrTargetProjectId] :: MergeRequest -> Int
+ Web.Hook.GitLab: [mrTarget] :: MergeRequest -> MergeEndpoint
+ Web.Hook.GitLab: [mrTitle] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrUpdatedAt] :: MergeRequest -> Text
+ Web.Hook.GitLab: [mrUrl] :: MergeRequest -> Url
+ Web.Hook.GitLab: [mrWorkInProgress] :: MergeRequest -> Bool
+ Web.Hook.GitLab: [mreAction] :: MergeRequestEvent -> Text
+ Web.Hook.GitLab: [mreRequest] :: MergeRequestEvent -> MergeRequest
+ Web.Hook.GitLab: [mreUser] :: MergeRequestEvent -> User
+ Web.Hook.GitLab: [neNote] :: NoteEvent -> Note
+ Web.Hook.GitLab: [neProjectId] :: NoteEvent -> Int
+ Web.Hook.GitLab: [neRepo] :: NoteEvent -> Repository
+ Web.Hook.GitLab: [neTarget] :: NoteEvent -> NoteTarget
+ Web.Hook.GitLab: [neUser] :: NoteEvent -> User
+ Web.Hook.GitLab: [noteAuthorId] :: Note -> Int
+ Web.Hook.GitLab: [noteCommitId] :: Note -> CommitID
+ Web.Hook.GitLab: [noteCreatedAt] :: Note -> Text
+ Web.Hook.GitLab: [noteId] :: Note -> Int
+ Web.Hook.GitLab: [noteLineCode] :: Note -> Maybe Text
+ Web.Hook.GitLab: [noteNote] :: Note -> Text
+ Web.Hook.GitLab: [noteNoteableId] :: Note -> Maybe Int
+ Web.Hook.GitLab: [noteProjectId] :: Note -> Int
+ Web.Hook.GitLab: [noteStDiff] :: Note -> Maybe Diff
+ Web.Hook.GitLab: [noteSystem] :: Note -> Bool
+ Web.Hook.GitLab: [noteUpdatedAt] :: Note -> Text
+ Web.Hook.GitLab: [noteUrl] :: Note -> Url
+ Web.Hook.GitLab: [pushAfter] :: Push -> CommitID
+ Web.Hook.GitLab: [pushBefore] :: Push -> CommitID
+ Web.Hook.GitLab: [pushCommitsTotal] :: Push -> Int
+ Web.Hook.GitLab: [pushCommits] :: Push -> [Commit]
+ Web.Hook.GitLab: [pushProjectId] :: Push -> Int
+ Web.Hook.GitLab: [pushRef] :: Push -> Text
+ Web.Hook.GitLab: [pushRepository] :: Push -> Repository
+ Web.Hook.GitLab: [pushUserEmail] :: Push -> Text
+ Web.Hook.GitLab: [pushUserId] :: Push -> Int
+ Web.Hook.GitLab: [pushUserName] :: Push -> Text
+ Web.Hook.GitLab: [repoDesc] :: Repository -> Text
+ Web.Hook.GitLab: [repoGitHttpUrl] :: Repository -> Maybe Url
+ Web.Hook.GitLab: [repoGitSshUrl] :: Repository -> Maybe Url
+ Web.Hook.GitLab: [repoHomepage] :: Repository -> Url
+ Web.Hook.GitLab: [repoName] :: Repository -> Text
+ Web.Hook.GitLab: [repoUrl] :: Repository -> Url
+ Web.Hook.GitLab: [repoVisibility] :: Repository -> Maybe Int
+ Web.Hook.GitLab: [snippetAuthorId] :: Snippet -> Int
+ Web.Hook.GitLab: [snippetContent] :: Snippet -> Text
+ Web.Hook.GitLab: [snippetCreatedAt] :: Snippet -> Text
+ Web.Hook.GitLab: [snippetExpiresAt] :: Snippet -> Maybe Text
+ Web.Hook.GitLab: [snippetFileName] :: Snippet -> Text
+ Web.Hook.GitLab: [snippetId] :: Snippet -> Int
+ Web.Hook.GitLab: [snippetProjectId] :: Snippet -> Int
+ Web.Hook.GitLab: [snippetTitle] :: Snippet -> Text
+ Web.Hook.GitLab: [snippetType] :: Snippet -> Text
+ Web.Hook.GitLab: [snippetUpdatedAt] :: Snippet -> Text
+ Web.Hook.GitLab: [snippetVisibility] :: Snippet -> Int
+ Web.Hook.GitLab: [userAvatar] :: User -> Url
+ Web.Hook.GitLab: [userName] :: User -> Text
+ Web.Hook.GitLab: [userUsername] :: User -> Text
+ Web.Hook.GitLab: data Diff
+ Web.Hook.GitLab: data Note
+ Web.Hook.GitLab: data NoteEvent
+ Web.Hook.GitLab: data NoteTarget
+ Web.Hook.GitLab: data Snippet
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Author
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Commit
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Diff
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Event
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Issue
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.IssueEvent
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.MergeEndpoint
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.MergeRequest
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.MergeRequestEvent
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Note
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.NoteEvent
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Push
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Repository
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.Snippet
+ Web.Hook.GitLab: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.GitLab.User
+ Web.Hook.GitLab: type File = Text
+ Web.Hook.Gogs: [commitAuthor] :: Commit -> User
+ Web.Hook.Gogs: [commitId] :: Commit -> CommitID
+ Web.Hook.Gogs: [commitMessage] :: Commit -> Text
+ Web.Hook.Gogs: [commitUrl] :: Commit -> Url
+ Web.Hook.Gogs: [pushAfter] :: Push -> CommitID
+ Web.Hook.Gogs: [pushBefore] :: Push -> CommitID
+ Web.Hook.Gogs: [pushCommits] :: Push -> [Commit]
+ Web.Hook.Gogs: [pushCompareUrl] :: Push -> Url
+ Web.Hook.Gogs: [pushPusher] :: Push -> User
+ Web.Hook.Gogs: [pushRef] :: Push -> Text
+ Web.Hook.Gogs: [pushRepository] :: Push -> Repository
+ Web.Hook.Gogs: [pushSecret] :: Push -> Text
+ Web.Hook.Gogs: [repoDescription] :: Repository -> Text
+ Web.Hook.Gogs: [repoId] :: Repository -> Int
+ Web.Hook.Gogs: [repoName] :: Repository -> Text
+ Web.Hook.Gogs: [repoOwner] :: Repository -> User
+ Web.Hook.Gogs: [repoPrivate] :: Repository -> Bool
+ Web.Hook.Gogs: [repoUrl] :: Repository -> Url
+ Web.Hook.Gogs: [repoWatchers] :: Repository -> Int
+ Web.Hook.Gogs: [repoWebsite] :: Repository -> Url
+ Web.Hook.Gogs: [userEmail] :: User -> Text
+ Web.Hook.Gogs: [userName] :: User -> Text
+ Web.Hook.Gogs: [userUsername] :: User -> Text
+ Web.Hook.Gogs: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.Gogs.Commit
+ Web.Hook.Gogs: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.Gogs.Push
+ Web.Hook.Gogs: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.Gogs.Repository
+ Web.Hook.Gogs: instance Data.Aeson.Types.FromJSON.FromJSON Web.Hook.Gogs.User
+ Web.Hook.Gogs: instance GHC.Show.Show Web.Hook.Gogs.Commit
+ Web.Hook.Gogs: instance GHC.Show.Show Web.Hook.Gogs.Push
+ Web.Hook.Gogs: instance GHC.Show.Show Web.Hook.Gogs.Repository
+ Web.Hook.Gogs: instance GHC.Show.Show Web.Hook.Gogs.User
- Web.Hook.GitLab: Commit :: CommitID -> Text -> Text -> Url -> Author -> Commit
+ Web.Hook.GitLab: Commit :: CommitID -> Text -> Text -> Url -> Author -> [File] -> [File] -> [File] -> Commit
- Web.Hook.GitLab: IssueEvent :: User -> Issue -> Text -> IssueEvent
+ Web.Hook.GitLab: IssueEvent :: User -> Repository -> Issue -> Text -> IssueEvent
- Web.Hook.GitLab: MergeEndpoint :: Text -> Url -> Url -> Int -> Text -> MergeEndpoint
+ Web.Hook.GitLab: MergeEndpoint :: Text -> Url -> Url -> Url -> Int -> Text -> MergeEndpoint
- Web.Hook.GitLab: MergeRequest :: Int -> Text -> Text -> Int -> Int -> Maybe Int -> Text -> Text -> Text -> Maybe Int -> Text -> Text -> Int -> Int -> Text -> MergeEndpoint -> MergeEndpoint -> Commit -> Url -> MergeRequest
+ Web.Hook.GitLab: MergeRequest :: Int -> Text -> Text -> Int -> Int -> Maybe Int -> Text -> Text -> Text -> Maybe Int -> Text -> Text -> Int -> Int -> Text -> MergeEndpoint -> MergeEndpoint -> Commit -> Bool -> Url -> MergeRequest
- Web.Hook.GitLab: Repository :: Text -> Url -> Text -> Url -> Url -> Url -> Int -> Repository
+ Web.Hook.GitLab: Repository :: Text -> Url -> Text -> Url -> Maybe Url -> Maybe Url -> Maybe Int -> Repository
Files
- NEWS +24/−0
- src/Web/Hook/GitLab.hs +270/−129
- vcs-web-hook-parse.cabal +2/−2
NEWS view
@@ -3,6 +3,30 @@ +vcs-web-hook-parse 0.2.0.0 -- 2016-01-27+========================================++General, build and documentation changes:++* (None)++New APIs, features and enhancements:++* Add added/modified/removed file list fields to Commit for Gitlab+* Support for Gitlab note events++Bug fixes:++* (None)++Dependency changes:++* (None)+++++ vcs-web-hook-parse 0.1.0.0 -- 2015-08-10 ========================================
src/Web/Hook/GitLab.hs view
@@ -18,16 +18,22 @@ module Web.Hook.GitLab ( CommitID , Url+ , File , Author (..) , User (..) , Commit (..) , MergeEndpoint (..) , Repository (..)+ , Diff (..)+ , Snippet (..)+ , NoteTarget (..) , Issue (..) , MergeRequest (..)+ , Note (..) , Push (..) , IssueEvent (..) , MergeRequestEvent (..)+ , NoteEvent (..) , Event (..) , parse )@@ -36,7 +42,8 @@ import Control.Applicative import Control.Monad (mzero) import Data.Aeson-import Data.Aeson.Types (Parser)+import Data.Aeson.Types (Parser, typeMismatch)+ import qualified Data.ByteString.Lazy as B import qualified Data.Text as T @@ -44,43 +51,107 @@ type Url = T.Text +type File = T.Text++text :: Parser T.Text -> T.Text -> Parser T.Text+text parser expected = do+ got <- parser+ if got == expected+ then return got+ else mzero+ data Author = Author { authorName :: T.Text , authorEmail :: T.Text } +instance FromJSON Author where+ parseJSON (Object o) =+ Author <$>+ o .: "name" <*>+ o .: "email"+ parseJSON v = typeMismatch "Author" v+ data User = User { userName :: T.Text , userUsername :: T.Text , userAvatar :: Url } +instance FromJSON User where+ parseJSON (Object o) =+ User <$>+ o .: "name" <*>+ o .: "username" <*>+ o .: "avatar_url"+ parseJSON v = typeMismatch "User" v+ data Commit = Commit { commitId :: CommitID , commitMessage :: T.Text , commitTimestamp :: T.Text , commitUrl :: Url , commitAuthor :: Author+ , commitAdded :: [File]+ , commitModified :: [File]+ , commitRemoved :: [File] } +instance FromJSON Commit where+ parseJSON (Object o) =+ Commit <$>+ o .: "id" <*>+ o .: "message" <*>+ o .: "timestamp" <*>+ o .: "url" <*>+ o .: "author" <*>+ o .:? "added" .!= [] <*>+ o .:? "modified" .!= [] <*>+ o .:? "removed" .!= []+ parseJSON v = typeMismatch "Commit" v+ data MergeEndpoint = MergeEndpoint { mepName :: T.Text , mepSshUrl :: Url- , mepHttpurl :: Url+ , mepHttpUrl :: Url+ , mepWebUrl :: Url , mepVisibility :: Int , mepNamespace :: T.Text } +instance FromJSON MergeEndpoint where+ parseJSON (Object o) =+ MergeEndpoint <$>+ o .: "name" <*>+ o .: "ssh_url" <*>+ o .: "http_url" <*>+ o .: "web_url" <*>+ o .: "visibility_level" <*>+ o .: "namespace"+ parseJSON v = typeMismatch "MergeEndpoint" v+ data Repository = Repository { repoName :: T.Text , repoUrl :: Url , repoDesc :: T.Text , repoHomepage :: Url- , repoGitHttpUrl :: Url- , repoGitSshUrl :: Url- , repoVisibility :: Int+ , repoGitHttpUrl :: Maybe Url+ , repoGitSshUrl :: Maybe Url+ , repoVisibility :: Maybe Int } +instance FromJSON Repository where+ parseJSON (Object o) =+ Repository <$>+ o .: "name" <*>+ o .: "url" <*>+ o .: "description" <*>+ o .: "homepage" <*>+ o .:? "git_http_url" <*>+ o .:? "git_ssh_url" <*>+ o .:? "visibility_level"+ parseJSON v = typeMismatch "Repository" v+ data Issue = Issue { issueInternalId :: Int , issueTitle :: T.Text@@ -98,6 +169,25 @@ , issueUrl :: Url } +instance FromJSON Issue where+ parseJSON (Object o) =+ Issue <$>+ o .: "id" <*>+ o .: "title" <*>+ o .: "assignee_id" <*>+ o .: "author_id" <*>+ o .: "project_id" <*>+ o .: "created_at" <*>+ o .: "updated_at" <*>+ o .: "position" <*>+ o .: "branch_name" <*>+ o .: "description" <*>+ o .: "milestone_id" <*>+ o .: "state" <*>+ o .: "iid" <*>+ o .:? "url" .!= T.empty+ parseJSON v = typeMismatch "Issue" v+ data MergeRequest = MergeRequest { mrInternalId :: Int , mrTargetBranch :: T.Text@@ -119,9 +209,97 @@ , mrSource :: MergeEndpoint , mrTarget :: MergeEndpoint , mrLastCommit :: Commit+ , mrWorkInProgress :: Bool , mrUrl :: Url } +instance FromJSON MergeRequest where+ parseJSON (Object o) =+ MergeRequest <$>+ o .: "id" <*>+ o .: "target_branch" <*>+ o .: "source_branch" <*>+ o .: "source_project_id" <*>+ o .: "author_id" <*>+ o .: "assignee_id" <*>+ o .: "title" <*>+ o .: "created_at" <*>+ o .: "updated_at" <*>+ --v .: "st_commits" <*>+ --v .: "st_diffs" <*>+ o .: "milestone_id" <*>+ o .: "state" <*>+ o .: "merge_status" <*>+ o .: "target_project_id" <*>+ o .: "iid" <*>+ o .: "description" <*>+ o .: "source" <*>+ o .: "target" <*>+ o .: "last_commit" <*>+ o .: "work_in_progress" <*>+ o .:? "url" .!= T.empty+ parseJSON v = typeMismatch "MergeRequest" v++data Diff = Diff+ { diffDiff :: T.Text+ , diffNewPath :: T.Text+ , diffOldPath :: T.Text+ , diffAMode :: T.Text+ , diffBMode :: T.Text+ , diffNewFile :: Bool+ , diffRenamedFile :: Bool+ , diffDeletedFile :: Bool+ }++instance FromJSON Diff where+ parseJSON (Object o) =+ Diff <$>+ o .: "diff" <*>+ o .: "new_path" <*>+ o .: "old_path" <*>+ o .: "a_mode" <*>+ o .: "b_mode" <*>+ o .: "new_file" <*>+ o .: "renamed_file" <*>+ o .: "deleted_file"+ parseJSON v = typeMismatch "Diff" v++data Note = Note+ { noteId :: Int+ , noteNote :: T.Text+ --, noteType :: NoteableType+ , noteAuthorId :: Int+ , noteCreatedAt :: T.Text+ , noteUpdatedAt :: T.Text+ , noteProjectId :: Int+ --, noteAttachment :: Maybe ()+ , noteLineCode :: Maybe T.Text+ , noteCommitId :: CommitID+ , noteNoteableId :: Maybe Int+ , noteSystem :: Bool+ , noteStDiff :: Maybe Diff+ , noteUrl :: Url+ }++instance FromJSON Note where+ parseJSON (Object o) =+ Note <$>+ o .: "id" <*>+ o .: "note" <*>+ --o .: "noteable_type" <*>+ o .: "author_id" <*>+ o .: "created_at" <*>+ o .: "updated_at" <*>+ o .: "project_id" <*>+ --o .: "attachment" <*>+ o .: "line_code" <*>+ o .: "commit_id" <*>+ o .: "noteable_id" <*>+ o .: "system" <*>+ o .: "st_diff" <*>+ o .: "url"+ parseJSON v = typeMismatch "Note" v+ data Push = Push { pushBefore :: CommitID , pushAfter :: CommitID@@ -135,116 +313,6 @@ , pushCommitsTotal :: Int } -data IssueEvent = IssueEvent- { ieUser :: User- , ieIssue :: Issue- , ieAction :: T.Text- }--data MergeRequestEvent = MergeRequestEvent- { mreUser :: User- , mreRequest :: MergeRequest- , mreAction :: T.Text- }--data Event- = EventPush Push- | EventPushTag Push- | EventIssue IssueEvent- | EventMergeRequest MergeRequestEvent--instance FromJSON Author where- parseJSON (Object v) =- Author <$>- v .: "name" <*>- v .: "email"- parseJSON _ = mzero--instance FromJSON User where- parseJSON (Object v) =- User <$>- v .: "name" <*>- v .: "username" <*>- v .: "avatar_url"- parseJSON _ = mzero--instance FromJSON Commit where- parseJSON (Object v) =- Commit <$>- v .: "id" <*>- v .: "message" <*>- v .: "timestamp" <*>- v .: "url" <*>- v .: "author"- parseJSON _ = mzero--instance FromJSON MergeEndpoint where- parseJSON (Object v) =- MergeEndpoint <$>- v .: "name" <*>- v .: "ssh_url" <*>- v .: "http_url" <*>- v .: "visibility_level" <*>- v .: "namespace"- parseJSON _ = mzero--instance FromJSON Repository where- parseJSON (Object v) =- Repository <$>- v .: "name" <*>- v .: "url" <*>- v .: "description" <*>- v .: "homepage" <*>- v .: "git_http_url" <*>- v .: "git_ssh_url" <*>- v .: "visibility_level"- parseJSON _ = mzero--instance FromJSON Issue where- parseJSON (Object v) =- Issue <$>- v .: "id" <*>- v .: "title" <*>- v .: "assignee_id" <*>- v .: "author_id" <*>- v .: "project_id" <*>- v .: "created_at" <*>- v .: "updated_at" <*>- v .: "position" <*>- v .: "branch_name" <*>- v .: "description" <*>- v .: "milestone_id" <*>- v .: "state" <*>- v .: "iid" <*>- v .: "url"- parseJSON _ = mzero--instance FromJSON MergeRequest where- parseJSON (Object v) =- MergeRequest <$>- v .: "id" <*>- v .: "target_branch" <*>- v .: "source_branch" <*>- v .: "source_project_id" <*>- v .: "author_id" <*>- v .: "assignee_id" <*>- v .: "title" <*>- v .: "created_at" <*>- v .: "updated_at" <*>- --v .: "st_commits" <*>- --v .: "st_diffs" <*>- v .: "milestone_id" <*>- v .: "state" <*>- v .: "merge_status" <*>- v .: "target_project_id" <*>- v .: "iid" <*>- v .: "description" <*>- v .: "source" <*>- v .: "target" <*>- v .: "last_commit" <*>- v .: "url"- parseJSON _ = mzero- instance FromJSON Push where parseJSON (Object v) = Push <$>@@ -260,39 +328,112 @@ v .: "total_commits_count" parseJSON _ = mzero -text :: Parser T.Text -> T.Text -> Parser T.Text-text parser expected = do- got <- parser- if got == expected- then return got- else mzero+data IssueEvent = IssueEvent+ { ieUser :: User+ , ieRepo :: Repository+ , ieIssue :: Issue+ , ieAction :: T.Text+ } instance FromJSON IssueEvent where parseJSON (Object o) = do user <- o .: "user"+ repo <- o .: "repository" attrs <- o .: "object_attributes"- mr <- o .: "object_attributes"+ issue <- o .: "object_attributes" action <- attrs .: "action"- return $ IssueEvent user mr action- parseJSON _ = mzero+ return $ IssueEvent user repo issue action+ parseJSON v = typeMismatch "IssueEvent" v +data MergeRequestEvent = MergeRequestEvent+ { mreUser :: User+ , mreRequest :: MergeRequest+ , mreAction :: T.Text+ }+ instance FromJSON MergeRequestEvent where parseJSON (Object o) = do user <- o .: "user" attrs <- o .: "object_attributes"- issue <- o .: "object_attributes"+ mr <- o .: "object_attributes" action <- attrs .: "action"- return $ MergeRequestEvent user issue action- parseJSON _ = mzero+ return $ MergeRequestEvent user mr action+ parseJSON v = typeMismatch "MergeRequestEvent" v +data Snippet = Snippet+ { snippetId :: Int+ , snippetTitle :: T.Text+ , snippetContent :: T.Text+ , snippetAuthorId :: Int+ , snippetProjectId :: Int+ , snippetCreatedAt :: T.Text+ , snippetUpdatedAt :: T.Text+ , snippetFileName :: T.Text+ , snippetExpiresAt :: Maybe T.Text+ , snippetType :: T.Text+ , snippetVisibility :: Int+ }++instance FromJSON Snippet where+ parseJSON (Object o) =+ Snippet <$>+ o .: "id" <*>+ o .: "title" <*>+ o .: "content" <*>+ o .: "author_id" <*>+ o .: "project_id" <*>+ o .: "created_at" <*>+ o .: "updated_at" <*>+ o .: "file_name" <*>+ o .: "expires_at" <*>+ o .: "type" <*>+ o .: "visibility_level"+ parseJSON v = typeMismatch "Snippet" v++data NoteTarget+ = NTCommit Commit+ | NTIssue Issue+ | NTMergeRequest MergeRequest+ | NTSnippet Snippet++data NoteEvent = NoteEvent+ { neUser :: User+ , neProjectId :: Int+ , neRepo :: Repository+ , neNote :: Note+ , neTarget :: NoteTarget+ }++instance FromJSON NoteEvent where+ parseJSON (Object o) =+ NoteEvent <$>+ o .: "user" <*>+ o .: "project_id" <*>+ o .: "repository" <*>+ o .: "object_attributes" <*>+ ( NTCommit <$> o .: "commit" <|>+ NTMergeRequest <$> o .: "merge_request" <|>+ NTIssue <$> o .: "issue" <|>+ NTSnippet <$> o .: "snippet"+ )+ parseJSON v = typeMismatch "NoteEvent" v++data Event+ = EventPush Push+ | EventPushTag Push+ | EventIssue IssueEvent+ | EventMergeRequest MergeRequestEvent+ | EventNote NoteEvent+ instance FromJSON Event where parseJSON v@(Object o) = let kind = text $ o .: "object_kind" in kind "push" *> (EventPush <$> parseJSON v) <|> kind "tag_push" *> (EventPushTag <$> parseJSON v) <|> kind "issue" *> (EventIssue <$> parseJSON v) <|>- kind "merge_request" *> (EventMergeRequest <$> parseJSON v)- parseJSON _ = mzero+ kind "merge_request" *> (EventMergeRequest <$> parseJSON v) <|>+ kind "note" *> (EventNote <$> parseJSON v)+ parseJSON v = typeMismatch "Event" v -- | Parse a JSON string (the body of the HTTP request) into event information. -- If parsing fails, return 'Left' an error message.
vcs-web-hook-parse.cabal view
@@ -1,5 +1,5 @@ name: vcs-web-hook-parse-version: 0.1.0.0+version: 0.2.0.0 synopsis: Parse development platform web hook messages. description: A development platform is a server system which hosts (mostly software)@@ -39,7 +39,7 @@ source-repository head type: darcs- location: http://dev.rel4tion.org/fr33domlover/vcs-web-hook-parse+ location: http://hub.darcs.net/fr33domlover/vcs-web-hook-parse library exposed-modules: Web.Hook.GitLab