generated from tpl/purs
fix: mdoels
This commit is contained in:
parent
d4b937d0f6
commit
cfd23aa00b
@ -7,6 +7,7 @@ package:
|
||||
- exceptions
|
||||
- fetch
|
||||
- foreign-object
|
||||
- maybe
|
||||
- mmorph
|
||||
- newtype
|
||||
- node-buffer
|
||||
@ -52,7 +53,7 @@ workspace:
|
||||
- url
|
||||
url:
|
||||
git: 'https://git.orionkindel.com/thunderstrike/purescript-url-immutable.git'
|
||||
ref: 'dbfa3b6'
|
||||
ref: '555d55a'
|
||||
dependencies:
|
||||
- arrays
|
||||
- effect
|
||||
|
@ -3,6 +3,8 @@ module Gitea.Error where
|
||||
import Prelude
|
||||
|
||||
import Control.Monad.Error.Class (class MonadThrow, throwError)
|
||||
import Data.Generic.Rep (class Generic)
|
||||
import Data.Show.Generic (genericShow)
|
||||
import Effect.Aff.Class (class MonadAff)
|
||||
import HTTP.Response as HTTP
|
||||
import HTTP.Response as HTTP.Rep
|
||||
@ -13,6 +15,12 @@ data Error
|
||||
| ENotFound
|
||||
| EValidation { message :: String, url :: String }
|
||||
|
||||
derive instance Generic Error _
|
||||
instance Show Error where
|
||||
show = genericShow
|
||||
|
||||
derive instance Eq Error
|
||||
|
||||
guardStatusOk :: forall m. MonadThrow Error m => MonadAff m => HTTP.Response -> m Unit
|
||||
guardStatusOk rep = do
|
||||
status <- HTTP.Rep.status rep
|
||||
|
@ -2,6 +2,7 @@ module Gitea.Types where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Data.Maybe (Maybe)
|
||||
import Data.Newtype (class Newtype)
|
||||
import Foreign.Object (Object)
|
||||
import Simple.JSON (class ReadForeign, class WriteForeign)
|
||||
@ -267,7 +268,7 @@ type RepoGiteaSettingsMutable r =
|
||||
|
||||
type RepoSectionGiteaStatsMutable r =
|
||||
( "template" :: Boolean
|
||||
, "external_wiki" :: RepoExternalWiki
|
||||
, "external_wiki" :: Maybe RepoExternalWiki
|
||||
| r
|
||||
)
|
||||
|
||||
@ -280,7 +281,7 @@ type RepoSectionGiteaStatsImmutable r =
|
||||
, "watchers_count" :: Int
|
||||
, "fork" :: Boolean
|
||||
, "forks_count" :: Int
|
||||
, "repo_transfer" :: RepoTransfer
|
||||
, "repo_transfer" :: Maybe RepoTransfer
|
||||
| r
|
||||
)
|
||||
|
||||
@ -311,8 +312,8 @@ type RepoSectionStatsImmutable r =
|
||||
)
|
||||
|
||||
type RepoSectionTrackerMutable r =
|
||||
( "external_tracker" :: RepoExternalTracker
|
||||
, "internal_tracker" :: RepoInternalTracker
|
||||
( "external_tracker" :: Maybe RepoExternalTracker
|
||||
, "internal_tracker" :: Maybe RepoInternalTracker
|
||||
| r
|
||||
)
|
||||
|
||||
@ -370,7 +371,7 @@ type Commit =
|
||||
, "removed" :: Array String
|
||||
, "timestamp" :: String
|
||||
, "url" :: String
|
||||
, "verification" :: CommitVerification
|
||||
, "verification" :: Maybe CommitVerification
|
||||
}
|
||||
|
||||
type Branch =
|
||||
|
Loading…
Reference in New Issue
Block a user