packages feed

github 0.27 → 0.28

raw patch · 26 files changed

+425/−207 lines, 26 filesdep ~aesondep ~basedep ~hspecnew-uploaderPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, base, hspec, text

API changes (from Hackage documentation)

- GitHub.Data.Search: data SearchResult entity
- GitHub.Data.Search: instance Control.DeepSeq.NFData entity => Control.DeepSeq.NFData (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance Data.Aeson.Types.FromJSON.FromJSON entity => Data.Aeson.Types.FromJSON.FromJSON (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance Data.Binary.Class.Binary entity => Data.Binary.Class.Binary (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance Data.Data.Data entity => Data.Data.Data (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance GHC.Classes.Eq entity => GHC.Classes.Eq (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance GHC.Classes.Ord entity => GHC.Classes.Ord (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance GHC.Generics.Generic (GitHub.Data.Search.SearchResult entity)
- GitHub.Data.Search: instance GHC.Show.Show entity => GHC.Show.Show (GitHub.Data.Search.SearchResult entity)
+ GitHub: unwatchRepoR :: Name Owner -> Name Repo -> Request 'RW ()
+ GitHub.Data.Options: optionsAssignee :: Name User -> IssueRepoMod
+ GitHub.Data.Options: optionsCreator :: Name User -> IssueRepoMod
+ GitHub.Data.Options: optionsMentioned :: Name User -> IssueRepoMod
+ GitHub.Data.Options: optionsMilestone :: Id Milestone -> IssueRepoMod
+ GitHub.Data.Repos: CodeSearchRepo :: !Id Repo -> !Name Repo -> !SimpleOwner -> !Bool -> !URL -> !Maybe Text -> !Maybe Bool -> !URL -> !Maybe URL -> !Maybe URL -> !Maybe URL -> !URL -> !Maybe URL -> !Maybe Text -> !Maybe Language -> !Maybe Int -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Bool -> !Bool -> !Maybe UTCTime -> !Maybe UTCTime -> !Maybe UTCTime -> !Maybe RepoPermissions -> CodeSearchRepo
+ GitHub.Data.Repos: RepoPermissions :: !Bool -> !Bool -> !Bool -> RepoPermissions
+ GitHub.Data.Repos: [codeSearchRepoArchived] :: CodeSearchRepo -> !Bool
+ GitHub.Data.Repos: [codeSearchRepoCloneUrl] :: CodeSearchRepo -> !Maybe URL
+ GitHub.Data.Repos: [codeSearchRepoCreatedAt] :: CodeSearchRepo -> !Maybe UTCTime
+ GitHub.Data.Repos: [codeSearchRepoDefaultBranch] :: CodeSearchRepo -> !Maybe Text
+ GitHub.Data.Repos: [codeSearchRepoDescription] :: CodeSearchRepo -> !Maybe Text
+ GitHub.Data.Repos: [codeSearchRepoDisabled] :: CodeSearchRepo -> !Bool
+ GitHub.Data.Repos: [codeSearchRepoFork] :: CodeSearchRepo -> !Maybe Bool
+ GitHub.Data.Repos: [codeSearchRepoGitUrl] :: CodeSearchRepo -> !Maybe URL
+ GitHub.Data.Repos: [codeSearchRepoHasDownloads] :: CodeSearchRepo -> !Maybe Bool
+ GitHub.Data.Repos: [codeSearchRepoHasIssues] :: CodeSearchRepo -> !Maybe Bool
+ GitHub.Data.Repos: [codeSearchRepoHasPages] :: CodeSearchRepo -> !Maybe Bool
+ GitHub.Data.Repos: [codeSearchRepoHasProjects] :: CodeSearchRepo -> !Maybe Bool
+ GitHub.Data.Repos: [codeSearchRepoHasWiki] :: CodeSearchRepo -> !Maybe Bool
+ GitHub.Data.Repos: [codeSearchRepoHomepage] :: CodeSearchRepo -> !Maybe Text
+ GitHub.Data.Repos: [codeSearchRepoHooksUrl] :: CodeSearchRepo -> !URL
+ GitHub.Data.Repos: [codeSearchRepoHtmlUrl] :: CodeSearchRepo -> !URL
+ GitHub.Data.Repos: [codeSearchRepoId] :: CodeSearchRepo -> !Id Repo
+ GitHub.Data.Repos: [codeSearchRepoLanguage] :: CodeSearchRepo -> !Maybe Language
+ GitHub.Data.Repos: [codeSearchRepoName] :: CodeSearchRepo -> !Name Repo
+ GitHub.Data.Repos: [codeSearchRepoOwner] :: CodeSearchRepo -> !SimpleOwner
+ GitHub.Data.Repos: [codeSearchRepoPermissions] :: CodeSearchRepo -> !Maybe RepoPermissions
+ GitHub.Data.Repos: [codeSearchRepoPrivate] :: CodeSearchRepo -> !Bool
+ GitHub.Data.Repos: [codeSearchRepoPushedAt] :: CodeSearchRepo -> !Maybe UTCTime
+ GitHub.Data.Repos: [codeSearchRepoSize] :: CodeSearchRepo -> !Maybe Int
+ GitHub.Data.Repos: [codeSearchRepoSshUrl] :: CodeSearchRepo -> !Maybe URL
+ GitHub.Data.Repos: [codeSearchRepoSvnUrl] :: CodeSearchRepo -> !Maybe URL
+ GitHub.Data.Repos: [codeSearchRepoUpdatedAt] :: CodeSearchRepo -> !Maybe UTCTime
+ GitHub.Data.Repos: [codeSearchRepoUrl] :: CodeSearchRepo -> !URL
+ GitHub.Data.Repos: [repoPermissionAdmin] :: RepoPermissions -> !Bool
+ GitHub.Data.Repos: [repoPermissionPull] :: RepoPermissions -> !Bool
+ GitHub.Data.Repos: [repoPermissionPush] :: RepoPermissions -> !Bool
+ GitHub.Data.Repos: [repoPermissions] :: Repo -> !Maybe RepoPermissions
+ GitHub.Data.Repos: data CodeSearchRepo
+ GitHub.Data.Repos: data RepoPermissions
+ GitHub.Data.Repos: instance Control.DeepSeq.NFData GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance Control.DeepSeq.NFData GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance Data.Aeson.Types.FromJSON.FromJSON GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance Data.Aeson.Types.FromJSON.FromJSON GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance Data.Binary.Class.Binary GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance Data.Binary.Class.Binary GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance Data.Data.Data GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance Data.Data.Data GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance GHC.Classes.Eq GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance GHC.Classes.Eq GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance GHC.Classes.Ord GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance GHC.Classes.Ord GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance GHC.Generics.Generic GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance GHC.Generics.Generic GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Repos: instance GHC.Show.Show GitHub.Data.Repos.CodeSearchRepo
+ GitHub.Data.Repos: instance GHC.Show.Show GitHub.Data.Repos.RepoPermissions
+ GitHub.Data.Search: data SearchResult' entities
+ GitHub.Data.Search: instance (GHC.Base.Monoid entities, Data.Aeson.Types.FromJSON.FromJSON entities) => Data.Aeson.Types.FromJSON.FromJSON (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance Control.DeepSeq.NFData entities => Control.DeepSeq.NFData (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance Data.Binary.Class.Binary entities => Data.Binary.Class.Binary (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance Data.Data.Data entities => Data.Data.Data (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance Data.Foldable.Foldable GitHub.Data.Search.SearchResult'
+ GitHub.Data.Search: instance GHC.Base.Semigroup res => GHC.Base.Semigroup (GitHub.Data.Search.SearchResult' res)
+ GitHub.Data.Search: instance GHC.Classes.Eq entities => GHC.Classes.Eq (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance GHC.Classes.Ord entities => GHC.Classes.Ord (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance GHC.Generics.Generic (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: instance GHC.Show.Show entities => GHC.Show.Show (GitHub.Data.Search.SearchResult' entities)
+ GitHub.Data.Search: type SearchResult entity = SearchResult' (Vector entity)
+ GitHub.Endpoints.Activity.Watching: unwatchRepoR :: Name Owner -> Name Repo -> Request 'RW ()
- GitHub: searchCodeR :: Text -> Request k (SearchResult Code)
+ GitHub: searchCodeR :: Text -> FetchCount -> Request k (SearchResult Code)
- GitHub: searchIssuesR :: Text -> Request k (SearchResult Issue)
+ GitHub: searchIssuesR :: Text -> FetchCount -> Request k (SearchResult Issue)
- GitHub: searchReposR :: Text -> Request k (SearchResult Repo)
+ GitHub: searchReposR :: Text -> FetchCount -> Request k (SearchResult Repo)
- GitHub: searchUsersR :: Text -> Request k (SearchResult SimpleUser)
+ GitHub: searchUsersR :: Text -> FetchCount -> Request k (SearchResult SimpleUser)
- GitHub.Data.Repos: Repo :: !Id Repo -> !Name Repo -> !SimpleOwner -> !Bool -> !URL -> !Maybe Text -> !Maybe Bool -> !URL -> !Maybe URL -> !Maybe URL -> !Maybe URL -> !URL -> !Maybe URL -> !Maybe Text -> !Maybe Language -> !Int -> !Int -> !Int -> !Maybe Int -> !Maybe Text -> !Int -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Bool -> !Bool -> !Maybe UTCTime -> !Maybe UTCTime -> !Maybe UTCTime -> Repo
+ GitHub.Data.Repos: Repo :: !Id Repo -> !Name Repo -> !SimpleOwner -> !Bool -> !URL -> !Maybe Text -> !Maybe Bool -> !URL -> !Maybe URL -> !Maybe URL -> !Maybe URL -> !URL -> !Maybe URL -> !Maybe Text -> !Maybe Language -> !Int -> !Int -> !Int -> !Maybe Int -> !Maybe Text -> !Int -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Bool -> !Bool -> !Maybe UTCTime -> !Maybe UTCTime -> !Maybe UTCTime -> !Maybe RepoPermissions -> Repo
- GitHub.Data.Search: Code :: !Text -> !Text -> !Text -> !URL -> !URL -> !URL -> !Repo -> Code
+ GitHub.Data.Search: Code :: !Text -> !Text -> !Text -> !URL -> !URL -> !URL -> !CodeSearchRepo -> Code
- GitHub.Data.Search: SearchResult :: !Int -> !Vector entity -> SearchResult entity
+ GitHub.Data.Search: SearchResult :: !Int -> !entities -> SearchResult' entities
- GitHub.Data.Search: [codeRepo] :: Code -> !Repo
+ GitHub.Data.Search: [codeRepo] :: Code -> !CodeSearchRepo
- GitHub.Data.Search: [searchResultResults] :: SearchResult entity -> !Vector entity
+ GitHub.Data.Search: [searchResultResults] :: SearchResult' entities -> !entities
- GitHub.Data.Search: [searchResultTotalCount] :: SearchResult entity -> !Int
+ GitHub.Data.Search: [searchResultTotalCount] :: SearchResult' entities -> !Int
- GitHub.Endpoints.Search: searchCodeR :: Text -> Request k (SearchResult Code)
+ GitHub.Endpoints.Search: searchCodeR :: Text -> FetchCount -> Request k (SearchResult Code)
- GitHub.Endpoints.Search: searchIssuesR :: Text -> Request k (SearchResult Issue)
+ GitHub.Endpoints.Search: searchIssuesR :: Text -> FetchCount -> Request k (SearchResult Issue)
- GitHub.Endpoints.Search: searchReposR :: Text -> Request k (SearchResult Repo)
+ GitHub.Endpoints.Search: searchReposR :: Text -> FetchCount -> Request k (SearchResult Repo)
- GitHub.Endpoints.Search: searchUsersR :: Text -> Request k (SearchResult SimpleUser)
+ GitHub.Endpoints.Search: searchUsersR :: Text -> FetchCount -> Request k (SearchResult SimpleUser)
- GitHub.Internal.Prelude: class Hashable a
+ GitHub.Internal.Prelude: class Eq a => Hashable a

Files

CHANGELOG.md view
@@ -1,177 +1,226 @@+## Changes for 0.28++_2022-04-30, Andreas Abel, Valborg edition_++Tested with GHC 7.8 - 9.2.2++- Add constructors to `IssueRepoMod` that allow filtering issues by+  milestone, assignee, creator, mentioned user:+  `GitHub.Data.Options.options{Milestone,Assignee,Creator,Mentioned}`+  (PR [#470](https://github.com/haskell-github/github/pull/470))++- Add permissions field to `Repo`.+  This adds record `RepoPermissions` and field `Repo.repoPermissions`+  in module `GitHub.Data.Repos`.+  (PR [#476](https://github.com/haskell-github/github/pull/476))++- Add unwatch request `GitHub.Endpoints.Activity.Watching.unwatchRepoR`+  (PR [#473](https://github.com/haskell-github/github/pull/473))++Breaking change:++- Make searches paginated+  (PR [#474](https://github.com/haskell-github/github/pull/474)):+  * Adds record `GitHub.Data.Repos.CodeSearchRepo`.+  * Adds argument `FetchCount`+    to `GitHub.Endpoints.Search.search{Repos,Code,Issues,Users}R`.+ ## Changes for 0.27 -- Add vector of SimpleTeam in "requested_teams" field of PullRequest-  [#453](https://github.com/phadej/github/pull/453)+_2021-10-10, Oleg Grenrus_++- Add vector of `SimpleTeam` in "requested_teams" field of `PullRequest`+  [#453](https://github.com/haskell-github/github/pull/453) - Add endpoint to create gist-  [#455](https://github.com/phadej/github/pull/455)-- Update RepoWebhookEvent-  [#461](https://github.com/phadej/github/pull/461)-- PullRequest Reviews may not have submitted_at field -  [#450](https://github.com/phadej/github/pull/450)+  [#455](https://github.com/haskell-github/github/pull/455)+- Update `RepoWebhookEvent`+  [#461](https://github.com/haskell-github/github/pull/461)+- `PullRequest` Reviews may not have submitted_at field+  [#450](https://github.com/haskell-github/github/pull/450)  ## Changes for 0.26 -- Generalize PagedQuery to allow its reuse by preview github APIs-  [#439](https://github.com/phadej/github/pull/439)+_2020-05-26, Oleg Grenrus_++- Generalize `PagedQuery` to allow its reuse by preview github APIs+  [#439](https://github.com/haskell-github/github/pull/439) - Add endpoint for listing organizations outside collaborators-  [#445](https://github.com/phadej/github/pull/445)+  [#445](https://github.com/haskell-github/github/pull/445) - Add endpoint for users search-  [#444](https://github.com/phadej/github/pull/444)-- Make repoWebhookResponseStatus optional-  [#436](https://github.com/phadej/github/pull/436)+  [#444](https://github.com/haskell-github/github/pull/444)+- Make `repoWebhookResponseStatus` optional+  [#436](https://github.com/haskell-github/github/pull/436) - Teams improvements-  [#417](https://github.com/phadej/github/pull/417)-- Add deleteReference endpoint-  [#388](https://github.com/phadej/github/pull/388)-	+  [#417](https://github.com/haskell-github/github/pull/417)+- Add `deleteReference` endpoint+  [#388](https://github.com/haskell-github/github/pull/388)+ ## Changes for 0.25 +_2020-02-18, Oleg Grenrus_+ - Add `executeRequestWithMgrAndRes`-  [#421](https://github.com/phadej/github/pull/421)+  [#421](https://github.com/haskell-github/github/pull/421) - Add `limitsFromHttpResponse`-  [#421](https://github.com/phadej/github/pull/421)+  [#421](https://github.com/haskell-github/github/pull/421) - Add label descriptions-  [#418](https://github.com/phadej/github/pull/418)+  [#418](https://github.com/haskell-github/github/pull/418) - Add "draft" option to mergeable state-  [#431](https://github.com/phadej/github/pull/431)-- Use IssueNumber in editIssueR and issueR-  [#429](https://github.com/phadej/github/pull/429)+  [#431](https://github.com/haskell-github/github/pull/431)+- Use `IssueNumber` in `editIssueR` and `issueR`+  [#429](https://github.com/haskell-github/github/pull/429) - Manage orgs in GitHub Enterprise-  [#420](https://github.com/phadej/github/pull/420)+  [#420](https://github.com/haskell-github/github/pull/420) - Add support for collaborator permission endpoint-  [#425](https://github.com/phadej/github/pull/425)+  [#425](https://github.com/haskell-github/github/pull/425) - Add support for the comment reply endpoint-  [#424](https://github.com/phadej/github/pull/424)+  [#424](https://github.com/haskell-github/github/pull/424) - Organise exports in `GitHub`-  [#430](https://github.com/phadej/github/pull/430)+  [#430](https://github.com/haskell-github/github/pull/430)  ## Changes for 0.24 +_2019-11-27, Oleg Grenrus_+ **Major change**: Introduce `github` n-ary combinator to hoist `... -> Request rw res` into `... -> IO (Either Error res)` (i.e. n-ary `executeRequest`). With that in place drop `.. -> IO (Either Error res)` functions.  This reduces symbol bloat in the library.-[#415](https://github.com/phadej/github/pull/415)+[#415](https://github.com/haskell-github/github/pull/415)  - Remove double `withOpenSSL`-  [#414](https://github.com/phadej/github/pull/414)+  [#414](https://github.com/haskell-github/github/pull/414) - Pull requests reviews API uses issue number-  [#409](https://github.com/phadej/github/pull/409)+  [#409](https://github.com/haskell-github/github/pull/409) - Update `Repo`, `NewRepo` and `EditRepo` data types-  [#407](https://github.com/phadej/github/pull/407)+  [#407](https://github.com/haskell-github/github/pull/407)  ## Changes for 0.23 +_2019-10-01, Oleg Grenrus_+ - Escape URI paths-  [#404](https://github.com/phadej/github/pull/404)-- Add OwnerBot to OwnerType-  [#399](https://github.com/phadej/github/pull/399)-- Make File.fileSha optional-  [#392](https://github.com/phadej/github/pull/392)+  [#404](https://github.com/haskell-github/github/pull/404)+- Add `OwnerBot` to `OwnerType`+  [#399](https://github.com/haskell-github/github/pull/399)+- Make `File.fileSha` optional+  [#392](https://github.com/haskell-github/github/pull/392) - Update User-Agent to contain up to date version-  [#403](https://github.com/phadej/github/pull/403)-  [#394](https://github.com/phadej/github/pull/394)+  [#403](https://github.com/haskell-github/github/pull/403)+  [#394](https://github.com/haskell-github/github/pull/394)  ## Changes for 0.22 +_2019-05-31, Oleg Grenrus_+ - Type-class for various auth methods-  [#365](https://github.com/phadej/github/pull/365)+  [#365](https://github.com/haskell-github/github/pull/365) - Throw on non-200 responses-  [#350](https://github.com/phadej/github/pull/350)+  [#350](https://github.com/haskell-github/github/pull/350) - Add extension point for (preview) media types-  [#370](https://github.com/phadej/github/pull/370)+  [#370](https://github.com/haskell-github/github/pull/370) - Add missing webhook event types-  [#359](https://github.com/phadej/github/pull/359)+  [#359](https://github.com/haskell-github/github/pull/359) - Add invitation endpoint-  [#360](https://github.com/phadej/github/pull/360)+  [#360](https://github.com/haskell-github/github/pull/360) - Add notifications endpoints-  [#324](https://github.com/phadej/github/pull/324)+  [#324](https://github.com/haskell-github/github/pull/324) - Add ssh keys endpoints-  [#363](https://github.com/phadej/github/pull/365)+  [#363](https://github.com/haskell-github/github/pull/365) - Case insensitive enum parsing-  [#373](https://github.com/phadej/github/pull/373)+  [#373](https://github.com/haskell-github/github/pull/373) - Don't try parse unitary responses-  [#377](https://github.com/phadej/github/issues/377)+  [#377](https://github.com/haskell-github/github/issues/377) - Update dependencies-  [#364](https://github.com/phadej/github/pull/364)-  [#368](https://github.com/phadej/github/pull/368)-  [#369](https://github.com/phadej/github/pull/369)+  [#364](https://github.com/haskell-github/github/pull/364)+  [#368](https://github.com/haskell-github/github/pull/368)+  [#369](https://github.com/haskell-github/github/pull/369) - Documentation improvements-  [#357](https://github.com/phadej/github/pull/357)+  [#357](https://github.com/haskell-github/github/pull/357)  ## Changes for 0.21 +_2019-02-18, Oleg Grenrus_+ - Refactor `Request` type.-  [#349](https://github.com/phadej/github/pull/349)+  [#349](https://github.com/haskell-github/github/pull/349) - Allow `http-client-0.6`-  [#344](https://github.com/phadej/github/pull/344)+  [#344](https://github.com/haskell-github/github/pull/344) - Change to use `cryptohash-sha1` (`cryptohash` was used before)-- Add Create milestone endponts-  [#337](https://github.com/phadej/github/pull/337)-- Make fileBlobUrl and fileRawUrl are optional-  [#339](https://github.com/phadej/github/issues/339)-  [#340](https://github.com/phadej/github/pull/340)-- Add organizationsR to request user organizations-  [#345](https://github.com/phadej/github/pull/345)-- Add updateMilestoneR, deleteMilestoneR-  [#338](https://github.com/phadej/github/pull/338)-- Allow multiple assignees in NewIssue and EditIssue-  [#336](https://github.com/phadej/github/pull/336)+- Add Create milestone endpoints+  [#337](https://github.com/haskell-github/github/pull/337)+- Make `fileBlobUrl` and `fileRawUrl` optional+  [#339](https://github.com/haskell-github/github/issues/339)+  [#340](https://github.com/haskell-github/github/pull/340)+- Add `organizationsR` to request user organizations+  [#345](https://github.com/haskell-github/github/pull/345)+- Add `updateMilestoneR`, `deleteMilestoneR`+  [#338](https://github.com/haskell-github/github/pull/338)+- Allow multiple assignees in `NewIssue` and `EditIssue`+  [#336](https://github.com/haskell-github/github/pull/336) - Add `pullRequestPatchR` and `pullRequestDiffR`-  [#325](https://github.com/phadej/github/pull/325)+  [#325](https://github.com/haskell-github/github/pull/325)  ## Changes for 0.20 +_2018-09-26, Oleg Grenrus_+ - Add ratelimit endpoint-  [#315](https://github.com/phadej/github/pull/315)+  [#315](https://github.com/haskell-github/github/pull/315) - Add some deployment endoints-  [#330](https://github.com/phadej/github/pull/330)+  [#330](https://github.com/haskell-github/github/pull/330) - Add webhook installation events-  [#329](https://github.com/phadej/github/pull/330)-- Tigthen lower bounds (also remove aeson-compat dep)-  [#332](https://github.com/phadej/github/pull/332)+  [#329](https://github.com/haskell-github/github/pull/330)+- Tighten lower bounds (also remove `aeson-compat` dep)+  [#332](https://github.com/haskell-github/github/pull/332)  ## Changes for 0.19 +_2018-02-19, Oleg Grenrus_+ - Fix issue event type enumeration-  [#301](https://github.com/phadej/github/issues/301)-- Include label info in `IssseEvent`-  [#302](https://github.com/phadej/github/issues/302)+  [#301](https://github.com/haskell-github/github/issues/301)+- Include label info in `IssueEvent`+  [#302](https://github.com/haskell-github/github/issues/302) - Fix `ShowRepo` example-  [#306](https://github.com/phadej/github/pull/306)+  [#306](https://github.com/haskell-github/github/pull/306) - Add "Get archive link" API-  [#307](https://github.com/phadej/github/pull/307)-- Make "repo" in PullRequestCommit nullable (repository can be gone)-  [#311](https://github.com/phadej/github/pull/311)-- Add 	read-only emails endpoint-  [#313](https://github.com/phadej/github/pull/313)+  [#307](https://github.com/haskell-github/github/pull/307)+- Make "repo" in `PullRequestCommit` nullable (repository can be gone)+  [#311](https://github.com/haskell-github/github/pull/311)+- Add read-only emails endpoint+  [#313](https://github.com/haskell-github/github/pull/313) - Organisation membership API-  [#312](https://github.com/phadej/github/pull/312)-- Fix isPullRequestMerged and other boolean responses-  [#312](https://github.com/phadej/github/pull/312)+  [#312](https://github.com/haskell-github/github/pull/312)+- Fix `isPullRequestMerged` and other boolean responses+  [#312](https://github.com/haskell-github/github/pull/312) - Add `behind` pull request mergeable state-  [#308](https://github.com/phadej/github/pull/308)+  [#308](https://github.com/haskell-github/github/pull/308) - Add list organisation invitations endpoint  ## Changes for 0.18 +_2017-11-10, Oleg Grenrus_+ - Endpoints for deleting issue comments.-  [#294](https://github.com/phadej/github/pull/294)+  [#294](https://github.com/haskell-github/github/pull/294) - Endpoints for (un)starring gists.-  [#296](https://github.com/phadej/github/pull/296)+  [#296](https://github.com/haskell-github/github/pull/296) - Add `archived` field to `Repo`.-  [#298](https://github.com/phadej/github/pull/298)+  [#298](https://github.com/haskell-github/github/pull/298) - Update dependencies.-  [#295](https://github.com/phadej/github/pull/295)+  [#295](https://github.com/haskell-github/github/pull/295) - Add Statuses endpoints.-  [#268](https://github.com/phadej/github/pull/268)+  [#268](https://github.com/haskell-github/github/pull/268) - Add requested reviewers field to pull request records.-  [#292](https://github.com/phadej/github/pull/292)+  [#292](https://github.com/haskell-github/github/pull/292)  ## Changes for 0.17.0 +_2017-09-26, Oleg Grenrus_+ - Add `Ord Request` instance - Repository contents - Repository starring endpoints@@ -179,15 +228,19 @@  ## Changes for 0.16.0 +_2017-07-24, Oleg Grenrus_+ - Add support for `mergeable_state = "blocked".` - Fix HTTP status code of merge PR - Supports newest versions of dependencies - user events - release endpoints-- forkExistingRepo+- `forkExistingRepo`  ## Changes for 0.15.0 +_2016-11-04, Oleg Grenrus_+ - Reworked `PullRequest` (notably `pullRequestsFor`) - Reworked PR and Issue filtering - GHC-8.0.1 support@@ -197,19 +250,21 @@ - Add `HeaderQuery` to `Request` - Add `Hashable Auth` instance - Add `mkUserId`, `mkUserName`, `fromUserId`, `fromOrganizationId`-- Add 'userIssuesR'-- Add 'organizationIssuesR'+- Add `userIssuesR`+- Add `organizationIssuesR` - Make `teamName :: Text` amnd `teamSlug :: Name Team` in both: `Team` and `SimpleTeam`-- Refactor 'Request' structure+- Refactor `Request` structure - Added multiple issue assignees - Preliminary support for repository events: `repositoryEventsR` - Support for adding repository permissions to the team-- Remove 'simpleUserType', it was always the same.+- Remove `simpleUserType`, it was always the same. -See [git commit summary](https://github.com/phadej/github/compare/v0.14.1...v0.15.0)+See [git commit summary](https://github.com/haskell-github/github/compare/v0.14.1...v0.15.0)  ## Changes for 0.14.1 +_2016-02-02, Oleg Grenrus_+ - Add `membersOfWithR`, `listTeamMembersR` - Add related enums: `OrgMemberFilter`, `OrgMemberRole`, `TeamMemberRole` - Add `Enum` and `Bounded` instances to `Privacy`, `Permission`,@@ -218,6 +273,8 @@  ## Changes for 0.14.0 +_2016-01-25, Oleg Grenrus_+ Large API changes:  - Use `Text` and `Vector` in place of `String` and `[]`.@@ -227,28 +284,56 @@ - Add `Binary` instances for all data - `GithubOwner` is a `newtype` of `Either User Organization`. There's still `SimpleOwner`. +## Releases without changelog++| Version | Date  | Uploader  |+|---|---|---|+| __0.13.2__ | _2015-04-26_ | _John Wiegley_        |+| __0.13.1__ | _2014-12-01_ | _César López-Natarén_ |+| __0.13__   | _2014-11-09_ | _César López-Natarén_ |+| __0.12__   | _2014-11-09_ | _César López-Natarén_ |+| __0.11.1__ | _2014-09-07_ | _César López-Natarén_ |+| __0.11.0__ | _2014-08-25_ | _César López-Natarén_ |+| __0.10.0__ | _2014-08-18_ | _César López-Natarén_ |+| __0.9__    | _2014-07-31_ | _John Wiegley_        |+| __0.8__    | _2014-05-02_ | _John Wiegley_        |+| __0.7.4__  | _2014-01-22_ | _John Wiegley_        |+| __0.7.3__  | _2013-12-21_ | _John Wiegley_        |+| __0.7.2__  | _2013-12-02_ | _John Wiegley_        |+| __0.7.1__  | _2013-08-08_ | _John Wiegley_        |+| __0.7.0__  | _2013-04-26_ | _John Wiegley_        |+| __0.6.0__  | _2013-04-12_ | _John Wiegley_        |+ ## Changes for 0.5.0: -* OAuth.+_2013-02-05, Mike Burns_++* `OAuth`. * New function: `Github.Repos.organizationRepo`, to get the repo for a specific organization. * Introduce a new `newRepoAutoInit` flag to `NewRepo`, for whether to initialize a repo while creating it.-* Relax the attoparsec version requirements.+* Relax the `attoparsec` version requirements. * The above by [John Wiegley](https://github.com/jwiegley).  ## Changes for 0.4.1: -* Stop using the uri package.-* Use aeson version 0.6.1.0.-* Use attoparsec version 0.10.3.0.-* Use http-conduit over 1.8.-* Use unordered-containers between 0.2 and 0.3.+_2013-01-14, Mike Burns_ +* Stop using the `uri` package.+* Use `aeson` version 0.6.1.0.+* Use `attoparsec` version 0.10.3.0.+* Use `http-conduit` over 1.8.+* Use `unordered-containers` between 0.2 and 0.3.+ ## Changes for 0.4.0: -* Use http-conduit version 1.4.1.10.+_2012-06-26, Mike Burns_ +* Use `http-conduit` version 1.4.1.10.+ ## Changes for 0.3.0: +_2012-06-10, Mike Burns_+ * Re-instantiate the Blobs API. * `repoDescription1` and `repoPushedAt` are a `Maybe GithubDate`. * Add `deleteRepo`, `editRepo`, and `createRepo`.@@ -259,13 +344,17 @@  ## Changes for 0.2.1: -* Expand the unordered-containers dependency to anything in 0.1.x .+_2012-02-16, Mike Burns_ +* Expand the `unordered-containers` dependency to anything in 0.1.x .+ ## Changes for 0.2.0: +_2012-02-15, Mike Burns_+ * `milestoneDueOn` and `repoLanguage` are now `Maybe` types.-* Introduce `GithubOwner` as the sum type for a `GithubUser` or `GithubOrganization`. Everything that once produced a `GithubUser` now produces a `GithubOwner`. All record accessors have changed their names-* Similar to `GithubOwner`, introduce `DetailedOwner`, which can be a `DetailedUser` or a `DetailedOrganization`. All record accessors have changed their names+* Introduce `GithubOwner` as the sum type for a `GithubUser` or `GithubOrganization`. Everything that once produced a `GithubUser` now produces a `GithubOwner`. All record accessors have changed their names.+* Similar to `GithubOwner`, introduce `DetailedOwner`, which can be a `DetailedUser` or a `DetailedOrganization`. All record accessors have changed their names. * An `HTTPConnectionError` now composes `SomeException` instead of `IOException`. All exceptions raised by the underlying http-conduit library are encapulated there. * The `githubIssueClosedBy` function now produces a `Maybe GithubOwner`. * Remove the Blobs API, as it is broken upstream.
README.md view
@@ -1,13 +1,13 @@-Github+GitHub ------ -[![Build Status](https://travis-ci.org/phadej/github.svg?branch=master)](https://travis-ci.org/phadej/github)+[![Haskell-CI](https://github.com/haskell-github/github/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/haskell-github/github/actions/workflows/haskell-ci.yml) [![Hackage](https://img.shields.io/hackage/v/github.svg)][hackage] -The Github API v3 for Haskell.+The GitHub API v3 for Haskell. -Some functions are missing; these are functions where the Github API did-not work as expected. The full Github API is in beta and constantly+Some functions are missing; these are functions where the GitHub API did+not work as expected. The full GitHub API is in beta and constantly improving.  Installation@@ -16,21 +16,20 @@ In your project's cabal file:  ```cabal--- Packages needed in order to build this package. Build-depends:       github ```  Or from the command line:  ```sh-cabal install github+cabal v1-install github ```  Example Usage =============  See the samples in the-[samples/](https://github.com/fpco/github/tree/master/samples) directory.+[samples/](https://github.com/haskell-github/github/tree/master/samples) directory.  Note: some samples might be outdated. @@ -40,7 +39,7 @@ For details see the reference [documentation on Hackage][hackage].  Each module lines up with the hierarchy of-[documentation from the Github API](http://developer.github.com/v3/).+[documentation from the GitHub API](https://docs.github.com/en/rest).  Request functions (ending with `R`) construct a data type which can be executed in `IO` by `executeRequest` functions. They are all listed in the root `GitHub`@@ -51,7 +50,7 @@ possible error message. Here's an example from the samples:  Many function have samples under-[`samples/`](https://github.com/phadej/github/tree/master/samples) directory.+[`samples/`](https://github.com/haskell-github/github/tree/master/samples) directory.  ```hs {-# LANGUAGE NoImplicitPrelude #-}@@ -77,21 +76,11 @@ formatUser = GitHub.untagName . GitHub.simpleUserLogin ``` -Test setup-==========--To run integration part of tests, you'll need [github access token](https://github.com/settings/tokens/new)-Token is needed, because unauthorised access is highly limited.-It's enough to add only basic read access for public information.--With `travis encrypt --org --repo yournick/github "GITHUB_TOKEN=yourtoken"` command you get a secret,-you can use in your travis setup to run the test-suite there.- Contributions =============  Please see-[CONTRIBUTING.md](https://github.com/fpco/github/blob/master/CONTRIBUTING.md)+[CONTRIBUTING.md](https://github.com/haskell-github/github/blob/master/CONTRIBUTING.md) for details on how you can help.  Copyright@@ -104,3 +93,11 @@ Available under the BSD 3-clause license.  [hackage]: http://hackage.haskell.org/package/github "Hackage"++Alternative+===========++Library [`github-rest`](https://hackage.haskell.org/package/github-rest)+also provides an interface to the GitHub API.+It compares itself to `github` here:+https://github.com/LeapYear/github-rest#comparison-to-other-libraries
github.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               github-version:            0.27+version:            0.28 synopsis:           Access to the GitHub API, v3. category:           Network description:@@ -18,13 +18,13 @@   >     possibleUser <- GH.github' GH.userInfoForR "phadej"   >     print possibleUser   .-  For more of an overview please see the README: <https://github.com/phadej/github/blob/master/README.md>+  For more of an overview please see the README: <https://github.com/haskell-github/github/blob/master/README.md>  license:            BSD3 license-file:       LICENSE author:             Mike Burns, John Wiegley, Oleg Grenrus-maintainer:         Oleg Grenrus <oleg.grenrus@iki.fi>-homepage:           https://github.com/phadej/github+maintainer:         Andreas Abel+homepage:           https://github.com/haskell-github/github build-type:         Simple copyright:   Copyright 2012-2013 Mike Burns, Copyright 2013-2015 John Wiegley, Copyright 2016-2021 Oleg Grenrus@@ -37,8 +37,9 @@    || ==8.4.4    || ==8.6.5    || ==8.8.4-   || ==8.10.4-   || ==9.0.1+   || ==8.10.7+   || ==9.0.2+   || ==9.2.2  extra-source-files:   README.md@@ -47,7 +48,7 @@  source-repository head   type:     git-  location: git://github.com/phadej/github.git+  location: git://github.com/haskell-github/github.git  flag openssl   description: "Use http-client-openssl"@@ -56,7 +57,13 @@  library   default-language:   Haskell2010-  ghc-options:        -Wall+  ghc-options:+    -Wall+  if impl(ghc >= 8.0)+    ghc-options:+      -Wcompat+      -Wno-star-is-type+        -- The star-is-type warning cannot be sensiblity addressed while supporting GHC 7.   hs-source-dirs:     src   default-extensions:     DataKinds@@ -158,13 +165,13 @@    -- Packages bundles with GHC, mtl and text are also here   build-depends:-      base          >=4.7      && <4.16+      base          >=4.7      && <4.17     , binary        >=0.7.1.0  && <0.11-    , bytestring    >=0.10.4.0 && <0.11+    , bytestring    >=0.10.4.0 && <0.12     , containers    >=0.5.5.1  && <0.7     , deepseq       >=1.3.0.2  && <1.5     , mtl           >=2.1.3.1  && <2.2 || >=2.2.1 && <2.3-    , text          >=1.2.0.6  && <1.3+    , text          >=1.2.0.6  && <2.1     , time-compat   >=1.9.2.2  && <1.10     , transformers  >=0.3.0.0  && <0.6 @@ -177,7 +184,7 @@     , cryptohash-sha1       >=0.11.100.1 && <0.12     , deepseq-generics      >=0.2.0.0    && <0.3     , exceptions            >=0.10.2     && <0.11-    , hashable              >=1.2.7.0    && <1.4+    , hashable              >=1.2.7.0    && <1.5     , http-client           >=0.5.12     && <0.8     , http-link-header      >=1.0.3.1    && <1.3     , http-types            >=0.12.3     && <0.13@@ -209,7 +216,7 @@   hs-source-dirs:     spec   main-is:            Spec.hs   ghc-options:        -Wall -threaded-  build-tool-depends: hspec-discover:hspec-discover >=2.7.1 && <2.8+  build-tool-depends: hspec-discover:hspec-discover >=2.7.1 && <2.10   other-extensions:   TemplateHaskell   other-modules:     GitHub.ActivitySpec@@ -234,7 +241,7 @@     , bytestring     , file-embed     , github-    , hspec                 >=2.6.1 && <2.8+    , hspec                 >=2.6.1 && <2.10     , tagged     , text     , unordered-containers
spec/GitHub/ActivitySpec.hs view
@@ -30,7 +30,7 @@ spec = do   describe "watchersForR" $ do     it "works" $ withAuth $ \auth -> do-      cs <- executeRequest auth $ watchersForR "phadej" "github" GitHub.FetchAll +      cs <- executeRequest auth $ watchersForR "haskell-github" "github" GitHub.FetchAll       cs `shouldSatisfy` isRight       V.length (fromRightS cs) `shouldSatisfy` (> 10)   describe "myStarredR" $ do
spec/GitHub/CommitsSpec.hs view
@@ -30,13 +30,13 @@ spec = do   describe "commitsFor" $ do     it "works" $ withAuth $ \auth -> do-      cs <- github auth commitsForR "phadej" "github" FetchAll+      cs <- github auth commitsForR "haskell-github" "github" FetchAll       cs `shouldSatisfy` isRight       V.length (fromRightS cs) `shouldSatisfy` (> 300)      -- Page size is 30, so we get 60 commits     it "limits the response" $ withAuth $ \auth -> do-      cs <- github auth commitsForR "phadej" "github" (FetchAtLeast 40)+      cs <- github auth commitsForR "haskell-github" "github" (FetchAtLeast 40)       cs `shouldSatisfy` isRight       let cs' = fromRightS cs       V.length cs' `shouldSatisfy` (< 70)@@ -45,12 +45,12 @@    describe "diff" $ do     it "works" $ withAuth $ \auth -> do-      cs <- github auth commitsForR "phadej" "github" (FetchAtLeast 30)+      cs <- github auth commitsForR "haskell-github" "github" (FetchAtLeast 30)       cs `shouldSatisfy` isRight       let commits = take 10 . V.toList . fromRightS $ cs       let pairs = zip commits $ drop 1 commits       forM_ pairs $ \(a, b) -> do-        d <- github auth diffR "phadej" "github" (commitSha a) (commitSha b)+        d <- github auth diffR "haskell-github" "github" (commitSha a) (commitSha b)         d `shouldSatisfy` isRight      it "issue #155" $ withAuth $ \auth -> do
spec/GitHub/EventsSpec.hs view
@@ -27,9 +27,9 @@ spec = do   describe "repositoryEventsR" $ do     it "returns non empty list of events" $ shouldSucceed $-      GitHub.repositoryEventsR "phadej" "github" 1+      GitHub.repositoryEventsR "haskell-github" "github" 1   describe "userEventsR" $ do-    it "returns non empty list of events" $ shouldSucceed $ GitHub.userEventsR "phadej" 1 +    it "returns non empty list of events" $ shouldSucceed $ GitHub.userEventsR "phadej" 1   where shouldSucceed f = withAuth $ \auth -> do           cs <- GitHub.executeRequest auth $ f           cs `shouldSatisfy` isRight
spec/GitHub/IssuesSpec.hs view
@@ -41,10 +41,10 @@     describe "issueR" $ do         it "fetches issue #428" $ withAuth $ \auth -> do             resIss <- GitHub.executeRequest auth $-                GitHub.issueR "phadej" "github" (GitHub.IssueNumber 428)+                GitHub.issueR "haskell-github" "github" (GitHub.IssueNumber 428)             resIss `shouldSatisfy` isRight   where     repos =       [ ("thoughtbot", "paperclip")-      , ("phadej", "github")+      , ("haskell-github", "github")       ]
spec/GitHub/PullRequestReviewsSpec.hs view
@@ -29,4 +29,4 @@             cs `shouldSatisfy` isRight   where     prs =-      [("phadej", "github", IssueNumber 268)]+      [("haskell-github", "github", IssueNumber 268)]
spec/GitHub/PullRequestsSpec.hs view
@@ -47,7 +47,7 @@     describe "pullRequestPatchR" $         it "works" $ withAuth $ \auth -> do             Right patch <- GH.executeRequest auth $-                GH.pullRequestPatchR "phadej" "github" (GH.IssueNumber 349)+                GH.pullRequestPatchR "haskell-github" "github" (GH.IssueNumber 349)             head (LBS8.lines patch) `shouldBe` "From c0e4ad33811be82e1f72ee76116345c681703103 Mon Sep 17 00:00:00 2001"      describe "decoding pull request payloads" $ do@@ -74,21 +74,21 @@      describe "checking if a pull request is merged" $ do         it "works" $ withAuth $ \auth -> do-            b <- GH.executeRequest auth $ GH.isPullRequestMergedR "phadej" "github" (GH.IssueNumber 14)+            b <- GH.executeRequest auth $ GH.isPullRequestMergedR "haskell-github" "github" (GH.IssueNumber 14)             b `shouldSatisfy` isRight             fromRightS b `shouldBe` True      describe "Draft Pull Request" $ do         it "works" $ withAuth $ \auth -> do             cs <- GH.executeRequest auth $-                draftPullRequestsForR "phadej" "github" opts GH.FetchAll+                draftPullRequestsForR "haskell-github" "github" opts GH.FetchAll              cs `shouldSatisfy` isRight    where     repos =       [ ("thoughtbot", "paperclip")-      , ("phadej", "github")+      , ("haskell-github", "github")       ]     opts = GH.stateClosed 
spec/GitHub/ReposSpec.hs view
@@ -29,10 +29,10 @@ spec = do   describe "repositoryR" $ do     it "works" $ withAuth $ \auth -> do-      er <- github auth repositoryR "phadej" "github"+      er <- github auth repositoryR "haskell-github" "github"       er `shouldSatisfy` isRight       let Right r = er-      -- https://github.com/phadej/github/pull/219+      -- https://github.com/haskell-github/github/pull/219       repoDefaultBranch r `shouldBe` Just "master"    describe "currentUserRepos" $ do@@ -47,6 +47,6 @@    describe "languagesFor'" $ do     it "works" $ withAuth $ \auth -> do-      ls <- github auth languagesForR "phadej" "github"+      ls <- github auth languagesForR "haskell-github" "github"       ls `shouldSatisfy` isRight       fromRightS ls `shouldSatisfy` HM.member "Haskell"
spec/GitHub/SearchSpec.hs view
@@ -18,7 +18,7 @@ import GitHub.Data        (Auth (..), Issue (..), IssueNumber (..), IssueState (..),        SimpleUser (..), User, mkId)-import GitHub.Endpoints.Search (SearchResult (..), searchIssuesR, searchUsersR)+import GitHub.Endpoints.Search (SearchResult' (..), SearchResult, searchIssuesR, searchUsersR)  fromRightS :: Show a => Either a b -> b fromRightS (Right b) = b@@ -54,14 +54,14 @@       issueState issue2 `shouldBe` StateOpen      it "performs an issue search via the API" $ withAuth $ \auth -> do-      let query = "Decouple in:title repo:phadej/github created:<=2015-12-01"-      issues <- searchResultResults . fromRightS <$> github auth searchIssuesR query+      let query = "Decouple in:title repo:haskell-github/github created:<=2015-12-01"+      issues <- fmap (searchResultResults . fromRightS) <$> github auth $ searchIssuesR query 5       length issues `shouldBe` 1       issueId (V.head issues) `shouldBe` mkId (Proxy :: Proxy Issue) 119694665    describe "searchUsers" $     it "performs a user search via the API" $ withAuth $ \auth -> do       let query = "oleg.grenrus@iki.fi created:<2020-01-01"-      users <- searchResultResults . fromRightS <$> github auth searchUsersR query+      users <- fmap (searchResultResults . fromRightS) <$> github auth $ searchUsersR query 5       length users `shouldBe` 1       simpleUserId (V.head users) `shouldBe` mkId (Proxy :: Proxy User) 51087
spec/GitHub/UsersSpec.hs view
@@ -67,7 +67,7 @@       (userLogin . fromLeftS . fromOwner . fromRightS $ b) `shouldBe` "phadej"    describe "userInfoCurrentR" $ do-    it "returns information about the autenticated user" $ withAuth $ \auth -> do+    it "returns information about the authenticated user" $ withAuth $ \auth -> do       userInfo <- github auth userInfoCurrentR       userInfo `shouldSatisfy` isRight 
src/GitHub.hs view
@@ -52,9 +52,9 @@     --     -- * Query a Repository Subscription     -- * Set a Repository Subscription-    -- * Delete a Repository Subscription     watchersForR,     reposWatchedByR,+    unwatchRepoR,      -- * Gists     -- | See <https://developer.github.com/v3/gists/>
src/GitHub/Data/Content.hs view
@@ -13,7 +13,6 @@ import Prelude ()  import Data.Aeson.Types (Pair)-import Data.Maybe (maybe) import qualified Data.Text as T  #if MIN_VERSION_aeson(2,0,0)
src/GitHub/Data/Deployments.hs view
@@ -19,9 +19,6 @@ import Control.Arrow (second)  import Data.ByteString (ByteString)-import Data.Maybe      (catMaybes)-import Data.Text       (Text)-import Data.Vector     (Vector)  import GitHub.Data.Definitions (SimpleUser) import GitHub.Data.Id          (Id)
src/GitHub/Data/Events.hs view
@@ -23,10 +23,10 @@     deriving (Show, Data, Typeable, Eq, Ord, Generic)  instance NFData Event where rnf = genericRnf-instance Binary Event +instance Binary Event  instance FromJSON Event where-    parseJSON = withObject "Event" $ \obj -> Event +    parseJSON = withObject "Event" $ \obj -> Event         -- <$> obj .: "id"         <$> obj .: "actor"         <*> obj .: "created_at"
src/GitHub/Data/Options.hs view
@@ -38,12 +38,16 @@     -- * Repo issues     IssueRepoMod,     issueRepoModToQueryString,+    optionsCreator,+    optionsMentioned,     optionsIrrelevantMilestone,     optionsAnyMilestone,     optionsNoMilestone,+    optionsMilestone,     optionsIrrelevantAssignee,     optionsAnyAssignee,     optionsNoAssignee,+    optionsAssignee,     -- * Data     IssueState (..),     MergeableState (..),@@ -351,7 +355,7 @@ -- Issues ------------------------------------------------------------------------------- --- | See <https://developer.github.com/v3/issues/#parameters>.+-- | See <https://docs.github.com/en/rest/reference/issues#list-issues-assigned-to-the-authenticated-user--parameters>. data IssueOptions = IssueOptions     { issueOptionsFilter    :: !IssueFilter     , issueOptionsState     :: !(Maybe IssueState)@@ -373,7 +377,7 @@     , issueOptionsSince     = Nothing     } --- | See <https://developer.github.com/v3/issues/#parameters>.+-- | See <https://docs.github.com/en/rest/reference/issues#list-issues-assigned-to-the-authenticated-user--parameters>. newtype IssueMod = IssueMod (IssueOptions -> IssueOptions)  instance Semigroup IssueMod where@@ -491,16 +495,20 @@ -- Issues repo ------------------------------------------------------------------------------- +-- | Parameters of "list repository issues" (@get /repos/{owner}/{repo}/issues@).+--+-- See <https://docs.github.com/en/rest/reference/issues#list-repository-issues>.+-- data IssueRepoOptions = IssueRepoOptions-    { issueRepoOptionsMilestone :: !(FilterBy (Id Milestone))-    , issueRepoOptionsState     :: !(Maybe IssueState)-    , issueRepoOptionsAssignee  :: !(FilterBy (Name User))-    , issueRepoOptionsCreator   :: !(Maybe (Name User))-    , issueRepoOptionsMentioned :: !(Maybe (Name User))-    , issueRepoOptionsLabels    :: ![Name IssueLabel]-    , issueRepoOptionsSort      :: !SortIssue-    , issueRepoOptionsDirection :: !SortDirection-    , issueRepoOptionsSince     :: !(Maybe UTCTime)+    { issueRepoOptionsMilestone :: !(FilterBy (Id Milestone))   -- ^ 'optionsMilestone' etc.+    , issueRepoOptionsState     :: !(Maybe IssueState)          -- ^ 'HasState'+    , issueRepoOptionsAssignee  :: !(FilterBy (Name User))      -- ^ 'optionsAssignee' etc.+    , issueRepoOptionsCreator   :: !(Maybe (Name User))         -- ^ 'optionsCreator'+    , issueRepoOptionsMentioned :: !(Maybe (Name User))         -- ^ 'optionsMentioned'+    , issueRepoOptionsLabels    :: ![Name IssueLabel]           -- ^ 'HasLabels'+    , issueRepoOptionsSort      :: !SortIssue                   -- ^ 'HasCreatedUpdated' and 'HasComments'+    , issueRepoOptionsDirection :: !SortDirection               -- ^ 'HasDirection'+    , issueRepoOptionsSince     :: !(Maybe UTCTime)             -- ^ 'HasSince'     }   deriving     (Eq, Ord, Show, Generic, Typeable, Data)@@ -579,7 +587,17 @@ -- Issues repo modifiers ------------------------------------------------------------------------------- --- | Don't care about milestones.+-- | Issues created by a certain user.+optionsCreator :: Name User -> IssueRepoMod+optionsCreator u = IssueRepoMod $ \opts ->+    opts { issueRepoOptionsCreator = Just u }++-- | Issue mentioning the given user.+optionsMentioned :: Name User -> IssueRepoMod+optionsMentioned u = IssueRepoMod $ \opts ->+    opts { issueRepoOptionsMentioned = Just u }++-- | Don't care about milestones (default). -- -- 'optionsAnyMilestone' means there should be some milestone, but it can be any. --@@ -588,22 +606,37 @@ optionsIrrelevantMilestone = IssueRepoMod $ \opts ->     opts { issueRepoOptionsMilestone = FilterNotSpecified } +-- | Issues that have a milestone. optionsAnyMilestone :: IssueRepoMod optionsAnyMilestone = IssueRepoMod $ \opts ->     opts { issueRepoOptionsMilestone = FilterAny } +-- | Issues that have no milestone. optionsNoMilestone :: IssueRepoMod optionsNoMilestone = IssueRepoMod $ \opts ->     opts { issueRepoOptionsMilestone = FilterNone } +-- | Issues with the given milestone.+optionsMilestone :: Id Milestone -> IssueRepoMod+optionsMilestone m = IssueRepoMod $ \opts ->+    opts { issueRepoOptionsMilestone = FilterBy m }++-- | Issues with or without assignee (default). optionsIrrelevantAssignee :: IssueRepoMod optionsIrrelevantAssignee = IssueRepoMod $ \opts ->     opts { issueRepoOptionsAssignee = FilterNotSpecified } +-- | Issues assigned to someone. optionsAnyAssignee :: IssueRepoMod optionsAnyAssignee = IssueRepoMod $ \opts ->     opts { issueRepoOptionsAssignee = FilterAny } +-- | Issues assigned to nobody. optionsNoAssignee :: IssueRepoMod optionsNoAssignee = IssueRepoMod $ \opts ->     opts { issueRepoOptionsAssignee = FilterNone }++-- | Issues assigned to a specific user.+optionsAssignee :: Name User -> IssueRepoMod+optionsAssignee u = IssueRepoMod $ \opts ->+    opts { issueRepoOptionsAssignee = FilterBy u }
src/GitHub/Data/Repos.hs view
@@ -61,12 +61,61 @@     , repoPushedAt        :: !(Maybe UTCTime)   -- ^ this is Nothing for new repositories     , repoCreatedAt       :: !(Maybe UTCTime)     , repoUpdatedAt       :: !(Maybe UTCTime)+    , repoPermissions     :: !(Maybe RepoPermissions) -- ^ Repository permissions as they relate to the authenticated user.     }     deriving (Show, Data, Typeable, Eq, Ord, Generic)  instance NFData Repo where rnf = genericRnf instance Binary Repo +data CodeSearchRepo = CodeSearchRepo+    { codeSearchRepoId              :: !(Id Repo)+    , codeSearchRepoName            :: !(Name Repo)+    , codeSearchRepoOwner           :: !SimpleOwner+    , codeSearchRepoPrivate         :: !Bool+    , codeSearchRepoHtmlUrl         :: !URL+    , codeSearchRepoDescription     :: !(Maybe Text)+    , codeSearchRepoFork            :: !(Maybe Bool)+    , codeSearchRepoUrl             :: !URL+    , codeSearchRepoGitUrl          :: !(Maybe URL)+    , codeSearchRepoSshUrl          :: !(Maybe URL)+    , codeSearchRepoCloneUrl        :: !(Maybe URL)+    , codeSearchRepoHooksUrl        :: !URL+    , codeSearchRepoSvnUrl          :: !(Maybe URL)+    , codeSearchRepoHomepage        :: !(Maybe Text)+    , codeSearchRepoLanguage        :: !(Maybe Language)+    , codeSearchRepoSize            :: !(Maybe Int)+    , codeSearchRepoDefaultBranch   :: !(Maybe Text)+    , codeSearchRepoHasIssues       :: !(Maybe Bool)+    , codeSearchRepoHasProjects     :: !(Maybe Bool)+    , codeSearchRepoHasWiki         :: !(Maybe Bool)+    , codeSearchRepoHasPages        :: !(Maybe Bool)+    , codeSearchRepoHasDownloads    :: !(Maybe Bool)+    , codeSearchRepoArchived        :: !Bool+    , codeSearchRepoDisabled        :: !Bool+    , codeSearchRepoPushedAt        :: !(Maybe UTCTime)   -- ^ this is Nothing for new repositories+    , codeSearchRepoCreatedAt       :: !(Maybe UTCTime)+    , codeSearchRepoUpdatedAt       :: !(Maybe UTCTime)+    , codeSearchRepoPermissions     :: !(Maybe RepoPermissions) -- ^ Repository permissions as they relate to the authenticated user.+    }+    deriving (Show, Data, Typeable, Eq, Ord, Generic)++instance NFData CodeSearchRepo where rnf = genericRnf+instance Binary CodeSearchRepo++-- | Repository permissions, as they relate to the authenticated user.+--+-- Returned by for example 'GitHub.Endpoints.Repos.currentUserReposR'+data RepoPermissions = RepoPermissions+    { repoPermissionAdmin :: !Bool+    , repoPermissionPush :: !Bool+    , repoPermissionPull :: !Bool+    }+    deriving (Show, Data, Typeable, Eq, Ord, Generic)++instance NFData RepoPermissions where rnf = genericRnf+instance Binary RepoPermissions+ data RepoRef = RepoRef     { repoRefOwner :: !SimpleOwner     , repoRefRepo  :: !(Name Repo)@@ -214,7 +263,38 @@         <*> o .:? "pushed_at"         <*> o .:? "created_at"         <*> o .:? "updated_at"+        <*> o .:? "permissions" +instance FromJSON CodeSearchRepo where+    parseJSON = withObject "Repo" $ \o -> CodeSearchRepo <$> o .: "id"+        <*> o .: "name"+        <*> o .: "owner"+        <*> o .: "private"+        <*> o .: "html_url"+        <*> o .:? "description"+        <*> o .: "fork"+        <*> o .: "url"+        <*> o .:? "git_url"+        <*> o .:? "ssh_url"+        <*> o .:? "clone_url"+        <*> o .: "hooks_url"+        <*> o .:? "svn_url"+        <*> o .:? "homepage"+        <*> o .:? "language"+        <*> o .:? "size"+        <*> o .:? "default_branch"+        <*> o .:? "has_issues"+        <*> o .:? "has_projects"+        <*> o .:? "has_wiki"+        <*> o .:? "has_pages"+        <*> o .:? "has_downloads"+        <*> o .:? "archived" .!= False+        <*> o .:? "disabled" .!= False+        <*> o .:? "pushed_at"+        <*> o .:? "created_at"+        <*> o .:? "updated_at"+        <*> o .:? "permissions"+ instance ToJSON NewRepo where   toJSON (NewRepo { newRepoName              = name                   , newRepoDescription       = description@@ -272,6 +352,12 @@                    , "allow_rebase_merge" .= allowRebaseMerge                    , "archived"           .= archived                    ]++instance FromJSON RepoPermissions where+  parseJSON = withObject "RepoPermissions" $ \o -> RepoPermissions+        <$> o .: "admin"+        <*> o .: "push"+        <*> o .: "pull"  instance FromJSON RepoRef where     parseJSON = withObject "RepoRef" $ \o -> RepoRef
src/GitHub/Data/Reviews.hs view
@@ -6,7 +6,6 @@ import GitHub.Internal.Prelude import Prelude () -import Data.Text (Text) import qualified Data.Text as T  data ReviewState
src/GitHub/Data/Search.hs view
@@ -5,27 +5,35 @@ -- module GitHub.Data.Search where -import GitHub.Data.Repos       (Repo)+import GitHub.Data.Repos       (CodeSearchRepo) import GitHub.Data.URL         (URL) import GitHub.Internal.Prelude import Prelude ()  import qualified Data.Vector as V -data SearchResult entity = SearchResult+data SearchResult' entities = SearchResult     { searchResultTotalCount :: !Int-    , searchResultResults    :: !(Vector entity)+    , searchResultResults    :: !entities     }   deriving (Show, Data, Typeable, Eq, Ord, Generic) -instance NFData entity => NFData (SearchResult entity) where rnf = genericRnf-instance Binary entity => Binary (SearchResult entity)+type SearchResult entity = SearchResult' (V.Vector entity) -instance FromJSON entity => FromJSON (SearchResult entity) where+instance NFData entities => NFData (SearchResult' entities) where rnf = genericRnf+instance Binary entities => Binary (SearchResult' entities)++instance (Monoid entities, FromJSON entities) => FromJSON (SearchResult' entities) where     parseJSON = withObject "SearchResult" $ \o -> SearchResult         <$> o .: "total_count"-        <*> o .:? "items" .!= V.empty+        <*> o .:? "items" .!= mempty +instance Semigroup res => Semigroup (SearchResult' res) where+    (SearchResult count res) <> (SearchResult count' res') = SearchResult (max count count') (res <> res')++instance Foldable SearchResult' where+    foldMap f (SearchResult _count results) = f results+ data Code = Code     { codeName    :: !Text     , codePath    :: !Text@@ -33,7 +41,7 @@     , codeUrl     :: !URL     , codeGitUrl  :: !URL     , codeHtmlUrl :: !URL-    , codeRepo    :: !Repo+    , codeRepo    :: !CodeSearchRepo     }   deriving (Show, Data, Typeable, Eq, Ord, Generic) 
src/GitHub/Endpoints/Activity/Watching.hs view
@@ -8,6 +8,7 @@ module GitHub.Endpoints.Activity.Watching (     watchersForR,     reposWatchedByR,+    unwatchRepoR,     module GitHub.Data, ) where @@ -27,3 +28,9 @@ reposWatchedByR :: Name Owner -> FetchCount -> Request k (Vector Repo) reposWatchedByR user =     pagedQuery ["users", toPathPart user, "subscriptions"] []++-- | Stop watching repository.+-- See <https://docs.github.com/en/rest/reference/activity#delete-a-repository-subscription>+unwatchRepoR :: Name Owner -> Name Repo -> Request 'RW ()+unwatchRepoR owner repo =+    command Delete ["repos", toPathPart owner, toPathPart repo, "subscription"] mempty
src/GitHub/Endpoints/PullRequests/Reviews.hs view
@@ -12,7 +12,6 @@     ) where  import GitHub.Data-import GitHub.Data.Id (Id) import GitHub.Internal.Prelude import Prelude () 
src/GitHub/Endpoints/Repos.hs view
@@ -43,7 +43,7 @@ repoPublicityQueryString RepoPublicityPrivate = [("type", Just "private")]  -- | List your repositories.--- See <https://developer.github.com/v3/repos/#list-your-repositories>+-- See <https://docs.github.com/en/rest/reference/repos#list-repositories-for-the-authenticated-user> currentUserReposR :: RepoPublicity -> FetchCount -> Request k (Vector Repo) currentUserReposR publicity =     pagedQuery  ["user", "repos"] qs@@ -51,7 +51,7 @@     qs = repoPublicityQueryString publicity  -- | List user repositories.--- See <https://developer.github.com/v3/repos/#list-user-repositories>+-- See <https://docs.github.com/en/rest/reference/repos#list-repositories-for-a-user> userReposR :: Name Owner -> RepoPublicity -> FetchCount -> Request k(Vector Repo) userReposR user publicity =     pagedQuery  ["users", toPathPart user, "repos"] qs@@ -59,7 +59,7 @@     qs = repoPublicityQueryString publicity  -- | List organization repositories.--- See <https://developer.github.com/v3/repos/#list-organization-repositories>+-- See <https://docs.github.com/en/rest/reference/repos#list-organization-repositories> organizationReposR     :: Name Organization     -> RepoPublicity
src/GitHub/Endpoints/Repos/Deployments.hs view
@@ -11,8 +11,6 @@  import Control.Arrow (second) -import Data.Vector (Vector)- import GitHub.Data import GitHub.Internal.Prelude 
src/GitHub/Endpoints/Search.hs view
@@ -21,24 +21,24 @@  -- | Search repositories. -- See <https://developer.github.com/v3/search/#search-repositories>-searchReposR :: Text -> Request k (SearchResult Repo)+searchReposR :: Text -> FetchCount -> Request k (SearchResult Repo) searchReposR searchString =-    query ["search", "repositories"] [("q", Just $ TE.encodeUtf8 searchString)]+    PagedQuery ["search", "repositories"] [("q", Just $ TE.encodeUtf8 searchString)]  -- | Search code. -- See <https://developer.github.com/v3/search/#search-code>-searchCodeR :: Text -> Request k (SearchResult Code)+searchCodeR :: Text -> FetchCount -> Request k (SearchResult Code) searchCodeR searchString =-    query ["search", "code"] [("q", Just $ TE.encodeUtf8 searchString)]+    PagedQuery ["search", "code"] [("q", Just $ TE.encodeUtf8 searchString)]  -- | Search issues. -- See <https://developer.github.com/v3/search/#search-issues>-searchIssuesR :: Text -> Request k (SearchResult Issue)+searchIssuesR :: Text -> FetchCount -> Request k (SearchResult Issue) searchIssuesR searchString =-    query ["search", "issues"] [("q", Just $ TE.encodeUtf8 searchString)]+    PagedQuery ["search", "issues"] [("q", Just $ TE.encodeUtf8 searchString)]  -- | Search users. -- See <https://developer.github.com/v3/search/#search-code>-searchUsersR :: Text -> Request k (SearchResult SimpleUser)+searchUsersR :: Text -> FetchCount -> Request k (SearchResult SimpleUser) searchUsersR searchString =-  query ["search", "users"] [("q", Just $ TE.encodeUtf8 searchString)]+    PagedQuery ["search", "users"] [("q", Just $ TE.encodeUtf8 searchString)]
src/GitHub/Request.hs view
@@ -80,8 +80,7 @@ import Control.Monad.Trans.Class  (lift) import Control.Monad.Trans.Except (ExceptT (..), runExceptT) import Data.Aeson                 (eitherDecode)-import Data.List                  (find, intercalate)-import Data.String                (fromString)+import Data.List                  (find) import Data.Tagged                (Tagged (..)) import Data.Version               (showVersion)