hercules-ci-api 0.7.2.1 → 0.8.0.0
raw patch · 46 files changed
+746/−138 lines, 46 filesdep +QuickCheckdep +hspecdep +protoludedep ~aesondep ~basesetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies added: QuickCheck, hspec, protolude, quickcheck-classes, vector
Dependency ranges changed: aeson, base
API changes (from Hackage documentation)
- Hercules.API.SourceHostingSite.SimpleSite: SimpleSite :: Id SourceHostingSite -> Name SourceHostingSite -> Text -> SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: [displayName] :: SimpleSite -> Text
- Hercules.API.SourceHostingSite.SimpleSite: [id] :: SimpleSite -> Id SourceHostingSite
- Hercules.API.SourceHostingSite.SimpleSite: [name] :: SimpleSite -> Name SourceHostingSite
- Hercules.API.SourceHostingSite.SimpleSite: data SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance Control.DeepSeq.NFData Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance GHC.Classes.Eq Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance GHC.Generics.Generic Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SimpleSite: instance GHC.Show.Show Hercules.API.SourceHostingSite.SimpleSite.SimpleSite
- Hercules.API.SourceHostingSite.SourceHostingSite: SourceHostingSite :: Id SourceHostingSite -> Name SourceHostingSite -> Text -> Maybe Text -> SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: [displayName] :: SourceHostingSite -> Text
- Hercules.API.SourceHostingSite.SourceHostingSite: [id] :: SourceHostingSite -> Id SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: [newInstallationURL] :: SourceHostingSite -> Maybe Text
- Hercules.API.SourceHostingSite.SourceHostingSite: [slug] :: SourceHostingSite -> Name SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: data SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance Control.DeepSeq.NFData Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance GHC.Classes.Eq Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance GHC.Generics.Generic Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
- Hercules.API.SourceHostingSite.SourceHostingSite: instance GHC.Show.Show Hercules.API.SourceHostingSite.SourceHostingSite.SourceHostingSite
+ Hercules.API: [clientClientInfo] :: ClientAPI auth f -> f :- ToServantApi (ClientInfoAPI auth)
+ Hercules.API: [clientForges] :: ClientAPI auth f -> f :- ToServantApi (ForgeAPI auth)
+ Hercules.API: [clientGitLab] :: ClientAPI auth f -> f :- ToServantApi (GitLabAPI auth)
+ Hercules.API: [clientInfo] :: HerculesAPI auth f -> f :- ToServantApi (ClientInfoAPI auth)
+ Hercules.API: [forges] :: HerculesAPI auth f -> f :- ToServantApi (ForgeAPI auth)
+ Hercules.API: [gitlab] :: HerculesAPI auth f -> f :- ToServantApi (GitLabAPI auth)
+ Hercules.API.Agents.AgentSession: [concurrentTasks] :: AgentSession -> Int
+ Hercules.API.Agents.AgentSession: [pushCaches] :: AgentSession -> [Text]
+ Hercules.API.Attribute: attributePathFromString :: Text -> [Text]
+ Hercules.API.Attribute: attributePathToString :: [Text] -> Text
+ Hercules.API.Auth: AuthRoutes :: (f :- OAuthReturn Optional view) -> AuthRoutes view f
+ Hercules.API.Auth: [authRouteReturn] :: AuthRoutes view f -> f :- OAuthReturn Optional view
+ Hercules.API.Auth: [return] :: AuthAPI auth f -> f :- OAuthReturn Required (auth :> Get302 '[PlainText, JSON] '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie])
+ Hercules.API.Auth: [start] :: AuthAPI auth f -> f :- (Summary "Initiate an OAuth login, redirecting the client to a URL at the OAuth provider." :> ("api" :> ("auth" :> (Capture "type" Text :> ("start" :> (Capture "forgeId" (Id Forge) :> (QueryParam' '[Optional, Strict] "redirect" Text :> (auth :> Get302 '[PlainText, JSON] '[]))))))))
+ Hercules.API.Auth: data AuthRoutes view f
+ Hercules.API.Auth: instance GHC.Generics.Generic (Hercules.API.Auth.AuthRoutes view f)
+ Hercules.API.Auth: type OAuthReturn stage view = "api" :> "auth" :> "forge" :> Capture "forge" (Id Forge) :> "return" :> QueryParam' '[stage, Strict] "code" Text :> QueryParam' '[Optional, Strict] "redirect" Text :> view
+ Hercules.API.BillingStatus: Enterprise :: BillingStatus
+ Hercules.API.Build: [cancelDerivation] :: BuildAPI auth f -> f :- (Summary "Cancel a derivation" :> (Description "If running, the build or push process will be killed. It will not be restarted, unless a rebuild is requested, or when output contents are required during evaluation (import from derivation)." :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("cancel" :> (auth :> Post '[PlainText, JSON] NoContent))))))))
+ Hercules.API.Build.DerivationEvent: DerivationEventForceCancelled :: UTCTime -> Maybe SimpleAccount -> DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: ForceCancelled :: DerivationEventForceCancelled -> DerivationEvent
+ Hercules.API.Build.DerivationEvent: [$sel:byUser:DerivationEventForceCancelled] :: DerivationEventForceCancelled -> Maybe SimpleAccount
+ Hercules.API.Build.DerivationEvent: [$sel:time:DerivationEventForceCancelled] :: DerivationEventForceCancelled -> UTCTime
+ Hercules.API.Build.DerivationEvent: data DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance Control.DeepSeq.NFData Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance GHC.Classes.Eq Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance GHC.Generics.Generic Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationEvent: instance GHC.Show.Show Hercules.API.Build.DerivationEvent.DerivationEventForceCancelled
+ Hercules.API.Build.DerivationInfo: [mayCancel] :: DerivationInfo -> Bool
+ Hercules.API.Build.EvaluationDetail: IFDAttribute :: Attribute Derivation -> IFDAttribute
+ Hercules.API.Build.EvaluationDetail: [ifdAttributes] :: EvaluationDetail -> [IFDAttribute]
+ Hercules.API.Build.EvaluationDetail: instance Control.DeepSeq.NFData Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: instance GHC.Classes.Eq Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: instance GHC.Generics.Generic Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: instance GHC.Show.Show Hercules.API.Build.EvaluationDetail.IFDAttribute
+ Hercules.API.Build.EvaluationDetail: newtype IFDAttribute
+ Hercules.API.ClientInfo: ClientInfoAPI :: (f :- ("client" :> ("info" :> (auth :> Get '[JSON] ClientInfo)))) -> ClientInfoAPI auth f
+ Hercules.API.ClientInfo: [getClientInfo] :: ClientInfoAPI auth f -> f :- ("client" :> ("info" :> (auth :> Get '[JSON] ClientInfo)))
+ Hercules.API.ClientInfo: data ClientInfoAPI auth f
+ Hercules.API.ClientInfo: instance GHC.Generics.Generic (Hercules.API.ClientInfo.ClientInfoAPI auth f)
+ Hercules.API.ClientInfo.ClientInfo: ClientInfo :: Text -> Text -> Text -> [Forge] -> [Account] -> ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: [apiBaseUrl] :: ClientInfo -> Text
+ Hercules.API.ClientInfo.ClientInfo: [forges] :: ClientInfo -> [Forge]
+ Hercules.API.ClientInfo.ClientInfo: [frontendBaseUrl] :: ClientInfo -> Text
+ Hercules.API.ClientInfo.ClientInfo: [licensedTo] :: ClientInfo -> Text
+ Hercules.API.ClientInfo.ClientInfo: [personalAccounts] :: ClientInfo -> [Account]
+ Hercules.API.ClientInfo.ClientInfo: data ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance Control.DeepSeq.NFData Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance GHC.Classes.Eq Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance GHC.Generics.Generic Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.ClientInfo.ClientInfo: instance GHC.Show.Show Hercules.API.ClientInfo.ClientInfo.ClientInfo
+ Hercules.API.Effects.EffectInfo: [waitingForEffects] :: EffectInfo -> [EffectReference]
+ Hercules.API.Effects.EffectInfo: [waitingForJobs] :: EffectInfo -> [SimpleJob]
+ Hercules.API.Effects.EffectReference: EffectReference :: SimpleJob -> [Text] -> EffectReference
+ Hercules.API.Effects.EffectReference: [attributePath] :: EffectReference -> [Text]
+ Hercules.API.Effects.EffectReference: [job] :: EffectReference -> SimpleJob
+ Hercules.API.Effects.EffectReference: data EffectReference
+ Hercules.API.Effects.EffectReference: instance Control.DeepSeq.NFData Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Effects.EffectReference: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Effects.EffectReference: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Effects.EffectReference: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Effects.EffectReference: instance GHC.Classes.Eq Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Effects.EffectReference: instance GHC.Generics.Generic Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Effects.EffectReference: instance GHC.Show.Show Hercules.API.Effects.EffectReference.EffectReference
+ Hercules.API.Error: Error :: [Text] -> Text -> Error
+ Hercules.API.Error: [errorTags] :: Error -> [Text]
+ Hercules.API.Error: [message] :: Error -> Text
+ Hercules.API.Error: data Error
+ Hercules.API.Error: instance Control.DeepSeq.NFData Hercules.API.Error.Error
+ Hercules.API.Error: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Error.Error
+ Hercules.API.Error: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Error.Error
+ Hercules.API.Error: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Error.Error
+ Hercules.API.Error: instance GHC.Classes.Eq Hercules.API.Error.Error
+ Hercules.API.Error: instance GHC.Generics.Generic Hercules.API.Error.Error
+ Hercules.API.Error: instance GHC.Show.Show Hercules.API.Error.Error
+ Hercules.API.Evaluation.AttributeError: [trace] :: AttributeError -> Maybe Text
+ Hercules.API.Forge: ForgeAPI :: (f :- Substitute ("forges" :> (Capture "forgeId" (Id Forge) :> Placeholder)) (ToServantApi (ForgeResourceGroup auth))) -> (f :- Substitute ("forge" :> (Capture "forgeName" (Name Forge) :> Placeholder)) (ToServantApi (ForgeResourceGroup auth))) -> ForgeAPI auth f
+ Hercules.API.Forge: ForgeResourceGroup :: (f :- (Summary "Get the forge." :> (auth :> Get '[JSON] Forge))) -> (f :- (Summary "Delete the forge." :> (auth :> Delete '[JSON] NoContent))) -> ForgeResourceGroup auth f
+ Hercules.API.Forge: [delete] :: ForgeResourceGroup auth f -> f :- (Summary "Delete the forge." :> (auth :> Delete '[JSON] NoContent))
+ Hercules.API.Forge: [forgeById] :: ForgeAPI auth f -> f :- Substitute ("forges" :> (Capture "forgeId" (Id Forge) :> Placeholder)) (ToServantApi (ForgeResourceGroup auth))
+ Hercules.API.Forge: [forgeByName] :: ForgeAPI auth f -> f :- Substitute ("forge" :> (Capture "forgeName" (Name Forge) :> Placeholder)) (ToServantApi (ForgeResourceGroup auth))
+ Hercules.API.Forge: [get] :: ForgeResourceGroup auth f -> f :- (Summary "Get the forge." :> (auth :> Get '[JSON] Forge))
+ Hercules.API.Forge: data ForgeAPI auth f
+ Hercules.API.Forge: data ForgeResourceGroup auth f
+ Hercules.API.Forge: instance GHC.Generics.Generic (Hercules.API.Forge.ForgeAPI auth f)
+ Hercules.API.Forge: instance GHC.Generics.Generic (Hercules.API.Forge.ForgeResourceGroup auth f)
+ Hercules.API.Forge.Forge: Forge :: Id Forge -> Name Forge -> Text -> Text -> Maybe Text -> Maybe Bool -> Forge
+ Hercules.API.Forge.Forge: [adminPermission] :: Forge -> Maybe Bool
+ Hercules.API.Forge.Forge: [displayName] :: Forge -> Text
+ Hercules.API.Forge.Forge: [id] :: Forge -> Id Forge
+ Hercules.API.Forge.Forge: [newInstallationURL] :: Forge -> Maybe Text
+ Hercules.API.Forge.Forge: [slug] :: Forge -> Name Forge
+ Hercules.API.Forge.Forge: [typ] :: Forge -> Text
+ Hercules.API.Forge.Forge: data Forge
+ Hercules.API.Forge.Forge: instance Control.DeepSeq.NFData Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.Forge: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.Forge: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.Forge: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.Forge: instance GHC.Classes.Eq Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.Forge: instance GHC.Generics.Generic Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.Forge: instance GHC.Show.Show Hercules.API.Forge.Forge.Forge
+ Hercules.API.Forge.SimpleForge: SimpleForge :: Id Forge -> Name Forge -> Text -> SimpleForge
+ Hercules.API.Forge.SimpleForge: [displayName] :: SimpleForge -> Text
+ Hercules.API.Forge.SimpleForge: [id] :: SimpleForge -> Id Forge
+ Hercules.API.Forge.SimpleForge: [name] :: SimpleForge -> Name Forge
+ Hercules.API.Forge.SimpleForge: data SimpleForge
+ Hercules.API.Forge.SimpleForge: instance Control.DeepSeq.NFData Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.Forge.SimpleForge: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.Forge.SimpleForge: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.Forge.SimpleForge: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.Forge.SimpleForge: instance GHC.Classes.Eq Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.Forge.SimpleForge: instance GHC.Generics.Generic Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.Forge.SimpleForge: instance GHC.Show.Show Hercules.API.Forge.SimpleForge.SimpleForge
+ Hercules.API.GitLab: GitLabAPI :: (f :- ("gitlab" :> ("installation" :> (ReqBody '[JSON] CreateInstallationBuilderRequest :> (auth :> Post '[JSON] InstallationBuilder))))) -> (f :- ("gitlab" :> ("installations" :> (auth :> Get '[JSON] InstallationBuilders)))) -> (f :- ("gitlab" :> ("installation" :> (Capture "installationId" (Id InstallationBuilder) :> (auth :> Get '[JSON] InstallationBuilder))))) -> (f :- ("gitlab" :> ("installation" :> (Capture "installationId" (Id InstallationBuilder) :> (auth :> (ReqBody '[JSON] PatchInstallationBuilder :> Patch '[JSON] InstallationBuilder)))))) -> (f :- ("gitlab" :> ("installation" :> (Capture "installationId" (Id InstallationBuilder) :> (auth :> Delete '[JSON] NoContent))))) -> (f :- ("accounts" :> (Capture "accountId" (Id Account) :> ("gitlab" :> ("install" :> (auth :> Post '[JSON] NoContent)))))) -> (f :- ("accounts" :> (Capture "accountId" (Id Account) :> ("gitlab" :> ("deinstall" :> (auth :> Post '[JSON] NoContent)))))) -> GitLabAPI auth f
+ Hercules.API.GitLab: [createInstallationBuilder] :: GitLabAPI auth f -> f :- ("gitlab" :> ("installation" :> (ReqBody '[JSON] CreateInstallationBuilderRequest :> (auth :> Post '[JSON] InstallationBuilder))))
+ Hercules.API.GitLab: [deinstallAccount] :: GitLabAPI auth f -> f :- ("accounts" :> (Capture "accountId" (Id Account) :> ("gitlab" :> ("deinstall" :> (auth :> Post '[JSON] NoContent)))))
+ Hercules.API.GitLab: [deleteInstallationBuilder] :: GitLabAPI auth f -> f :- ("gitlab" :> ("installation" :> (Capture "installationId" (Id InstallationBuilder) :> (auth :> Delete '[JSON] NoContent))))
+ Hercules.API.GitLab: [getInstallationBuilder] :: GitLabAPI auth f -> f :- ("gitlab" :> ("installation" :> (Capture "installationId" (Id InstallationBuilder) :> (auth :> Get '[JSON] InstallationBuilder))))
+ Hercules.API.GitLab: [getInstallationBuilders] :: GitLabAPI auth f -> f :- ("gitlab" :> ("installations" :> (auth :> Get '[JSON] InstallationBuilders)))
+ Hercules.API.GitLab: [installAccount] :: GitLabAPI auth f -> f :- ("accounts" :> (Capture "accountId" (Id Account) :> ("gitlab" :> ("install" :> (auth :> Post '[JSON] NoContent)))))
+ Hercules.API.GitLab: [patchInstallationBuilder] :: GitLabAPI auth f -> f :- ("gitlab" :> ("installation" :> (Capture "installationId" (Id InstallationBuilder) :> (auth :> (ReqBody '[JSON] PatchInstallationBuilder :> Patch '[JSON] InstallationBuilder)))))
+ Hercules.API.GitLab: data GitLabAPI auth f
+ Hercules.API.GitLab: instance GHC.Generics.Generic (Hercules.API.GitLab.GitLabAPI auth f)
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: CreateInstallationBuilderRequest :: Text -> Text -> Text -> CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: [gitlabAdminPassword] :: CreateInstallationBuilderRequest -> Text
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: [gitlabAdminUsername] :: CreateInstallationBuilderRequest -> Text
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: [gitlabURL] :: CreateInstallationBuilderRequest -> Text
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: data CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance Control.DeepSeq.NFData Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance GHC.Classes.Eq Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance GHC.Generics.Generic Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderRequest: instance GHC.Show.Show Hercules.API.GitLab.CreateInstallationBuilderRequest.CreateInstallationBuilderRequest
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: CreateInstallationBuilderResponse :: Maybe InstallationBuilder -> Maybe Text -> CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: [error] :: CreateInstallationBuilderResponse -> Maybe Text
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: [ok] :: CreateInstallationBuilderResponse -> Maybe InstallationBuilder
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: data CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance Control.DeepSeq.NFData Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance GHC.Classes.Eq Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance GHC.Generics.Generic Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.CreateInstallationBuilderResponse: instance GHC.Show.Show Hercules.API.GitLab.CreateInstallationBuilderResponse.CreateInstallationBuilderResponse
+ Hercules.API.GitLab.InstallationBuilder: InstallationBuilder :: Id InstallationBuilder -> Text -> Text -> Text -> Maybe SimpleForge -> [Error] -> InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: InstallationBuilders :: [InstallationBuilder] -> InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: [displayName] :: InstallationBuilder -> Text
+ Hercules.API.GitLab.InstallationBuilder: [errors] :: InstallationBuilder -> [Error]
+ Hercules.API.GitLab.InstallationBuilder: [forge] :: InstallationBuilder -> Maybe SimpleForge
+ Hercules.API.GitLab.InstallationBuilder: [gitlabURL] :: InstallationBuilder -> Text
+ Hercules.API.GitLab.InstallationBuilder: [id] :: InstallationBuilder -> Id InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: [items] :: InstallationBuilders -> [InstallationBuilder]
+ Hercules.API.GitLab.InstallationBuilder: [name] :: InstallationBuilder -> Text
+ Hercules.API.GitLab.InstallationBuilder: data InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: data InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance Control.DeepSeq.NFData Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance Control.DeepSeq.NFData Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance GHC.Classes.Eq Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance GHC.Classes.Eq Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance GHC.Generics.Generic Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance GHC.Generics.Generic Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.InstallationBuilder: instance GHC.Show.Show Hercules.API.GitLab.InstallationBuilder.InstallationBuilder
+ Hercules.API.GitLab.InstallationBuilder: instance GHC.Show.Show Hercules.API.GitLab.InstallationBuilder.InstallationBuilders
+ Hercules.API.GitLab.PatchInstallationBuilder: PatchInstallationBuilder :: Maybe Text -> Maybe Text -> PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: [displayName] :: PatchInstallationBuilder -> Maybe Text
+ Hercules.API.GitLab.PatchInstallationBuilder: [name] :: PatchInstallationBuilder -> Maybe Text
+ Hercules.API.GitLab.PatchInstallationBuilder: data PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance Control.DeepSeq.NFData Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance GHC.Classes.Eq Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance GHC.Generics.Generic Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.GitLab.PatchInstallationBuilder: instance GHC.Show.Show Hercules.API.GitLab.PatchInstallationBuilder.PatchInstallationBuilder
+ Hercules.API.Projects: [getJobHandlers] :: ProjectsAPI auth f -> f :- (Summary "Get a job's handler declarations, if any." :> (Description "Handlers define what to build and do on events such as onPush, onSchedule." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("handlers" :> (auth :> Get '[JSON] JobHandlers))))))
+ Hercules.API.Projects: [get] :: ProjectResourceGroup auth f -> f :- (Summary "Retrieve a project" :> (auth :> Get '[JSON] Project))
+ Hercules.API.Projects: [jobTriggerOnSchedule] :: ProjectsAPI auth f -> f :- (Summary "Create a scheduled job to run now, based on a configuration job." :> (Description "This is mostly intended for trying out new scheduled jobs before they are merged. The job is run in the context of the job's branch; not that of the default branch." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("on-schedule" :> (Capture' '[Required, Strict] "jobName" Text :> ("run" :> (auth :> Post '[JSON] Job))))))))
+ Hercules.API.Projects: type GetJsonWithPreflight a = Get '[JSON] (Headers '[Header "Access-Control-Allow-Origin" Text] a) :<|> Verb 'OPTIONS 204 '[JSON] (Headers '[Header "Access-Control-Allow-Origin" Text, Header "Access-Control-Allow-Headers" Text, Header "Access-Control-Allow-Methods" Text] NoContent)
+ Hercules.API.Projects.Job: OnSchedule :: JobType
+ Hercules.API.Projects.JobHandlers: JobHandlers :: Id Job -> Map Text OnPushHandler -> Map Text OnScheduleHandler -> JobHandlers
+ Hercules.API.Projects.JobHandlers: [jobId] :: JobHandlers -> Id Job
+ Hercules.API.Projects.JobHandlers: [onPush] :: JobHandlers -> Map Text OnPushHandler
+ Hercules.API.Projects.JobHandlers: [onSchedule] :: JobHandlers -> Map Text OnScheduleHandler
+ Hercules.API.Projects.JobHandlers: data JobHandlers
+ Hercules.API.Projects.JobHandlers: instance Control.DeepSeq.NFData Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers: instance GHC.Classes.Eq Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers: instance GHC.Generics.Generic Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers: instance GHC.Show.Show Hercules.API.Projects.JobHandlers.JobHandlers
+ Hercules.API.Projects.JobHandlers.OnPushHandler: OnPushHandler :: Text -> Bool -> OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: [isFlake] :: OnPushHandler -> Bool
+ Hercules.API.Projects.JobHandlers.OnPushHandler: [name] :: OnPushHandler -> Text
+ Hercules.API.Projects.JobHandlers.OnPushHandler: data OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance Control.DeepSeq.NFData Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance GHC.Classes.Eq Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance GHC.Generics.Generic Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnPushHandler: instance GHC.Show.Show Hercules.API.Projects.JobHandlers.OnPushHandler.OnPushHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: OnScheduleHandler :: Text -> Bool -> TimeConstraints -> Bool -> OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: TimeConstraints :: Int -> [Int] -> Maybe [DayOfWeek] -> Maybe [Int] -> TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [dayOfMonth] :: TimeConstraints -> Maybe [Int]
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [dayOfWeek] :: TimeConstraints -> Maybe [DayOfWeek]
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [hour] :: TimeConstraints -> [Int]
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [isFlake] :: OnScheduleHandler -> Bool
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [mainExists] :: OnScheduleHandler -> Bool
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [minute] :: TimeConstraints -> Int
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [name] :: OnScheduleHandler -> Text
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: [when] :: OnScheduleHandler -> TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: data OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: data TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Control.DeepSeq.NFData Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Control.DeepSeq.NFData Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance GHC.Classes.Eq Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance GHC.Classes.Eq Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance GHC.Generics.Generic Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance GHC.Generics.Generic Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance GHC.Show.Show Hercules.API.Projects.JobHandlers.OnScheduleHandler.OnScheduleHandler
+ Hercules.API.Projects.JobHandlers.OnScheduleHandler: instance GHC.Show.Show Hercules.API.Projects.JobHandlers.OnScheduleHandler.TimeConstraints
+ Hercules.API.Projects.LegacySimpleJob: LegacySimpleJob :: Id "Job" -> Project -> Int64 -> JobStatus -> JobPhase -> LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: [id] :: LegacySimpleJob -> Id "Job"
+ Hercules.API.Projects.LegacySimpleJob: [index] :: LegacySimpleJob -> Int64
+ Hercules.API.Projects.LegacySimpleJob: [phase] :: LegacySimpleJob -> JobPhase
+ Hercules.API.Projects.LegacySimpleJob: [project] :: LegacySimpleJob -> Project
+ Hercules.API.Projects.LegacySimpleJob: [status] :: LegacySimpleJob -> JobStatus
+ Hercules.API.Projects.LegacySimpleJob: data LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance Control.DeepSeq.NFData Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance GHC.Classes.Eq Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance GHC.Generics.Generic Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.LegacySimpleJob: instance GHC.Show.Show Hercules.API.Projects.LegacySimpleJob.LegacySimpleJob
+ Hercules.API.Projects.Project: [name] :: Project -> Name Project
+ Hercules.API.Projects.Project: [owner] :: Project -> SimpleAccount
+ Hercules.Frontend: [auth] :: FrontendRoutes view f -> ToServant (AuthRoutes view) f
- Hercules.API: ClientAPI :: (f :- ToServantApi (AccountsAPI auth)) -> (f :- ToServantApi (ReposAPI auth)) -> (f :- ToServantApi (ProjectsAPI auth)) -> (f :- ToServantApi (AgentsAPI auth)) -> (f :- ToServantApi (BuildAPI auth)) -> (f :- ToServantApi (EffectsAPI auth)) -> (f :- ToServantApi (OrganizationsAPI auth)) -> (f :- ToServantApi (StateAPI auth)) -> ClientAPI auth f
+ Hercules.API: ClientAPI :: (f :- ToServantApi (AccountsAPI auth)) -> (f :- ToServantApi (ClientInfoAPI auth)) -> (f :- ToServantApi (ForgeAPI auth)) -> (f :- ToServantApi (ReposAPI auth)) -> (f :- ToServantApi (ProjectsAPI auth)) -> (f :- ToServantApi (AgentsAPI auth)) -> (f :- ToServantApi (BuildAPI auth)) -> (f :- ToServantApi (EffectsAPI auth)) -> (f :- ToServantApi (OrganizationsAPI auth)) -> (f :- ToServantApi (StateAPI auth)) -> (f :- ToServantApi (GitLabAPI auth)) -> ClientAPI auth f
- Hercules.API: HerculesAPI :: (f :- ToServantApi (AccountsAPI auth)) -> (f :- ToServantApi (ReposAPI auth)) -> (f :- ToServantApi (ProjectsAPI auth)) -> (f :- ToServantApi (AgentsAPI auth)) -> (f :- ToServantApi (BuildAPI auth)) -> (f :- ToServantApi (EffectsAPI auth)) -> (f :- ToServantApi (HealthAPI auth)) -> (f :- ToServantApi (OrganizationsAPI auth)) -> (f :- ToServantApi (StateAPI auth)) -> HerculesAPI auth f
+ Hercules.API: HerculesAPI :: (f :- ToServantApi (AccountsAPI auth)) -> (f :- ToServantApi (ClientInfoAPI auth)) -> (f :- ToServantApi (ForgeAPI auth)) -> (f :- ToServantApi (ReposAPI auth)) -> (f :- ToServantApi (ProjectsAPI auth)) -> (f :- ToServantApi (AgentsAPI auth)) -> (f :- ToServantApi (BuildAPI auth)) -> (f :- ToServantApi (EffectsAPI auth)) -> (f :- ToServantApi (HealthAPI auth)) -> (f :- ToServantApi (OrganizationsAPI auth)) -> (f :- ToServantApi (StateAPI auth)) -> (f :- ToServantApi (GitLabAPI auth)) -> HerculesAPI auth f
- Hercules.API: enterApiE :: forall {k} subapi api mode (a :: k). (GenericServant (api a) mode, GenericServant (subapi a) mode) => api a mode -> (api a mode -> ToServant (subapi a) mode) -> subapi a mode
+ Hercules.API: enterApiE :: forall {k} subapi api mode (a :: k). GenericServant (subapi a) mode => api a mode -> (api a mode -> ToServant (subapi a) mode) -> subapi a mode
- Hercules.API: useApi :: forall subapi api mode. (GenericServant api mode, GenericServant subapi mode) => (api mode -> ToServant subapi mode) -> api mode -> subapi mode
+ Hercules.API: useApi :: forall subapi api mode. GenericServant subapi mode => (api mode -> ToServant subapi mode) -> api mode -> subapi mode
- Hercules.API.Accounts: AccountsAPI :: (f :- Substitute ("accounts" :> ("me" :> Placeholder)) (ToServantApi (AccountResourceGroup auth))) -> (f :- (Summary "Retrieve notification settings" :> ("accounts" :> ("me" :> ("settings" :> ("notifications" :> (auth :> Get '[JSON] NotificationSettings))))))) -> (f :- (Summary "Update notification settings" :> ("accounts" :> ("me" :> ("settings" :> ("notifications" :> (ReqBody '[JSON] NotificationSettingsPatch :> (auth :> Patch '[JSON] NotificationSettings)))))))) -> (f :- Substitute ("accounts" :> (Capture "accountId" (Id Account) :> Placeholder)) (ToServantApi (AccountResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture "site" (Name SourceHostingSite) :> ("account" :> (Capture "account" (Name Account) :> Placeholder)))) (ToServantApi (AccountResourceGroup auth))) -> (f :- (Summary "Accounts that the authenticated user owns, admins or collaborates with." :> ("accounts" :> (QueryParam "site" (Name SourceHostingSite) :> (QueryParam "name" (Name Account) :> (auth :> Get '[JSON] [Account])))))) -> (f :- (Summary "Create a request to authorize the CLI." :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> (ReqBody '[JSON] CLIAuthorizationRequestCreate :> Post '[JSON] CLIAuthorizationRequestCreateResponse))))))) -> (f :- (Summary "Check the request status" :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> ("status" :> (Capture "temporaryToken" Text :> Get '[JSON] CLIAuthorizationRequestStatus)))))))) -> (f :- (Summary "Retrieve the request" :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> (Capture "browserToken" Text :> (auth :> Get '[JSON] CLIAuthorizationRequest)))))))) -> (f :- (Summary "Retrieve the request" :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> (Capture "browserToken" Text :> ("confirm" :> (auth :> Post '[JSON] NoContent))))))))) -> (f :- (Summary "List the CLI tokens associated with the current account." :> ("auth" :> ("cli" :> ("tokens" :> (auth :> Get '[JSON] CLITokensResponse)))))) -> (f :- (Summary "Permanently disallow the use of a CLI token." :> ("auth" :> ("cli" :> ("tokens" :> (Capture "cliTokenId" (Id "CLIToken") :> ("revoke" :> (auth :> Post '[JSON] NoContent)))))))) -> (f :- (Summary "Retrieve installation status after redirect from external source site settings." :> ("sites" :> (Capture "siteId" (Id SourceHostingSite) :> ("installation" :> (Capture "installationId" Int :> ("status" :> (auth :> Get '[JSON] AccountInstallationStatus)))))))) -> AccountsAPI auth f
+ Hercules.API.Accounts: AccountsAPI :: (f :- Substitute ("accounts" :> ("me" :> Placeholder)) (ToServantApi (AccountResourceGroup auth))) -> (f :- (Summary "Retrieve notification settings" :> ("accounts" :> ("me" :> ("settings" :> ("notifications" :> (auth :> Get '[JSON] NotificationSettings))))))) -> (f :- (Summary "Update notification settings" :> ("accounts" :> ("me" :> ("settings" :> ("notifications" :> (ReqBody '[JSON] NotificationSettingsPatch :> (auth :> Patch '[JSON] NotificationSettings)))))))) -> (f :- Substitute ("accounts" :> (Capture "accountId" (Id Account) :> Placeholder)) (ToServantApi (AccountResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture "site" (Name Forge) :> ("account" :> (Capture "account" (Name Account) :> Placeholder)))) (ToServantApi (AccountResourceGroup auth))) -> (f :- (Summary "Accounts that the authenticated user owns, admins or collaborates with." :> ("accounts" :> (QueryParam "site" (Name Forge) :> (QueryParam "name" (Name Account) :> (auth :> Get '[JSON] [Account])))))) -> (f :- (Summary "Create a request to authorize the CLI." :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> (ReqBody '[JSON] CLIAuthorizationRequestCreate :> Post '[JSON] CLIAuthorizationRequestCreateResponse))))))) -> (f :- (Summary "Check the request status" :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> ("status" :> (Capture "temporaryToken" Text :> Get '[JSON] CLIAuthorizationRequestStatus)))))))) -> (f :- (Summary "Retrieve the request" :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> (Capture "browserToken" Text :> (auth :> Get '[JSON] CLIAuthorizationRequest)))))))) -> (f :- (Summary "Retrieve the request" :> ("auth" :> ("cli" :> ("authorization" :> ("request" :> (Capture "browserToken" Text :> ("confirm" :> (auth :> Post '[JSON] NoContent))))))))) -> (f :- (Summary "List the CLI tokens associated with the current account." :> ("auth" :> ("cli" :> ("tokens" :> (auth :> Get '[JSON] CLITokensResponse)))))) -> (f :- (Summary "Permanently disallow the use of a CLI token." :> ("auth" :> ("cli" :> ("tokens" :> (Capture "cliTokenId" (Id "CLIToken") :> ("revoke" :> (auth :> Post '[JSON] NoContent)))))))) -> (f :- (Summary "Retrieve installation status after redirect from external source site settings." :> ("sites" :> (Capture "forgeId" (Id Forge) :> ("installation" :> (Capture "installationId" Int :> ("status" :> (auth :> Get '[JSON] AccountInstallationStatus)))))))) -> AccountsAPI auth f
- Hercules.API.Accounts: [accountByName] :: AccountsAPI auth f -> f :- Substitute ("site" :> (Capture "site" (Name SourceHostingSite) :> ("account" :> (Capture "account" (Name Account) :> Placeholder)))) (ToServantApi (AccountResourceGroup auth))
+ Hercules.API.Accounts: [accountByName] :: AccountsAPI auth f -> f :- Substitute ("site" :> (Capture "site" (Name Forge) :> ("account" :> (Capture "account" (Name Account) :> Placeholder)))) (ToServantApi (AccountResourceGroup auth))
- Hercules.API.Accounts: [findAccounts] :: AccountsAPI auth f -> f :- (Summary "Accounts that the authenticated user owns, admins or collaborates with." :> ("accounts" :> (QueryParam "site" (Name SourceHostingSite) :> (QueryParam "name" (Name Account) :> (auth :> Get '[JSON] [Account])))))
+ Hercules.API.Accounts: [findAccounts] :: AccountsAPI auth f -> f :- (Summary "Accounts that the authenticated user owns, admins or collaborates with." :> ("accounts" :> (QueryParam "site" (Name Forge) :> (QueryParam "name" (Name Account) :> (auth :> Get '[JSON] [Account])))))
- Hercules.API.Accounts: [installationStatus] :: AccountsAPI auth f -> f :- (Summary "Retrieve installation status after redirect from external source site settings." :> ("sites" :> (Capture "siteId" (Id SourceHostingSite) :> ("installation" :> (Capture "installationId" Int :> ("status" :> (auth :> Get '[JSON] AccountInstallationStatus)))))))
+ Hercules.API.Accounts: [installationStatus] :: AccountsAPI auth f -> f :- (Summary "Retrieve installation status after redirect from external source site settings." :> ("sites" :> (Capture "forgeId" (Id Forge) :> ("installation" :> (Capture "installationId" Int :> ("status" :> (auth :> Get '[JSON] AccountInstallationStatus)))))))
- Hercules.API.Accounts.Account: Account :: Id Account -> Text -> Text -> AccountType -> Text -> Text -> Maybe Organization -> Bool -> Bool -> Maybe MembershipRole -> Maybe (Map Text SourceHostingSite) -> Maybe Text -> Maybe Bool -> Account
+ Hercules.API.Accounts.Account: Account :: Id Account -> Text -> Text -> AccountType -> Text -> Text -> Maybe Organization -> Bool -> Bool -> Maybe MembershipRole -> Maybe (Map Text Forge) -> Maybe Text -> Maybe Bool -> Account
- Hercules.API.Accounts.Account: [sourceHostingSites] :: Account -> Maybe (Map Text SourceHostingSite)
+ Hercules.API.Accounts.Account: [sourceHostingSites] :: Account -> Maybe (Map Text Forge)
- Hercules.API.Accounts.AccountInstallationStatus: AccountInstallationStatus :: SourceHostingSite -> Maybe Account -> Bool -> Maybe Int -> AccountInstallationStatus
+ Hercules.API.Accounts.AccountInstallationStatus: AccountInstallationStatus :: Forge -> Maybe Account -> Bool -> Maybe Int -> AccountInstallationStatus
- Hercules.API.Accounts.AccountInstallationStatus: [site] :: AccountInstallationStatus -> SourceHostingSite
+ Hercules.API.Accounts.AccountInstallationStatus: [site] :: AccountInstallationStatus -> Forge
- Hercules.API.Accounts.NotificationSettings: AuthorizedEmail :: Text -> Bool -> Maybe SimpleSite -> AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: AuthorizedEmail :: Text -> Bool -> Maybe SimpleForge -> AuthorizedEmail
- Hercules.API.Accounts.NotificationSettings: [source] :: AuthorizedEmail -> Maybe SimpleSite
+ Hercules.API.Accounts.NotificationSettings: [source] :: AuthorizedEmail -> Maybe SimpleForge
- Hercules.API.Accounts.SimpleAccount: SimpleAccount :: Id Account -> Name Account -> Text -> AccountType -> Text -> SimpleSite -> SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: SimpleAccount :: Id Account -> Name Account -> Text -> AccountType -> Text -> SimpleForge -> SimpleAccount
- Hercules.API.Accounts.SimpleAccount: [site] :: SimpleAccount -> SimpleSite
+ Hercules.API.Accounts.SimpleAccount: [site] :: SimpleAccount -> SimpleForge
- Hercules.API.Agents.AgentSession: AgentSession :: Id AgentSession -> Id ClusterJoinToken -> Text -> Text -> Text -> Text -> [Text] -> [Text] -> [Text] -> [Text] -> UTCTime -> Maybe UTCTime -> Bool -> Labels -> AgentSession
+ Hercules.API.Agents.AgentSession: AgentSession :: Id AgentSession -> Id ClusterJoinToken -> Text -> Text -> Text -> Text -> [Text] -> [Text] -> [Text] -> [Text] -> [Text] -> UTCTime -> Maybe UTCTime -> Bool -> Int -> Labels -> AgentSession
- Hercules.API.Auth: AuthAPI :: (f :- ("api" :> ("auth" :> ("github" :> (QueryParam' '[Optional, Strict] "redirect" Text :> Get302 '[PlainText, JSON] '[]))))) -> (f :- ("api" :> ("auth" :> ("sign-out" :> (auth :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie] NoContent)))))) -> AuthAPI auth f
+ Hercules.API.Auth: AuthAPI :: (f :- ("api" :> ("auth" :> ("github" :> (QueryParam' '[Optional, Strict] "redirect" Text :> Get302 '[PlainText, JSON] '[]))))) -> (f :- (Summary "Terminate the session and help clear the cookies." :> ("api" :> ("auth" :> ("sign-out" :> (auth :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie] NoContent))))))) -> (f :- (Summary "Initiate an OAuth login, redirecting the client to a URL at the OAuth provider." :> ("api" :> ("auth" :> (Capture "type" Text :> ("start" :> (Capture "forgeId" (Id Forge) :> (QueryParam' '[Optional, Strict] "redirect" Text :> (auth :> Get302 '[PlainText, JSON] '[]))))))))) -> (f :- OAuthReturn Required (auth :> Get302 '[PlainText, JSON] '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie])) -> AuthAPI auth f
- Hercules.API.Auth: [signOut] :: AuthAPI auth f -> f :- ("api" :> ("auth" :> ("sign-out" :> (auth :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie] NoContent)))))
+ Hercules.API.Auth: [signOut] :: AuthAPI auth f -> f :- (Summary "Terminate the session and help clear the cookies." :> ("api" :> ("auth" :> ("sign-out" :> (auth :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie] NoContent))))))
- Hercules.API.Build: BuildAPI :: (f :- (Summary "Restart a derivation" :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("retry" :> (auth :> Post '[PlainText, JSON] NoContent)))))))) -> (f :- (Summary "Read a derivation build log" :> (Description "This interface may change." :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("log" :> (QueryParam "logId" (Id "log") :> (auth :> Get '[PlainText, JSON] Text)))))))))) -> (f :- (Summary "Read all recorded log entries" :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("log" :> ("lines" :> (QueryParam' '[Required] "logId" (Id "log") :> (QueryParam' '[Optional] "iMin" Int :> (auth :> Get '[JSON] Log))))))))))) -> (f :- (Summary "Get information about a derivation." :> (Description "Optionally, a job id can be specified to provide context." :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> (QueryParam' '[Optional, Strict] "via-job" (Id Job) :> (auth :> Get '[JSON] DerivationInfo))))))))) -> BuildAPI auth f
+ Hercules.API.Build: BuildAPI :: (f :- (Summary "Restart a derivation" :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("retry" :> (auth :> Post '[PlainText, JSON] NoContent)))))))) -> (f :- (Summary "Cancel a derivation" :> (Description "If running, the build or push process will be killed. It will not be restarted, unless a rebuild is requested, or when output contents are required during evaluation (import from derivation)." :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("cancel" :> (auth :> Post '[PlainText, JSON] NoContent))))))))) -> (f :- (Summary "Read a derivation build log" :> (Description "This interface may change." :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("log" :> (QueryParam "logId" (Id "log") :> (auth :> Get '[PlainText, JSON] Text)))))))))) -> (f :- (Summary "Read all recorded log entries" :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> ("log" :> ("lines" :> (QueryParam' '[Required] "logId" (Id "log") :> (QueryParam' '[Optional] "iMin" Int :> (auth :> Get '[JSON] Log))))))))))) -> (f :- (Summary "Get information about a derivation." :> (Description "Optionally, a job id can be specified to provide context." :> ("accounts" :> (Capture "accountId" (Id Account) :> ("derivations" :> (Capture "derivationPath" Text :> (QueryParam' '[Optional, Strict] "via-job" (Id Job) :> (auth :> Get '[JSON] DerivationInfo))))))))) -> BuildAPI auth f
- Hercules.API.Build.DerivationInfo: DerivationInfo :: DerivationStatus -> Maybe Job -> Maybe Project -> Text -> [Text] -> [DerivationInput] -> [DerivationOutput] -> [Project] -> [[DerivationEvent]] -> Bool -> Maybe DerivationEvent -> DerivationInfo
+ Hercules.API.Build.DerivationInfo: DerivationInfo :: DerivationStatus -> Maybe Job -> Maybe Project -> Text -> [Text] -> [DerivationInput] -> [DerivationOutput] -> [Project] -> [[DerivationEvent]] -> Bool -> Bool -> Maybe DerivationEvent -> DerivationInfo
- Hercules.API.Build.EvaluationDetail: EvaluationDetail :: Id Evaluation -> Text -> Text -> [Message] -> [Attribute (Result AttributeError Derivation)] -> [EvaluationDependency] -> Maybe (Id "log") -> Map Text DerivationStatus -> Int -> Int -> Int -> Int -> Int -> Int -> [AgentRequirements] -> EvaluationDetail
+ Hercules.API.Build.EvaluationDetail: EvaluationDetail :: Id Evaluation -> Text -> Text -> [Message] -> [Attribute (Result AttributeError Derivation)] -> [IFDAttribute] -> [EvaluationDependency] -> Maybe (Id "log") -> Map Text DerivationStatus -> Int -> Int -> Int -> Int -> Int -> Int -> [AgentRequirements] -> EvaluationDetail
- Hercules.API.Effects.EffectInfo: EffectInfo :: EffectStatus -> Id Job -> Id Project -> Text -> [Text] -> [DerivationInput] -> [[EffectEvent]] -> Bool -> Maybe EffectEvent -> EffectInfo
+ Hercules.API.Effects.EffectInfo: EffectInfo :: EffectStatus -> Id Job -> Id Project -> Text -> [Text] -> [DerivationInput] -> [[EffectEvent]] -> [EffectReference] -> [SimpleJob] -> Bool -> Maybe EffectEvent -> EffectInfo
- Hercules.API.Evaluation.AttributeError: AttributeError :: Text -> Maybe Text -> Maybe Text -> AttributeError
+ Hercules.API.Evaluation.AttributeError: AttributeError :: Text -> Maybe Text -> Maybe Text -> Maybe Text -> AttributeError
- Hercules.API.Projects: ProjectResourceGroup :: (f :- (Summary "Retrieve information about jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> (QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job) :> (auth :> Get '[JSON] PagedJobs))))))) -> (f :- (Summary "Get source information from the latest successful job/jobs satisfying the provided requirements." :> (Description "The job parameter can be omitted to require all jobs for a commit to succeed. This can have the unexpected effect of reverting when a change in the extraInputs causes a regression. So it is recommended to specify one or more jobs. Common examples are \"onPush.default\" for a pinned build or \"onPush.ci\" for a build using extraInputs to integrate continuously." :> ("source" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch. Defaults to HEAD."] "ref" Text :> (QueryParams "jobs" Text :> (auth :> Get '[JSON] ImmutableGitInput))))))) -> ProjectResourceGroup auth f
+ Hercules.API.Projects: ProjectResourceGroup :: (f :- (Summary "Retrieve a project" :> (auth :> Get '[JSON] Project))) -> (f :- (Summary "Retrieve information about jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> (QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job) :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided index in the response order."] "offsetIndex" Int64 :> (QueryParam' '[Optional, Description "Return at most n jobs."] "limit" Int64 :> (auth :> GetJsonWithPreflight PagedJobs))))))))) -> (f :- (Summary "Get source information from the latest successful job/jobs satisfying the provided requirements." :> (Description "The job parameter can be omitted to require all jobs for a commit to succeed. This can have the unexpected effect of reverting when a change in the extraInputs causes a regression. So it is recommended to specify one or more jobs. Common examples are \"onPush.default\" for a pinned build or \"onPush.ci\" for a build using extraInputs to integrate continuously." :> ("source" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch. Defaults to HEAD."] "ref" Text :> (QueryParams "jobs" Text :> (auth :> Get '[JSON] ImmutableGitInput))))))) -> ProjectResourceGroup auth f
- Hercules.API.Projects: ProjectsAPI :: (f :- Substitute ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> Placeholder)) (ToServantApi (ProjectResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectResourceGroup auth))) -> (f :- (Summary "List all projects owned by an account." :> ("accounts" :> (Capture' '[Required, Strict] "accountId" (Id Account) :> ("projects" :> (auth :> Get '[JSON] [Project])))))) -> (f :- (Summary "Find projects" :> ("projects" :> (QueryParam' '[Optional] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional] "account" (Name Account) :> (QueryParam' '[Optional] "project" (Name Project) :> (auth :> Get '[JSON] [Project]))))))) -> (f :- (Summary "Create a new project." :> ("projects" :> (auth :> (ReqBody '[JSON] CreateProject :> Post '[JSON] (Id Project)))))) -> (f :- (Summary "Modify a project" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (ReqBody '[JSON] PatchProject :> (auth :> Patch '[JSON] Project)))))) -> (f :- (Summary "Create a token for local effect execution" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (auth :> ("create-user-effect-token" :> Post '[JSON] CreateUserEffectTokenResponse)))))) -> (f :- (Summary "Find jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> (QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> (QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> (QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> (auth :> Get '[JSON] [ProjectAndJobs]))))))))) -> (f :- (Summary "List all attributes in a job" :> (Description "A list of all attributes that have been produced as part of the evaluation of a job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> (auth :> Get '[JSON] EvaluationDetail))))))) -> (f :- (Summary "Find all failures in an evaluation's derivations" :> (Description "Returns all derivations that have failures in their dependency closures." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("derivations" :> ("failed" :> (auth :> Get '[JSON] Graph)))))))) -> (f :- (Summary "Create a new job like this job" :> (Description "The newly created job will be in the same project, have the same inputs but a new evaluation.\ \ The response has the newly created job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("rerun" :> (QueryParam "rebuildFailures" Bool :> (auth :> Post '[JSON] Job)))))))) -> (f :- (Summary "Cancel the job and any work that becomes redundant" :> (Description "Some derivations may keep going, if referenced by active jobs." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("cancel" :> (auth :> Post '[JSON] NoContent))))))) -> (f :- (Summary "Read all recorded evaluation log entries" :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> ("log" :> ("lines" :> (QueryParam' '[Required] "logId" (Id "log") :> (QueryParam' '[Optional] "iMin" Int :> (auth :> Get '[JSON] Log)))))))))) -> ProjectsAPI auth f
+ Hercules.API.Projects: ProjectsAPI :: (f :- Substitute ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> Placeholder)) (ToServantApi (ProjectResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name Forge) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectResourceGroup auth))) -> (f :- (Summary "List all projects owned by an account." :> ("accounts" :> (Capture' '[Required, Strict] "accountId" (Id Account) :> ("projects" :> (auth :> Get '[JSON] [Project])))))) -> (f :- (Summary "Find projects" :> ("projects" :> (QueryParam' '[Optional] "site" (Name Forge) :> (QueryParam' '[Optional] "account" (Name Account) :> (QueryParam' '[Optional] "project" (Name Project) :> (auth :> Get '[JSON] [Project]))))))) -> (f :- (Summary "Create a new project." :> ("projects" :> (auth :> (ReqBody '[JSON] CreateProject :> Post '[JSON] (Id Project)))))) -> (f :- (Summary "Modify a project" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (ReqBody '[JSON] PatchProject :> (auth :> Patch '[JSON] Project)))))) -> (f :- (Summary "Create a token for local effect execution" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (auth :> ("create-user-effect-token" :> Post '[JSON] CreateUserEffectTokenResponse)))))) -> (f :- (Summary "Find jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name Forge) :> (QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> (QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> (QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> (QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> (auth :> Get '[JSON] [ProjectAndJobs]))))))))) -> (f :- (Summary "Get a job's handler declarations, if any." :> (Description "Handlers define what to build and do on events such as onPush, onSchedule." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("handlers" :> (auth :> Get '[JSON] JobHandlers))))))) -> (f :- (Summary "List all attributes in a job" :> (Description "A list of all attributes that have been produced as part of the evaluation of a job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> (auth :> GetJsonWithPreflight EvaluationDetail))))))) -> (f :- (Summary "Find all failures in an evaluation's derivations" :> (Description "Returns all derivations that have failures in their dependency closures." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("derivations" :> ("failed" :> (auth :> Get '[JSON] Graph)))))))) -> (f :- (Summary "Create a new job like this job" :> (Description "The newly created job will be in the same project, have the same inputs but a new evaluation.\ \ The response has the newly created job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("rerun" :> (QueryParam "rebuildFailures" Bool :> (auth :> Post '[JSON] Job)))))))) -> (f :- (Summary "Create a scheduled job to run now, based on a configuration job." :> (Description "This is mostly intended for trying out new scheduled jobs before they are merged. The job is run in the context of the job's branch; not that of the default branch." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("on-schedule" :> (Capture' '[Required, Strict] "jobName" Text :> ("run" :> (auth :> Post '[JSON] Job))))))))) -> (f :- (Summary "Cancel the job and any work that becomes redundant" :> (Description "Some derivations may keep going, if referenced by active jobs." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("cancel" :> (auth :> Post '[JSON] NoContent))))))) -> (f :- (Summary "Read all recorded evaluation log entries" :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> ("log" :> ("lines" :> (QueryParam' '[Required] "logId" (Id "log") :> (QueryParam' '[Optional] "iMin" Int :> (auth :> Get '[JSON] Log)))))))))) -> ProjectsAPI auth f
- Hercules.API.Projects: [byProjectName] :: ProjectsAPI auth f -> f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectResourceGroup auth))
+ Hercules.API.Projects: [byProjectName] :: ProjectsAPI auth f -> f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name Forge) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectResourceGroup auth))
- Hercules.API.Projects: [findJobs] :: ProjectsAPI auth f -> f :- (Summary "Find jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> (QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> (QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> (QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> (auth :> Get '[JSON] [ProjectAndJobs]))))))))
+ Hercules.API.Projects: [findJobs] :: ProjectsAPI auth f -> f :- (Summary "Find jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name Forge) :> (QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> (QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> (QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> (QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> (auth :> Get '[JSON] [ProjectAndJobs]))))))))
- Hercules.API.Projects: [findProjects] :: ProjectsAPI auth f -> f :- (Summary "Find projects" :> ("projects" :> (QueryParam' '[Optional] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional] "account" (Name Account) :> (QueryParam' '[Optional] "project" (Name Project) :> (auth :> Get '[JSON] [Project]))))))
+ Hercules.API.Projects: [findProjects] :: ProjectsAPI auth f -> f :- (Summary "Find projects" :> ("projects" :> (QueryParam' '[Optional] "site" (Name Forge) :> (QueryParam' '[Optional] "account" (Name Account) :> (QueryParam' '[Optional] "project" (Name Project) :> (auth :> Get '[JSON] [Project]))))))
- Hercules.API.Projects: [getJobs] :: ProjectResourceGroup auth f -> f :- (Summary "Retrieve information about jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> (QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job) :> (auth :> Get '[JSON] PagedJobs))))))
+ Hercules.API.Projects: [getJobs] :: ProjectResourceGroup auth f -> f :- (Summary "Retrieve information about jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> (QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job) :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided index in the response order."] "offsetIndex" Int64 :> (QueryParam' '[Optional, Description "Return at most n jobs."] "limit" Int64 :> (auth :> GetJsonWithPreflight PagedJobs))))))))
- Hercules.API.Projects: [projectJobEvaluation] :: ProjectsAPI auth f -> f :- (Summary "List all attributes in a job" :> (Description "A list of all attributes that have been produced as part of the evaluation of a job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> (auth :> Get '[JSON] EvaluationDetail))))))
+ Hercules.API.Projects: [projectJobEvaluation] :: ProjectsAPI auth f -> f :- (Summary "List all attributes in a job" :> (Description "A list of all attributes that have been produced as part of the evaluation of a job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> (auth :> GetJsonWithPreflight EvaluationDetail))))))
- Hercules.API.Projects.Project: Project :: Id Project -> Id Account -> Id Repo -> Bool -> Name SourceHostingSite -> Name Account -> Name Project -> Text -> Maybe Text -> Bool -> Project
+ Hercules.API.Projects.Project: Project :: Id Project -> SimpleAccount -> Id Account -> Id Repo -> Bool -> Name Forge -> Name Account -> Name Project -> Name Project -> Text -> Maybe Text -> Bool -> Project
- Hercules.API.Projects.Project: [siteSlug] :: Project -> Name SourceHostingSite
+ Hercules.API.Projects.Project: [siteSlug] :: Project -> Name Forge
- Hercules.API.State: StateAPI :: (f :- Substitute ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> Placeholder)) (ToServantApi (ProjectStateResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectStateResourceGroup auth))) -> (f :- ("lock-leases" :> (Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease") :> (ReqBody '[JSON] StateLockUpdateRequest :> (auth :> Post '[JSON] StateLockAcquiredResponse))))) -> (f :- ("lock-leases" :> (Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease") :> (auth :> Delete '[JSON] NoContent)))) -> StateAPI auth f
+ Hercules.API.State: StateAPI :: (f :- Substitute ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> Placeholder)) (ToServantApi (ProjectStateResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name Forge) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectStateResourceGroup auth))) -> (f :- ("lock-leases" :> (Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease") :> (ReqBody '[JSON] StateLockUpdateRequest :> (auth :> Post '[JSON] StateLockAcquiredResponse))))) -> (f :- ("lock-leases" :> (Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease") :> (auth :> Delete '[JSON] NoContent)))) -> StateAPI auth f
- Hercules.API.State: [byProjectName] :: StateAPI auth f -> f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectStateResourceGroup auth))
+ Hercules.API.State: [byProjectName] :: StateAPI auth f -> f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name Forge) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectStateResourceGroup auth))
- Hercules.Frontend: FrontendRoutes :: (f :- view) -> (f :- (Capture' [Required, Strict] "site" (Name SourceHostingSite) :> (Capture' [Required, Strict] "account" (Name Account) :> view))) -> (f :- ("settings" :> ("cli" :> ("authorize" :> (QueryParam' [Required, Strict] "token" Text :> view))))) -> (f :- (Capture' [Required, Strict] "site" (Name SourceHostingSite) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> view)))) -> (f :- (Capture' [Required, Strict] "site" (Name SourceHostingSite) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> ("jobs" :> (Capture' [Required, Strict] "jobIndex" Int :> view)))))) -> (f :- ("settings" :> ("notifications" :> view))) -> FrontendRoutes view f
+ Hercules.Frontend: FrontendRoutes :: (f :- view) -> (f :- (Capture' [Required, Strict] "site" (Name Forge) :> (Capture' [Required, Strict] "account" (Name Account) :> view))) -> (f :- ("settings" :> ("cli" :> ("authorize" :> (QueryParam' [Required, Strict] "token" Text :> view))))) -> (f :- (Capture' [Required, Strict] "site" (Name Forge) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> view)))) -> (f :- (Capture' [Required, Strict] "site" (Name Forge) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> ("jobs" :> (Capture' [Required, Strict] "jobIndex" Int :> view)))))) -> ToServant (AuthRoutes view) f -> (f :- ("settings" :> ("notifications" :> view))) -> FrontendRoutes view f
- Hercules.Frontend: [account] :: FrontendRoutes view f -> f :- (Capture' [Required, Strict] "site" (Name SourceHostingSite) :> (Capture' [Required, Strict] "account" (Name Account) :> view))
+ Hercules.Frontend: [account] :: FrontendRoutes view f -> f :- (Capture' [Required, Strict] "site" (Name Forge) :> (Capture' [Required, Strict] "account" (Name Account) :> view))
- Hercules.Frontend: [job] :: FrontendRoutes view f -> f :- (Capture' [Required, Strict] "site" (Name SourceHostingSite) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> ("jobs" :> (Capture' [Required, Strict] "jobIndex" Int :> view)))))
+ Hercules.Frontend: [job] :: FrontendRoutes view f -> f :- (Capture' [Required, Strict] "site" (Name Forge) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> ("jobs" :> (Capture' [Required, Strict] "jobIndex" Int :> view)))))
- Hercules.Frontend: [project] :: FrontendRoutes view f -> f :- (Capture' [Required, Strict] "site" (Name SourceHostingSite) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> view)))
+ Hercules.Frontend: [project] :: FrontendRoutes view f -> f :- (Capture' [Required, Strict] "site" (Name Forge) :> (Capture' [Required, Strict] "account" (Name Account) :> (Capture' [Required, Strict] "project" (Name Project) :> view)))
Files
- CHANGELOG.md +13/−0
- Setup.hs +0/−3
- hercules-ci-api.cabal +82/−51
- src/Hercules/API.hs +30/−3
- src/Hercules/API/Accounts.hs +4/−6
- src/Hercules/API/Accounts/Account.hs +2/−2
- src/Hercules/API/Accounts/AccountInstallationStatus.hs +2/−2
- src/Hercules/API/Accounts/NotificationSettings.hs +2/−2
- src/Hercules/API/Accounts/SimpleAccount.hs +2/−2
- src/Hercules/API/Agents/AgentSession.hs +2/−0
- src/Hercules/API/Attribute.hs +71/−4
- src/Hercules/API/Auth.hs +41/−2
- src/Hercules/API/BillingStatus.hs +3/−0
- src/Hercules/API/Build.hs +11/−0
- src/Hercules/API/Build/DerivationEvent.hs +19/−10
- src/Hercules/API/Build/DerivationInfo.hs +1/−0
- src/Hercules/API/Build/EvaluationDetail.hs +4/−0
- src/Hercules/API/ClientInfo.hs +17/−0
- src/Hercules/API/ClientInfo/ClientInfo.hs +17/−0
- src/Hercules/API/Effects.hs +2/−1
- src/Hercules/API/Effects/EffectInfo.hs +4/−0
- src/Hercules/API/Effects/EffectReference.hs +12/−0
- src/Hercules/API/Error.hs +16/−0
- src/Hercules/API/Evaluation/AttributeError.hs +2/−1
- src/Hercules/API/Forge.hs +39/−0
- src/Hercules/API/Forge/Forge.hs +18/−0
- src/Hercules/API/Forge/SimpleForge.hs +13/−0
- src/Hercules/API/GitLab.hs +65/−0
- src/Hercules/API/GitLab/CreateInstallationBuilderRequest.hs +12/−0
- src/Hercules/API/GitLab/CreateInstallationBuilderResponse.hs +12/−0
- src/Hercules/API/GitLab/InstallationBuilder.hs +22/−0
- src/Hercules/API/GitLab/PatchInstallationBuilder.hs +11/−0
- src/Hercules/API/Projects.hs +52/−9
- src/Hercules/API/Projects/Job.hs +1/−0
- src/Hercules/API/Projects/JobHandlers.hs +18/−0
- src/Hercules/API/Projects/JobHandlers/OnPushHandler.hs +14/−0
- src/Hercules/API/Projects/JobHandlers/OnScheduleHandler.hs +26/−0
- src/Hercules/API/Projects/LegacySimpleJob.hs +18/−0
- src/Hercules/API/Projects/Project.hs +5/−4
- src/Hercules/API/SourceHostingSite/SimpleSite.hs +0/−13
- src/Hercules/API/SourceHostingSite/SourceHostingSite.hs +0/−15
- src/Hercules/API/State.hs +2/−2
- src/Hercules/Frontend.hs +8/−6
- test/Hercules/API/AttributeSpec.hs +30/−0
- test/Main.hs +10/−0
- test/Spec.hs +11/−0
CHANGELOG.md view
@@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.8.0.0 - 2023-03-06++### Changed++ - `SourceHostingSite` was renamed to `Forge`++### Added++ - GitLab endpoints+ - `onSchedule` information+ - Various small additions++ ## 0.7.2.1 - 2022-12-29 Maintenance and tooling update.
− Setup.hs
@@ -1,3 +0,0 @@-import Distribution.Simple--main = defaultMain
hercules-ci-api.cabal view
@@ -1,6 +1,6 @@-cabal-version: 1.12+cabal-version: 2.2 name: hercules-ci-api-version: 0.7.2.1+version: 0.8.0.0 synopsis: Hercules CI API definition with Servant homepage: https://github.com/hercules-ci/hercules-ci-agent#readme bug-reports: https://github.com/hercules-ci/hercules-ci-agent/issues@@ -15,7 +15,32 @@ type: git location: https://github.com/hercules-ci/hercules-ci +common defaults+ default-language: Haskell2010+ default-extensions:+ NoImplicitPrelude+ DeriveGeneric+ DeriveTraversable+ DisambiguateRecordFields+ FlexibleContexts+ InstanceSigs+ LambdaCase+ MultiParamTypeClasses+ OverloadedStrings+ RankNTypes+ TupleSections+ TypeApplications+ TypeOperators++ ghc-options:+ -Wall -fwarn-tabs -fwarn-unused-imports -fwarn-missing-signatures+ -fwarn-name-shadowing -fwarn-incomplete-patterns++common defaults-exe+ ghc-options: -threaded -rtsopts -with-rtsopts=-N+ library+ import: defaults exposed-modules: Hercules.API Hercules.API.Accounts@@ -53,12 +78,24 @@ Hercules.API.Build.FailureGraph Hercules.API.Build.Log Hercules.API.Build.LogLine+ Hercules.API.ClientInfo+ Hercules.API.ClientInfo.ClientInfo Hercules.API.Derivation Hercules.API.Effects Hercules.API.Effects.EffectEvent Hercules.API.Effects.EffectInfo+ Hercules.API.Effects.EffectReference+ Hercules.API.Error Hercules.API.Evaluation.AttributeError Hercules.API.Evaluation.Evaluation+ Hercules.API.Forge+ Hercules.API.Forge.Forge+ Hercules.API.Forge.SimpleForge+ Hercules.API.GitLab+ Hercules.API.GitLab.CreateInstallationBuilderRequest+ Hercules.API.GitLab.CreateInstallationBuilderResponse+ Hercules.API.GitLab.InstallationBuilder+ Hercules.API.GitLab.PatchInstallationBuilder Hercules.API.Health Hercules.API.Inputs.ImmutableGitInput Hercules.API.Inputs.ImmutableInput@@ -75,6 +112,10 @@ Hercules.API.Projects.CreateProject Hercules.API.Projects.CreateUserEffectTokenResponse Hercules.API.Projects.Job+ Hercules.API.Projects.JobHandlers+ Hercules.API.Projects.JobHandlers.OnPushHandler+ Hercules.API.Projects.JobHandlers.OnScheduleHandler+ Hercules.API.Projects.LegacySimpleJob Hercules.API.Projects.PatchProject Hercules.API.Projects.Project Hercules.API.Projects.SimpleJob@@ -85,8 +126,6 @@ Hercules.API.Repos.SimpleRepo Hercules.API.Result Hercules.API.Servant.Status- Hercules.API.SourceHostingSite.SimpleSite- Hercules.API.SourceHostingSite.SourceHostingSite Hercules.API.State Hercules.API.State.ProjectState Hercules.API.State.StateFile@@ -97,28 +136,9 @@ Hercules.API.State.StateVersion Hercules.Frontend - hs-source-dirs: src- default-extensions:- NoImplicitPrelude- DeriveGeneric- DeriveTraversable- DisambiguateRecordFields- FlexibleContexts- InstanceSigs- LambdaCase- MultiParamTypeClasses- OverloadedStrings- RankNTypes- TupleSections- TypeApplications- TypeOperators-- ghc-options:- -Wall -fwarn-tabs -fwarn-unused-imports -fwarn-missing-signatures- -fwarn-name-shadowing -fwarn-incomplete-patterns-+ hs-source-dirs: src build-depends:- aeson >= 2+ , aeson >=2 , base >=4.7 && <5 , bytestring , containers@@ -144,33 +164,12 @@ , time , uuid - default-language: Haskell2010- executable hercules-gen-swagger- main-is: Main.hs- hs-source-dirs: hercules-gen-swagger- default-extensions:- NoImplicitPrelude- DeriveGeneric- DeriveTraversable- DisambiguateRecordFields- FlexibleContexts- InstanceSigs- LambdaCase- MultiParamTypeClasses- OverloadedStrings- RankNTypes- TupleSections- TypeApplications- TypeOperators-- ghc-options:- -Wall -fwarn-tabs -fwarn-unused-imports -fwarn-missing-signatures- -fwarn-name-shadowing -fwarn-incomplete-patterns -threaded -rtsopts- -with-rtsopts=-N-+ import: defaults, defaults-exe+ main-is: Main.hs+ hs-source-dirs: hercules-gen-swagger build-depends:- aeson+ , aeson , base >=4.7 && <5 , bytestring , containers@@ -195,4 +194,36 @@ , time , uuid - default-language: Haskell2010+test-suite hercules-ci-api-unit-tests+ import: defaults, defaults-exe+ type: exitcode-stdio-1.0+ main-is: Main.hs+ other-modules:+ Hercules.API.AttributeSpec+ Spec++ hs-source-dirs: test+ build-depends:+ , aeson+ , base+ , bytestring+ , containers+ , exceptions+ , hashable+ , hercules-ci-api+ , hercules-ci-api-core+ , hspec+ , http-api-data+ , http-media+ , protolude+ , QuickCheck+ , quickcheck-classes+ , servant >=0.14.1+ , servant-auth+ , string-conv+ , text+ , time+ , uuid+ , vector++ default-language: Haskell2010
src/Hercules/API.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-}+{-# OPTIONS_GHC -O0 #-} module Hercules.API ( api,@@ -36,7 +37,10 @@ import Hercules.API.Build as Client ( BuildAPI, )+import Hercules.API.ClientInfo (ClientInfoAPI) import Hercules.API.Effects (EffectsAPI)+import Hercules.API.Forge (ForgeAPI)+import Hercules.API.GitLab (GitLabAPI) import Hercules.API.Health (HealthAPI) import Hercules.API.Organizations (OrganizationsAPI) import Hercules.API.Orphans ()@@ -55,6 +59,8 @@ -- TODO remove health so we get clientapi data HerculesAPI auth f = HerculesAPI { accounts :: f :- ToServantApi (AccountsAPI auth),+ clientInfo :: f :- ToServantApi (ClientInfoAPI auth),+ forges :: f :- ToServantApi (ForgeAPI auth), repos :: f :- ToServantApi (ReposAPI auth), projects :: f :- ToServantApi (ProjectsAPI auth), agents :: f :- ToServantApi (AgentsAPI auth),@@ -62,19 +68,23 @@ effects :: f :- ToServantApi (EffectsAPI auth), health :: f :- ToServantApi (HealthAPI auth), organizations :: f :- ToServantApi (OrganizationsAPI auth),- state :: f :- ToServantApi (StateAPI auth)+ state :: f :- ToServantApi (StateAPI auth),+ gitlab :: f :- ToServantApi (GitLabAPI auth) } deriving (Generic) data ClientAPI auth f = ClientAPI { clientAccounts :: f :- ToServantApi (AccountsAPI auth),+ clientClientInfo :: f :- ToServantApi (ClientInfoAPI auth),+ clientForges :: f :- ToServantApi (ForgeAPI auth), clientRepos :: f :- ToServantApi (ReposAPI auth), clientProjects :: f :- ToServantApi (ProjectsAPI auth), clientAgents :: f :- ToServantApi (AgentsAPI auth), clientBuild :: f :- ToServantApi (Client.BuildAPI auth), clientEffects :: f :- ToServantApi (EffectsAPI auth), clientOrganizations :: f :- ToServantApi (OrganizationsAPI auth),- clientState :: f :- ToServantApi (StateAPI auth)+ clientState :: f :- ToServantApi (StateAPI auth),+ clientGitLab :: f :- ToServantApi (GitLabAPI auth) } deriving (Generic) @@ -102,7 +112,7 @@ swagger :: Swagger swagger =- toSwagger (servantClientApi @(Auth '[JWT] ()))+ toSwagger api' & info . title .~ "Hercules CI API"@@ -112,6 +122,23 @@ & info . description ?~ "You have reached the Hercules Continuous Integration Application Programming Interface. This user interface provides human friendly access to the various endpoints. To get started with Hercules CI, see hercules-ci.com. Happy building! —the Hercules team"+ & withTags clientProjects "project" "Project and job operations"+ & withTags clientBuild "build" "Build related operations"+ & withTags clientEffects "effect" "Effect related operations"+ & withTags clientState "state" "State files and locks, commonly used with effects and the hci command"+ & withTags clientForges "forge" "Forge operations"+ & withTags clientGitLab "gitlab" "GitLab-specific operations"+ & withTags clientRepos "repo" "Repository operations"+ & withTags clientAgents "agent" "Agent admin and monitoring operations"+ & withTags clientAccounts "account" "Account operations"+ & withTags clientOrganizations "organization" "Organizations and billing operations"+ & withTags clientClientInfo "client" "Ad hoc endpoints for the frontend and perhaps some client-side use cases"+ where+ api' = (servantClientApi @(Auth '[JWT] ()))+ withTags f tag desc = applyTagsFor (subOperations (clientApiProxy f) api') [tag & description ?~ desc]++clientApiProxy :: (ClientAPI (Auth '[JWT] ()) AsApi -> a) -> Proxy ("api" :> "v1" :> a)+clientApiProxy _ = Proxy -- | 'Control.Monad.void' specialised to 'NoContent' to soothe the -- compiler that rightfully warns about throwing away a do notation
src/Hercules/API/Accounts.hs view
@@ -15,10 +15,8 @@ import Hercules.API.Accounts.CLITokensResponse (CLITokensResponse) import Hercules.API.Accounts.NotificationSettings (NotificationSettings) import Hercules.API.Accounts.NotificationSettingsPatch (NotificationSettingsPatch)+import Hercules.API.Forge.Forge (Forge) import Hercules.API.Prelude hiding (id)-import Hercules.API.SourceHostingSite.SourceHostingSite- ( SourceHostingSite,- ) import Servant.API import Servant.Auth () @@ -86,7 +84,7 @@ f :- Substitute ( "site"- :> Capture "site" (Name SourceHostingSite)+ :> Capture "site" (Name Forge) :> "account" :> Capture "account" (Name Account) :> Placeholder@@ -96,7 +94,7 @@ f :- Summary "Accounts that the authenticated user owns, admins or collaborates with." :> "accounts"- :> QueryParam "site" (Name SourceHostingSite)+ :> QueryParam "site" (Name Forge) :> QueryParam "name" (Name Account) :> auth :> Get '[JSON] [Account],@@ -162,7 +160,7 @@ f :- Summary "Retrieve installation status after redirect from external source site settings." :> "sites"- :> Capture "siteId" (Id SourceHostingSite)+ :> Capture "forgeId" (Id Forge) :> "installation" :> Capture "installationId" Int :> "status"
src/Hercules/API/Accounts/Account.hs view
@@ -2,9 +2,9 @@ module Hercules.API.Accounts.Account where +import Hercules.API.Forge.Forge (Forge) import qualified Hercules.API.Organizations.Organization as Organization import Hercules.API.Prelude-import Hercules.API.SourceHostingSite.SourceHostingSite (SourceHostingSite) data AccountType = User | Organization deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)@@ -35,7 +35,7 @@ -- Hercules CI on this account. isInstallable :: Bool, membershipRole :: Maybe MembershipRole,- sourceHostingSites :: Maybe (Map Text SourceHostingSite),+ sourceHostingSites :: Maybe (Map Text Forge), manageInstallationURL :: Maybe Text, installationIsSelection :: Maybe Bool }
src/Hercules/API/Accounts/AccountInstallationStatus.hs view
@@ -3,11 +3,11 @@ module Hercules.API.Accounts.AccountInstallationStatus where import Hercules.API.Accounts.Account (Account)+import Hercules.API.Forge.Forge (Forge) import Hercules.API.Prelude-import Hercules.API.SourceHostingSite.SourceHostingSite (SourceHostingSite) data AccountInstallationStatus = AccountInstallationStatus- { site :: SourceHostingSite,+ { site :: Forge, account :: Maybe Account, isProcessingInstallationWebHook :: Bool, secondsSinceInstallationWebHookComplete :: Maybe Int
src/Hercules/API/Accounts/NotificationSettings.hs view
@@ -4,8 +4,8 @@ module Hercules.API.Accounts.NotificationSettings where import Hercules.API.Accounts.SimpleAccount (SimpleAccount)+import Hercules.API.Forge.SimpleForge (SimpleForge) import Hercules.API.Prelude-import Hercules.API.SourceHostingSite.SimpleSite (SimpleSite) data NotificationLevel = Ignore@@ -27,7 +27,7 @@ data AuthorizedEmail = AuthorizedEmail { address :: Text, isPrimary :: Bool,- source :: Maybe SimpleSite+ source :: Maybe SimpleForge } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Accounts/SimpleAccount.hs view
@@ -3,8 +3,8 @@ module Hercules.API.Accounts.SimpleAccount where import Hercules.API.Accounts.Account (Account, AccountType)+import Hercules.API.Forge.SimpleForge (SimpleForge) import Hercules.API.Prelude-import Hercules.API.SourceHostingSite.SimpleSite (SimpleSite) data SimpleAccount = SimpleAccount { id :: Id Account,@@ -12,6 +12,6 @@ displayName :: Text, typ :: AccountType, imageURL :: Text,- site :: SimpleSite+ site :: SimpleForge } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Agents/AgentSession.hs view
@@ -19,10 +19,12 @@ platforms :: [Text], systemFeatures :: [Text], cachixPushCaches :: [Text],+ pushCaches :: [Text], substituters :: [Text], creation :: UTCTime, lastSeen :: Maybe UTCTime, available :: Bool,+ concurrentTasks :: Int, labels :: Labels } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Attribute.hs view
@@ -1,12 +1,20 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE StandaloneDeriving #-} -module Hercules.API.Attribute where+module Hercules.API.Attribute+ ( AttributeType (..),+ Attribute (..),+ AttributePath (..),+ attributePathFromString,+ attributePathToString,+ )+where import Control.Applicative (Alternative ((<|>))) import Control.Lens (at, (%~)) import qualified Data.Aeson as A import Data.Aeson.Lens+import Data.Function ((&)) import Data.Proxy (Proxy (Proxy)) import Data.Swagger (ToParamSchema (..)) import qualified Data.Text as T@@ -50,8 +58,7 @@ deriving (Generic, Eq, NFData) instance FromHttpApiData AttributePath where- -- TODO parse properly- parseUrlPiece = Right . AttributePath . T.split (== '.')+ parseUrlPiece = Right . AttributePath . attributePathFromString parseQueryParam = parseUrlPiece @@ -59,4 +66,64 @@ toParamSchema _ = toParamSchema (Proxy :: Proxy Text) instance ToHttpApiData AttributePath where- toUrlPiece = toUrlPiece . T.intercalate "." . fromAttributePath+ toUrlPiece = toUrlPiece . attributePathToString . fromAttributePath++----------------------------------------++attributePathToString :: [Text] -> Text+attributePathToString l =+ l & map stringToNixIdentifier & T.intercalate "."++stringToNixIdentifier :: Text -> Text+stringToNixIdentifier s =+ if isNixSimpleId s+ then s+ else nixQuote s++isNixSimpleId :: Text -> Bool+isNixSimpleId t | T.null t = False+isNixSimpleId t+ | not+ ( let h = T.head t+ in (h >= 'a' && h <= 'z')+ || (h >= 'A' && h <= 'Z')+ || h == '_'+ ) =+ False+isNixSimpleId t =+ T.all+ ( \c ->+ (c >= 'a' && c <= 'z')+ || (c >= 'A' && c <= 'Z')+ || (c >= '0' && c <= '9')+ || c == '_'+ || c == '\''+ || c == '-'+ )+ t++nixQuote :: Text -> Text+nixQuote s =+ "\""+ <> T.replace "\"" "\\\"" (T.replace "\\" "\\\\" s)+ <> "\""++----------------------------------------++attributePathFromString :: Text -> [Text]+attributePathFromString "" = []+attributePathFromString t = t & T.unpack & attributePathFromStringImpl [] "" & reverse & fmap T.pack++attributePathFromStringImpl :: [String] -> String -> [Char] -> [String]+attributePathFromStringImpl = \accPath accAttr chars -> case chars of+ [] -> reverse accAttr : accPath+ ('.' : cs) -> attributePathFromStringImpl (reverse accAttr : accPath) "" cs+ ('\"' : cs) -> attributePathFromStringElement accPath "" cs+ (c : cs) -> attributePathFromStringImpl accPath (c : accAttr) cs++attributePathFromStringElement :: [String] -> String -> [Char] -> [String]+attributePathFromStringElement = \accPath accAttr chars -> case chars of+ ('"' : cs) -> attributePathFromStringImpl accPath accAttr cs+ ('\\' : c : cs) -> attributePathFromStringElement (accPath) (c : accAttr) cs+ [] -> reverse accAttr : accPath+ (c : cs) -> attributePathFromStringElement accPath (c : accAttr) cs
src/Hercules/API/Auth.hs view
@@ -2,11 +2,22 @@ module Hercules.API.Auth where +import Hercules.API.Forge.Forge (Forge) import Hercules.API.Prelude import Hercules.API.Servant.Status import Servant.API import Web.Cookie (SetCookie) +type OAuthReturn stage view =+ "api"+ :> "auth"+ :> "forge"+ :> Capture "forge" (Id Forge)+ :> "return"+ :> QueryParam' '[stage, Strict] "code" Text+ :> QueryParam' '[Optional, Strict] "redirect" Text+ :> view+ -- | Endpoints for authentication data AuthAPI auth f = AuthAPI { initiateGitHubLogin ::@@ -18,10 +29,38 @@ :> Get302 '[PlainText, JSON] '[], signOut :: f- :- "api"+ :- Summary "Terminate the session and help clear the cookies."+ :> "api" :> "auth" :> "sign-out" :> auth- :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie] NoContent)+ :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie] NoContent),+ start ::+ f+ :- Summary "Initiate an OAuth login, redirecting the client to a URL at the OAuth provider."+ :> "api"+ :> "auth"+ :> Capture "type" Text+ :> "start"+ :> Capture "forgeId" (Id Forge)+ :> QueryParam' '[Optional, Strict] "redirect" Text+ :> auth+ :> Get302 '[PlainText, JSON] '[],+ return ::+ f+ :- OAuthReturn+ Required+ ( auth+ :> Get302+ '[PlainText, JSON]+ '[ Header "Set-Cookie" SetCookie,+ Header "Set-Cookie" SetCookie+ ]+ )+ }+ deriving (Generic)++data AuthRoutes view f = AuthRoutes+ { authRouteReturn :: f :- OAuthReturn Optional view } deriving (Generic)
src/Hercules/API/BillingStatus.hs view
@@ -16,6 +16,7 @@ | Active | Cancelled | External+ | Enterprise deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema) toText :: BillingStatus -> Text@@ -24,6 +25,7 @@ toText Active = "Active" toText Cancelled = "Cancelled" toText External = "External"+toText Enterprise = "Enterprise" fromText :: Text -> Maybe BillingStatus fromText "Community" = Just Community@@ -31,4 +33,5 @@ fromText "Trial" = Just Trial fromText "Active" = Just Active fromText "External" = Just External+fromText "Enterprise" = Just Enterprise fromText _ = Nothing
src/Hercules/API/Build.hs view
@@ -20,6 +20,17 @@ :> "retry" :> auth :> Post '[PlainText, JSON] NoContent,+ cancelDerivation ::+ f+ :- Summary "Cancel a derivation"+ :> Description "If running, the build or push process will be killed. It will not be restarted, unless a rebuild is requested, or when output contents are required during evaluation (import from derivation)."+ :> "accounts"+ :> Capture "accountId" (Id Account)+ :> "derivations"+ :> Capture "derivationPath" Text+ :> "cancel"+ :> auth+ :> Post '[PlainText, JSON] NoContent, readDerivationLogText :: f :- Summary "Read a derivation build log"
src/Hercules/API/Build/DerivationEvent.hs view
@@ -5,6 +5,7 @@ module Hercules.API.Build.DerivationEvent where import Data.Aeson.Types (FromJSON (..), ToJSON (..), genericParseJSON, genericToEncoding, genericToJSON)+import Hercules.API.Accounts.SimpleAccount (SimpleAccount) import Hercules.API.Build.DerivationEvent.BuiltOutput import Hercules.API.Prelude import Hercules.API.Projects.SimpleJob (SimpleJob)@@ -17,6 +18,7 @@ | Failed DerivationEventFailed | Succeeded DerivationEventSucceeded | Cancelled DerivationEventCancelled+ | ForceCancelled DerivationEventForceCancelled | Built DerivationEventBuilt | HasCancelled DerivationEventHasCancelled | HasCancelledForReset DerivationEventHasCancelledForReset@@ -31,16 +33,17 @@ toEncoding = genericToEncoding schemaCompatibleOptions eventTime :: DerivationEvent -> UTCTime-eventTime (Queued DerivationEventQueued {time = t}) = t-eventTime (DependencyFailed DerivationEventDependencyFailed {time = t}) = t-eventTime (Started DerivationEventStarted {time = t}) = t-eventTime (Reset DerivationEventReset {time = t}) = t-eventTime (Failed DerivationEventFailed {time = t}) = t-eventTime (Succeeded DerivationEventSucceeded {time = t}) = t-eventTime (Cancelled DerivationEventCancelled {time = t}) = t-eventTime (Built DerivationEventBuilt {time = t}) = t-eventTime (HasCancelled DerivationEventHasCancelled {time = t}) = t-eventTime (HasCancelledForReset DerivationEventHasCancelledForReset {time = t}) = t+eventTime (Queued (DerivationEventQueued {time = t})) = t+eventTime (DependencyFailed (DerivationEventDependencyFailed {time = t})) = t+eventTime (Started (DerivationEventStarted {time = t})) = t+eventTime (Reset (DerivationEventReset {time = t})) = t+eventTime (Failed (DerivationEventFailed {time = t})) = t+eventTime (Succeeded (DerivationEventSucceeded {time = t})) = t+eventTime (Cancelled (DerivationEventCancelled {time = t})) = t+eventTime (ForceCancelled (DerivationEventForceCancelled {time = t})) = t+eventTime (Built (DerivationEventBuilt {time = t})) = t+eventTime (HasCancelled (DerivationEventHasCancelled {time = t})) = t+eventTime (HasCancelledForReset (DerivationEventHasCancelledForReset {time = t})) = t data DerivationEventQueued = DerivationEventQueued { time :: UTCTime,@@ -80,6 +83,12 @@ data DerivationEventCancelled = DerivationEventCancelled { time :: UTCTime+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data DerivationEventForceCancelled = DerivationEventForceCancelled+ { time :: UTCTime,+ byUser :: Maybe SimpleAccount } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Build/DerivationInfo.hs view
@@ -21,6 +21,7 @@ usedInProjects :: [Project], events :: [[DerivationEvent]], mayRestart :: Bool,+ mayCancel :: Bool, dummy :: Maybe DerivationEvent -- TODO: remove and update/fix codegen } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Build/EvaluationDetail.hs view
@@ -25,6 +25,7 @@ agentVersion :: Text, messages :: [Message], attributes :: [Attribute (Result AttributeError Derivation)],+ ifdAttributes :: [IFDAttribute], evaluationDependencies :: [EvaluationDependency], evaluationLog :: Maybe (Id "log"), -- | A set of (path, derivationstatus) that is relevant to the evaluation@@ -37,4 +38,7 @@ derivationsCancelledCount :: Int, unmetAgentRequirements :: [AgentRequirements] }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++newtype IFDAttribute = IFDAttribute (Attribute Derivation) deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/ClientInfo.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE DataKinds #-}++module Hercules.API.ClientInfo where++import Hercules.API.ClientInfo.ClientInfo (ClientInfo)+import Hercules.API.Prelude+import Servant.API++data ClientInfoAPI auth f = ClientInfoAPI+ { getClientInfo ::+ f+ :- "client"+ :> "info"+ :> auth+ :> Get '[JSON] ClientInfo+ }+ deriving (Generic)
+ src/Hercules/API/ClientInfo/ClientInfo.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.ClientInfo.ClientInfo where++import Hercules.API.Accounts.Account (Account)+import Hercules.API.Forge.Forge (Forge)+import Hercules.API.Prelude++data ClientInfo = ClientInfo+ { apiBaseUrl :: Text,+ frontendBaseUrl :: Text,+ licensedTo :: Text,+ forges :: [Forge],+ -- | @[]@ for unauthenticated users.+ personalAccounts :: [Account]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Effects.hs view
@@ -7,7 +7,8 @@ import Hercules.API.Effects.EffectInfo import Hercules.API.Prelude import Hercules.API.Projects.Job (Job)-import Servant.API (Capture, Get, JSON, NoContent, Optional, Post, QueryParam', Required, Summary, (:-), (:>))+import Servant.API (Capture, Get, JSON, NoContent, Optional, Post, QueryParam', Required, Summary, (:>))+import Servant.API.Generic (GenericMode ((:-))) data EffectsAPI auth f = EffectsAPI { getEffect ::
src/Hercules/API/Effects/EffectInfo.hs view
@@ -4,9 +4,11 @@ import Hercules.API.Build.DerivationInfo.DerivationInput (DerivationInput) import Hercules.API.Effects.EffectEvent (EffectEvent)+import Hercules.API.Effects.EffectReference (EffectReference) import Hercules.API.Prelude import Hercules.API.Projects.Job (Job) import Hercules.API.Projects.Project (Project)+import Hercules.API.Projects.SimpleJob (SimpleJob) data EffectStatus = Waiting@@ -25,6 +27,8 @@ requiredSystemFeatures :: [Text], inputDerivations :: [DerivationInput], events :: [[EffectEvent]],+ waitingForEffects :: [EffectReference],+ waitingForJobs :: [SimpleJob], mayCancel :: Bool, dummy :: Maybe EffectEvent -- TODO: remove and update/fix codegen }
+ src/Hercules/API/Effects/EffectReference.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Effects.EffectReference where++import Hercules.API.Prelude+import Hercules.API.Projects.SimpleJob (SimpleJob)++data EffectReference = EffectReference+ { job :: SimpleJob,+ attributePath :: [Text]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Error.hs view
@@ -0,0 +1,16 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Error where++import Hercules.API.Prelude++-- | General error type used in (some) HTTP error response bodies and in some+-- resources.+data Error = Error+ { -- | Symbolic names of the error condition; identifiers that clients+ -- may use to identify specific errors or classes of errors.+ errorTags :: [Text],+ -- | Human-readable error message.+ message :: Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Evaluation/AttributeError.hs view
@@ -9,6 +9,7 @@ -- | Not intended to be displayed to the user. This is -- @Just "BuildException"@ for evaluation time build failures. errorType :: Maybe Text,- errorDerivation :: Maybe Text+ errorDerivation :: Maybe Text,+ trace :: Maybe Text } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Forge.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE TypeFamilies #-}++module Hercules.API.Forge where++import Hercules.API.Forge.Forge (Forge)+import Hercules.API.Prelude+import Servant.API++data ForgeResourceGroup auth f = ForgeResourceGroup+ { get ::+ f+ :- Summary ("Get the forge.")+ :> auth+ :> Get '[JSON] Forge,+ delete ::+ f+ :- Summary ("Delete the forge.")+ :> auth+ :> Delete '[JSON] NoContent+ }+ deriving (Generic)++data ForgeAPI auth f = ForgeAPI+ { forgeById ::+ f+ :- Substitute+ ("forges" :> Capture "forgeId" (Id Forge) :> Placeholder)+ (ToServantApi (ForgeResourceGroup auth)),+ forgeByName ::+ f+ :- Substitute+ ( "forge"+ :> Capture "forgeName" (Name Forge)+ :> Placeholder+ )+ (ToServantApi (ForgeResourceGroup auth))+ }+ deriving (Generic)
+ src/Hercules/API/Forge/Forge.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Forge.Forge where++import Hercules.API.Prelude++-- | A source hosting site (example github for github.com) used for+-- source code, permissions, CI statuses, ...+data Forge = Forge+ { id :: Id Forge,+ slug :: Name Forge,+ displayName :: Text,+ typ :: Text,+ newInstallationURL :: Maybe Text,+ -- | Does the requesting user have admin permissions?+ adminPermission :: Maybe Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Forge/SimpleForge.hs view
@@ -0,0 +1,13 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Forge.SimpleForge where++import Hercules.API.Forge.Forge (Forge)+import Hercules.API.Prelude++data SimpleForge = SimpleForge+ { id :: Id Forge,+ name :: Name Forge,+ displayName :: Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/GitLab.hs view
@@ -0,0 +1,65 @@+{-# LANGUAGE DataKinds #-}++module Hercules.API.GitLab where++import Hercules.API.Accounts.Account (Account)+import Hercules.API.GitLab.CreateInstallationBuilderRequest (CreateInstallationBuilderRequest)+import Hercules.API.GitLab.InstallationBuilder (InstallationBuilder, InstallationBuilders)+import Hercules.API.GitLab.PatchInstallationBuilder (PatchInstallationBuilder)+import Hercules.API.Prelude+import Servant.API++data GitLabAPI auth f = GitLabAPI+ { createInstallationBuilder ::+ f+ :- "gitlab"+ :> "installation"+ :> ReqBody '[JSON] CreateInstallationBuilderRequest+ :> auth+ :> Post '[JSON] InstallationBuilder,+ getInstallationBuilders ::+ f+ :- "gitlab"+ :> "installations"+ :> auth+ :> Get '[JSON] InstallationBuilders,+ getInstallationBuilder ::+ f+ :- "gitlab"+ :> "installation"+ :> Capture "installationId" (Id InstallationBuilder)+ :> auth+ :> Get '[JSON] InstallationBuilder,+ patchInstallationBuilder ::+ f+ :- "gitlab"+ :> "installation"+ :> Capture "installationId" (Id InstallationBuilder)+ :> auth+ :> ReqBody '[JSON] PatchInstallationBuilder+ :> Patch '[JSON] InstallationBuilder,+ deleteInstallationBuilder ::+ f+ :- "gitlab"+ :> "installation"+ :> Capture "installationId" (Id InstallationBuilder)+ :> auth+ :> Delete '[JSON] NoContent,+ installAccount ::+ f+ :- "accounts"+ :> Capture "accountId" (Id Account)+ :> "gitlab"+ :> "install"+ :> auth+ :> Post '[JSON] NoContent,+ deinstallAccount ::+ f+ :- "accounts"+ :> Capture "accountId" (Id Account)+ :> "gitlab"+ :> "deinstall"+ :> auth+ :> Post '[JSON] NoContent+ }+ deriving (Generic)
+ src/Hercules/API/GitLab/CreateInstallationBuilderRequest.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.GitLab.CreateInstallationBuilderRequest where++import Hercules.API.Prelude++data CreateInstallationBuilderRequest = CreateInstallationBuilderRequest+ { gitlabURL :: Text,+ gitlabAdminUsername :: Text,+ gitlabAdminPassword :: Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/GitLab/CreateInstallationBuilderResponse.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.GitLab.CreateInstallationBuilderResponse where++import Hercules.API.GitLab.InstallationBuilder (InstallationBuilder)+import Hercules.API.Prelude++data CreateInstallationBuilderResponse = CreateInstallationBuilderResponse+ { ok :: Maybe InstallationBuilder,+ error :: Maybe Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/GitLab/InstallationBuilder.hs view
@@ -0,0 +1,22 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.GitLab.InstallationBuilder where++import Hercules.API.Error (Error)+import Hercules.API.Forge.SimpleForge (SimpleForge)+import Hercules.API.Prelude++data InstallationBuilder = InstallationBuilder+ { id :: Id InstallationBuilder,+ gitlabURL :: Text,+ name :: Text,+ displayName :: Text,+ forge :: Maybe SimpleForge,+ errors :: [Error]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data InstallationBuilders = InstallationBuilders+ { items :: [InstallationBuilder]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/GitLab/PatchInstallationBuilder.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.GitLab.PatchInstallationBuilder where++import Hercules.API.Prelude++data PatchInstallationBuilder = PatchInstallationBuilder+ { name :: Maybe Text,+ displayName :: Maybe Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Projects.hs view
@@ -9,6 +9,7 @@ ) import qualified Hercules.API.Build.FailureGraph as FailureGraph import Hercules.API.Build.Log (Log)+import Hercules.API.Forge.Forge (Forge) import Hercules.API.Inputs.ImmutableGitInput (ImmutableGitInput) import Hercules.API.Paging (PagedResponse) import Hercules.API.Prelude@@ -20,25 +21,46 @@ ( Job, ProjectAndJobs, )+import Hercules.API.Projects.JobHandlers (JobHandlers) import Hercules.API.Projects.PatchProject ( PatchProject, ) import Hercules.API.Projects.Project (Project)-import Hercules.API.SourceHostingSite.SourceHostingSite- ( SourceHostingSite,- ) import Servant.API +type GetJsonWithPreflight a =+ Get+ '[JSON]+ (Headers '[Header "Access-Control-Allow-Origin" Text] a)+ :<|> Verb+ 'OPTIONS+ 204+ '[JSON]+ ( Headers+ '[ Header "Access-Control-Allow-Origin" Text,+ Header "Access-Control-Allow-Headers" Text,+ Header "Access-Control-Allow-Methods" Text+ ]+ NoContent+ )+ data ProjectResourceGroup auth f = ProjectResourceGroup- { getJobs ::+ { get :: f+ :- Summary "Retrieve a project"+ :> auth+ :> Get '[JSON] Project,+ getJobs ::+ f :- Summary "Retrieve information about jobs" :> "jobs" :> QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job)+ :> QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided index in the response order."] "offsetIndex" Int64+ :> QueryParam' '[Optional, Description "Return at most n jobs."] "limit" Int64 :> auth- :> Get '[JSON] PagedJobs,+ :> GetJsonWithPreflight PagedJobs, getJobSource :: f :- Summary "Get source information from the latest successful job/jobs satisfying the provided requirements."@@ -64,7 +86,7 @@ f :- Substitute ( "site"- :> Capture' '[Required, Strict] "site" (Name SourceHostingSite)+ :> Capture' '[Required, Strict] "site" (Name Forge) :> "account" :> Capture' '[Required, Strict] "account" (Name Account) :> "project"@@ -84,7 +106,7 @@ f :- Summary "Find projects" :> "projects"- :> QueryParam' '[Optional] "site" (Name SourceHostingSite)+ :> QueryParam' '[Optional] "site" (Name Forge) :> QueryParam' '[Optional] "account" (Name Account) :> QueryParam' '[Optional] "project" (Name Project) :> auth@@ -116,13 +138,22 @@ f :- Summary "Find jobs" :> "jobs"- :> QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name SourceHostingSite)+ :> QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name Forge) :> QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> auth :> Get '[JSON] [ProjectAndJobs],+ getJobHandlers ::+ f+ :- Summary "Get a job's handler declarations, if any."+ :> Description "Handlers define what to build and do on events such as onPush, onSchedule."+ :> "jobs"+ :> Capture' '[Required, Strict] "jobId" (Id Job)+ :> "handlers"+ :> auth+ :> Get '[JSON] JobHandlers, projectJobEvaluation :: f :- Summary "List all attributes in a job"@@ -131,7 +162,7 @@ :> Capture' '[Required, Strict] "jobId" (Id Job) :> "evaluation" :> auth- :> Get '[JSON] EvaluationDetail,+ :> GetJsonWithPreflight EvaluationDetail, jobDerivationFailureGraph :: f :- Summary "Find all failures in an evaluation's derivations"@@ -153,6 +184,18 @@ :> Capture' '[Required, Strict] "jobId" (Id Job) :> "rerun" :> QueryParam "rebuildFailures" Bool+ :> auth+ :> Post '[JSON] Job,+ jobTriggerOnSchedule ::+ f+ :- Summary "Create a scheduled job to run now, based on a configuration job."+ :> Description+ "This is mostly intended for trying out new scheduled jobs before they are merged. The job is run in the context of the job's branch; not that of the default branch."+ :> "jobs"+ :> Capture' '[Required, Strict] "jobId" (Id Job)+ :> "on-schedule"+ :> Capture' '[Required, Strict] "jobName" Text+ :> "run" :> auth :> Post '[JSON] Job, jobCancel ::
src/Hercules/API/Projects/Job.hs view
@@ -49,6 +49,7 @@ = Config | Legacy | OnPush+ | OnSchedule deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema) data GitCommitSource = GitCommitSource
+ src/Hercules/API/Projects/JobHandlers.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Projects.JobHandlers+ ( JobHandlers (..),+ )+where++import Hercules.API.Prelude+import Hercules.API.Projects.Job (Job)+import Hercules.API.Projects.JobHandlers.OnPushHandler (OnPushHandler)+import Hercules.API.Projects.JobHandlers.OnScheduleHandler (OnScheduleHandler)++data JobHandlers = JobHandlers+ { jobId :: Id Job,+ onPush :: Map Text OnPushHandler,+ onSchedule :: Map Text OnScheduleHandler+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Projects/JobHandlers/OnPushHandler.hs view
@@ -0,0 +1,14 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Projects.JobHandlers.OnPushHandler+ ( OnPushHandler (..),+ )+where++import Hercules.API.Prelude++data OnPushHandler = OnPushHandler+ { name :: Text,+ isFlake :: Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Projects/JobHandlers/OnScheduleHandler.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Projects.JobHandlers.OnScheduleHandler+ ( OnScheduleHandler (..),+ TimeConstraints (..),+ )+where++import Hercules.API.DayOfWeek (DayOfWeek)+import Hercules.API.Prelude++data OnScheduleHandler = OnScheduleHandler+ { name :: Text,+ isFlake :: Bool,+ when :: TimeConstraints,+ mainExists :: Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data TimeConstraints = TimeConstraints+ { minute :: Int,+ hour :: [Int],+ dayOfWeek :: Maybe [DayOfWeek],+ dayOfMonth :: Maybe [Int]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Projects/LegacySimpleJob.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Projects.LegacySimpleJob where++import Hercules.API.Prelude+import Hercules.API.Projects.Project (Project)+import Hercules.API.Projects.SimpleJob (JobPhase, JobStatus)++-- | Legacy data type for hci < 0.3+data LegacySimpleJob = LegacySimpleJob+ { id :: Id "Job",+ project :: Project,+ index :: Int64,+ status :: JobStatus,+ phase :: JobPhase+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Projects/Project.hs view
@@ -3,19 +3,20 @@ module Hercules.API.Projects.Project where import Hercules.API.Accounts.Account (Account)+import Hercules.API.Accounts.SimpleAccount (SimpleAccount)+import Hercules.API.Forge.Forge (Forge) import Hercules.API.Prelude import Hercules.API.Repos.Repo (Repo)-import Hercules.API.SourceHostingSite.SourceHostingSite- ( SourceHostingSite,- ) data Project = Project { id :: Id Project,+ owner :: SimpleAccount, ownerId :: Id Account, repoId :: Id Repo, enabled :: Bool,- siteSlug :: Name SourceHostingSite,+ siteSlug :: Name Forge, ownerSlug :: Name Account,+ name :: Name Project, slug :: Name Project, displayName :: Text, imageURL :: Maybe Text,
− src/Hercules/API/SourceHostingSite/SimpleSite.hs
@@ -1,13 +0,0 @@-{-# LANGUAGE DeriveAnyClass #-}--module Hercules.API.SourceHostingSite.SimpleSite where--import Hercules.API.Prelude-import Hercules.API.SourceHostingSite.SourceHostingSite (SourceHostingSite)--data SimpleSite = SimpleSite- { id :: Id SourceHostingSite,- name :: Name SourceHostingSite,- displayName :: Text- }- deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
− src/Hercules/API/SourceHostingSite/SourceHostingSite.hs
@@ -1,15 +0,0 @@-{-# LANGUAGE DeriveAnyClass #-}--module Hercules.API.SourceHostingSite.SourceHostingSite where--import Hercules.API.Prelude---- | A source hosting site (example github for github.com) used for--- source code, permissions, CI statuses, ...-data SourceHostingSite = SourceHostingSite- { id :: Id SourceHostingSite,- slug :: Name SourceHostingSite,- displayName :: Text,- newInstallationURL :: Maybe Text- }- deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/State.hs view
@@ -8,9 +8,9 @@ import Data.Swagger (NamedSchema (NamedSchema), binarySchema) import Data.Swagger.Schema (ToSchema (..)) import Hercules.API.Accounts.Account (Account)+import Hercules.API.Forge.Forge (Forge) import Hercules.API.Prelude import Hercules.API.Projects.Project (Project)-import Hercules.API.SourceHostingSite.SourceHostingSite (SourceHostingSite) import Hercules.API.State.ProjectState (ProjectState) import Hercules.API.State.StateLockAcquireRequest (StateLockAcquireRequest) import Hercules.API.State.StateLockAcquireResponse (StateLockAcquireResponse, StateLockAcquiredResponse)@@ -77,7 +77,7 @@ f :- Substitute ( "site"- :> Capture' '[Required, Strict] "site" (Name SourceHostingSite)+ :> Capture' '[Required, Strict] "site" (Name Forge) :> "account" :> Capture' '[Required, Strict] "account" (Name Account) :> "project"
src/Hercules/Frontend.hs view
@@ -4,11 +4,12 @@ import qualified Data.Text as T import Hercules.API.Accounts.Account (Account)+import Hercules.API.Auth (AuthRoutes)+import Hercules.API.Forge.Forge+ ( Forge,+ ) import Hercules.API.Prelude import Hercules.API.Projects.Project (Project)-import Hercules.API.SourceHostingSite.SourceHostingSite- ( SourceHostingSite,- ) import Network.URI import Servant.API import Servant.Links@@ -22,7 +23,7 @@ :- view, account :: f- :- Capture' [Required, Strict] "site" (Name SourceHostingSite)+ :- Capture' [Required, Strict] "site" (Name Forge) :> Capture' [Required, Strict] "account" (Name Account) :> view, cliAuthorize ::@@ -34,18 +35,19 @@ :> view, project :: f- :- Capture' [Required, Strict] "site" (Name SourceHostingSite)+ :- Capture' [Required, Strict] "site" (Name Forge) :> Capture' [Required, Strict] "account" (Name Account) :> Capture' [Required, Strict] "project" (Name Project) :> view, job :: f- :- Capture' [Required, Strict] "site" (Name SourceHostingSite)+ :- Capture' [Required, Strict] "site" (Name Forge) :> Capture' [Required, Strict] "account" (Name Account) :> Capture' [Required, Strict] "project" (Name Project) :> "jobs" :> Capture' [Required, Strict] "jobIndex" Int :> view,+ auth :: ToServant (AuthRoutes view) f, notificationSettings :: f :- "settings" :> "notifications" :> view
+ test/Hercules/API/AttributeSpec.hs view
@@ -0,0 +1,30 @@+{-# LANGUAGE BlockArguments #-}++module Hercules.API.AttributeSpec (spec) where++import qualified Data.Text as T+import Hercules.API.Attribute+import Protolude+import Test.Hspec+import Test.QuickCheck++interestingId :: Gen Text+interestingId = T.pack <$> listOf (interestingIdChar)++interestingIdChar :: Gen Char+interestingIdChar =+ frequency+ [ (10, elements ['a' .. 'z']),+ (10, elements ['A' .. 'Z']),+ (10, elements ['0' .. '9']),+ (30, elements "~!@#$%^&*()_+{}|:\"<>?`-=[]\\;',./ "),+ (30, elements "\"\\"),+ (10, arbitrary)+ ]++spec :: Spec+spec = do+ describe "Attribute Path <-> String" do+ it "roundtrips" do+ forAll (listOf (interestingId)) \x ->+ attributePathFromString (attributePathToString x) == x
+ test/Main.hs view
@@ -0,0 +1,10 @@+module Main where++import Protolude+import qualified Spec+import Test.Hspec.Runner++main :: IO ()+main = hspecWith config Spec.spec+ where+ config = defaultConfig {configColorMode = ColorAlways}
+ test/Spec.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE BlockArguments #-}++module Spec where++import qualified Hercules.API.AttributeSpec+import Test.Hspec++spec :: Spec+spec = describe "hercules-ci-api" do+ describe "Hercules.API.Attribute" do+ Hercules.API.AttributeSpec.spec