hercules-ci-api 0.7.0.0 → 0.7.1.0
raw patch · 15 files changed
+237/−6 lines, 15 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Hercules.API.Accounts: [accountByAuthGetNotificationSettings] :: AccountsAPI auth f -> f :- (Summary "Retrieve notification settings" :> ("accounts" :> ("me" :> ("settings" :> ("notifications" :> (auth :> Get '[JSON] NotificationSettings))))))
+ Hercules.API.Accounts: [accountByAuthPatchNotificationSettings] :: AccountsAPI auth f -> f :- (Summary "Update notification settings" :> ("accounts" :> ("me" :> ("settings" :> ("notifications" :> (ReqBody '[JSON] NotificationSettingsPatch :> (auth :> Patch '[JSON] NotificationSettings)))))))
+ Hercules.API.Accounts.NotificationSettings: All :: NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: AuthorizedEmail :: Text -> Bool -> Maybe SimpleSite -> AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: Ignore :: NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: NotificationSetting :: Maybe NotificationLevel -> Maybe Text -> NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: NotificationSettings :: [AuthorizedEmail] -> Maybe NotificationSetting -> [NotificationAccountOverride] -> NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: NotificationSettingsOverride :: SimpleAccount -> NotificationSetting -> NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: [accountOverrides] :: NotificationSettings -> [NotificationAccountOverride]
+ Hercules.API.Accounts.NotificationSettings: [account] :: NotificationAccountOverride -> SimpleAccount
+ Hercules.API.Accounts.NotificationSettings: [address] :: AuthorizedEmail -> Text
+ Hercules.API.Accounts.NotificationSettings: [authorizedEmails] :: NotificationSettings -> [AuthorizedEmail]
+ Hercules.API.Accounts.NotificationSettings: [defaultSetting] :: NotificationSettings -> Maybe NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: [isPrimary] :: AuthorizedEmail -> Bool
+ Hercules.API.Accounts.NotificationSettings: [notificationEmail] :: NotificationSetting -> Maybe Text
+ Hercules.API.Accounts.NotificationSettings: [notificationLevel] :: NotificationSetting -> Maybe NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: [setting] :: NotificationAccountOverride -> NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: [source] :: AuthorizedEmail -> Maybe SimpleSite
+ Hercules.API.Accounts.NotificationSettings: data AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: data NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: data NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: data NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: data NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance Control.DeepSeq.NFData Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance Control.DeepSeq.NFData Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance Control.DeepSeq.NFData Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance Control.DeepSeq.NFData Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance Control.DeepSeq.NFData Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Classes.Eq Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Classes.Eq Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Classes.Eq Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Classes.Eq Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Classes.Eq Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Generics.Generic Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Generics.Generic Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Generics.Generic Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Generics.Generic Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Generics.Generic Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Show.Show Hercules.API.Accounts.NotificationSettings.AuthorizedEmail
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Show.Show Hercules.API.Accounts.NotificationSettings.NotificationAccountOverride
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Show.Show Hercules.API.Accounts.NotificationSettings.NotificationLevel
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Show.Show Hercules.API.Accounts.NotificationSettings.NotificationSetting
+ Hercules.API.Accounts.NotificationSettings: instance GHC.Show.Show Hercules.API.Accounts.NotificationSettings.NotificationSettings
+ Hercules.API.Accounts.NotificationSettingsPatch: NotificationSettingsPatch :: Maybe NotificationSetting -> Map (Id Account) NotificationSetting -> NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: [accountOverrides] :: NotificationSettingsPatch -> Map (Id Account) NotificationSetting
+ Hercules.API.Accounts.NotificationSettingsPatch: [defaultSetting] :: NotificationSettingsPatch -> Maybe NotificationSetting
+ Hercules.API.Accounts.NotificationSettingsPatch: data NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance Control.DeepSeq.NFData Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance GHC.Classes.Eq Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance GHC.Generics.Generic Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.NotificationSettingsPatch: instance GHC.Show.Show Hercules.API.Accounts.NotificationSettingsPatch.NotificationSettingsPatch
+ Hercules.API.Accounts.SimpleAccount: SimpleAccount :: Id Account -> Text -> Text -> AccountType -> Text -> SimpleSite -> SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: [displayName] :: SimpleAccount -> Text
+ Hercules.API.Accounts.SimpleAccount: [id] :: SimpleAccount -> Id Account
+ Hercules.API.Accounts.SimpleAccount: [imageURL] :: SimpleAccount -> Text
+ Hercules.API.Accounts.SimpleAccount: [name] :: SimpleAccount -> Text
+ Hercules.API.Accounts.SimpleAccount: [site] :: SimpleAccount -> SimpleSite
+ Hercules.API.Accounts.SimpleAccount: [typ] :: SimpleAccount -> AccountType
+ Hercules.API.Accounts.SimpleAccount: data SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance Control.DeepSeq.NFData Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance GHC.Classes.Eq Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance GHC.Generics.Generic Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: instance GHC.Show.Show Hercules.API.Accounts.SimpleAccount.SimpleAccount
+ Hercules.API.Projects.Project: [ownerSlug] :: Project -> Name Account
+ 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.State: [acquireLock] :: ProjectStateResourceGroup auth f -> f :- (Summary "Acquire a lock" :> ("lock" :> (Capture' '[Required, Strict] "lockName" Text :> (ReqBody '[JSON] StateLockAcquireRequest :> (auth :> Post '[JSON] StateLockAcquireResponse)))))
+ Hercules.API.State: [deleteLockLease] :: StateAPI auth f -> f :- ("lock-leases" :> (Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease") :> (auth :> Delete '[JSON] NoContent)))
+ Hercules.API.State: [updateLockLease] :: StateAPI auth f -> f :- ("lock-leases" :> (Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease") :> (ReqBody '[JSON] StateLockUpdateRequest :> (auth :> Post '[JSON] StateLockAcquiredResponse))))
+ Hercules.API.State.StateLockAcquireRequest: StateLockAcquireRequest :: Text -> Bool -> Maybe (Id "StateLockLease") -> Maybe (Id "IdempotencyKey") -> StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: [description] :: StateLockAcquireRequest -> Text
+ Hercules.API.State.StateLockAcquireRequest: [exclusive] :: StateLockAcquireRequest -> Bool
+ Hercules.API.State.StateLockAcquireRequest: [idempotencyKey] :: StateLockAcquireRequest -> Maybe (Id "IdempotencyKey")
+ Hercules.API.State.StateLockAcquireRequest: [parent] :: StateLockAcquireRequest -> Maybe (Id "StateLockLease")
+ Hercules.API.State.StateLockAcquireRequest: data StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance Control.DeepSeq.NFData Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance GHC.Classes.Eq Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance GHC.Generics.Generic Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireRequest: instance GHC.Show.Show Hercules.API.State.StateLockAcquireRequest.StateLockAcquireRequest
+ Hercules.API.State.StateLockAcquireResponse: Acquired :: StateLockAcquiredResponse -> StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: Blocked :: StateLockBlockedResponse -> StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: LockBlockedResponse :: [StateLockLease] -> StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: StateLockAcquiredResponse :: Id "StateLockLease" -> UTCTime -> StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: [blockedByLeases] :: StateLockBlockedResponse -> [StateLockLease]
+ Hercules.API.State.StateLockAcquireResponse: [expirationTime] :: StateLockAcquiredResponse -> UTCTime
+ Hercules.API.State.StateLockAcquireResponse: [leaseId] :: StateLockAcquiredResponse -> Id "StateLockLease"
+ Hercules.API.State.StateLockAcquireResponse: data StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: data StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: data StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Control.DeepSeq.NFData Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Control.DeepSeq.NFData Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Control.DeepSeq.NFData Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Classes.Eq Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Classes.Eq Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Classes.Eq Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Generics.Generic Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Generics.Generic Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Generics.Generic Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Show.Show Hercules.API.State.StateLockAcquireResponse.StateLockAcquireResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Show.Show Hercules.API.State.StateLockAcquireResponse.StateLockAcquiredResponse
+ Hercules.API.State.StateLockAcquireResponse: instance GHC.Show.Show Hercules.API.State.StateLockAcquireResponse.StateLockBlockedResponse
+ Hercules.API.State.StateLockLease: StateLockLease :: Id "StateLockLease" -> UTCTime -> UTCTime -> Maybe SimpleAccount -> Maybe SimpleJob -> Text -> Maybe (Id "StateLockLease") -> Bool -> StateLockLease
+ Hercules.API.State.StateLockLease: [description] :: StateLockLease -> Text
+ Hercules.API.State.StateLockLease: [exclusive] :: StateLockLease -> Bool
+ Hercules.API.State.StateLockLease: [expirationTime] :: StateLockLease -> UTCTime
+ Hercules.API.State.StateLockLease: [id] :: StateLockLease -> Id "StateLockLease"
+ Hercules.API.State.StateLockLease: [job] :: StateLockLease -> Maybe SimpleJob
+ Hercules.API.State.StateLockLease: [parent] :: StateLockLease -> Maybe (Id "StateLockLease")
+ Hercules.API.State.StateLockLease: [startTime] :: StateLockLease -> UTCTime
+ Hercules.API.State.StateLockLease: [user] :: StateLockLease -> Maybe SimpleAccount
+ Hercules.API.State.StateLockLease: data StateLockLease
+ Hercules.API.State.StateLockLease: instance Control.DeepSeq.NFData Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockLease: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockLease: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockLease: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockLease: instance GHC.Classes.Eq Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockLease: instance GHC.Generics.Generic Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockLease: instance GHC.Show.Show Hercules.API.State.StateLockLease.StateLockLease
+ Hercules.API.State.StateLockUpdateRequest: StateLockUpdateRequest :: Maybe Text -> StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: [description] :: StateLockUpdateRequest -> Maybe Text
+ Hercules.API.State.StateLockUpdateRequest: data StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance Control.DeepSeq.NFData Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance GHC.Classes.Eq Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance GHC.Generics.Generic Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.API.State.StateLockUpdateRequest: instance GHC.Show.Show Hercules.API.State.StateLockUpdateRequest.StateLockUpdateRequest
+ Hercules.Frontend: [notificationSettings] :: FrontendRoutes view f -> f :- ("settings" :> ("notifications" :> view))
- Hercules.API.Accounts: AccountsAPI :: (f :- Substitute ("accounts" :> ("me" :> Placeholder)) (ToServantApi (AccountResourceGroup auth))) -> (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 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.Build.DerivationInfo.DerivationOutput: DerivationOutput :: Text -> Text -> DerivationOutput
+ Hercules.API.Build.DerivationInfo.DerivationOutput: DerivationOutput :: Text -> Maybe Text -> DerivationOutput
- Hercules.API.Build.DerivationInfo.DerivationOutput: [outputPath] :: DerivationOutput -> Text
+ Hercules.API.Build.DerivationInfo.DerivationOutput: [outputPath] :: DerivationOutput -> Maybe Text
- Hercules.API.Projects.Project: Project :: Id Project -> Id Account -> Id Repo -> Bool -> Name SourceHostingSite -> Name Project -> Text -> Maybe Text -> Bool -> Project
+ 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.State: ProjectStateResourceGroup :: (f :- (Summary "Upload a state file" :> ("state" :> (Capture' '[Required, Strict] "stateName" Text :> ("data" :> (StreamBody NoFraming OctetStream (SourceIO RawBytes) :> (auth :> Put '[JSON] NoContent))))))) -> (f :- (Summary "List all state files" :> ("states" :> (auth :> Get '[JSON] ProjectState)))) -> (f :- (Summary "Download a state file" :> ("state" :> (Capture' '[Required, Strict] "stateName" Text :> ("data" :> (QueryParam' '[Optional, Strict] "version" Int :> (auth :> StreamGet NoFraming OctetStream (Headers '[ContentLength, ContentDisposition] (SourceIO RawBytes))))))))) -> ProjectStateResourceGroup auth f
+ Hercules.API.State: ProjectStateResourceGroup :: (f :- (Summary "Upload a state file" :> ("state" :> (Capture' '[Required, Strict] "stateName" Text :> ("data" :> (StreamBody NoFraming OctetStream (SourceIO RawBytes) :> (auth :> Put '[JSON] NoContent))))))) -> (f :- (Summary "List all state files" :> ("states" :> (auth :> Get '[JSON] ProjectState)))) -> (f :- (Summary "Download a state file" :> ("state" :> (Capture' '[Required, Strict] "stateName" Text :> ("data" :> (QueryParam' '[Optional, Strict] "version" Int :> (auth :> StreamGet NoFraming OctetStream (Headers '[ContentLength, ContentDisposition] (SourceIO RawBytes))))))))) -> (f :- (Summary "Acquire a lock" :> ("lock" :> (Capture' '[Required, Strict] "lockName" Text :> (ReqBody '[JSON] StateLockAcquireRequest :> (auth :> Post '[JSON] StateLockAcquireResponse)))))) -> ProjectStateResourceGroup 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 SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectStateResourceGroup auth))) -> 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 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.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)))))) -> FrontendRoutes view f
+ 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
Files
- CHANGELOG.md +14/−1
- hercules-ci-api.cabal +9/−1
- src/Hercules/API/Accounts.hs +21/−0
- src/Hercules/API/Accounts/NotificationSettings.hs +39/−0
- src/Hercules/API/Accounts/NotificationSettingsPatch.hs +13/−0
- src/Hercules/API/Accounts/SimpleAccount.hs +17/−0
- src/Hercules/API/Build/DerivationInfo/DerivationOutput.hs +1/−1
- src/Hercules/API/Projects/Project.hs +1/−0
- src/Hercules/API/SourceHostingSite/SimpleSite.hs +13/−0
- src/Hercules/API/State.hs +23/−2
- src/Hercules/API/State/StateLockAcquireRequest.hs +20/−0
- src/Hercules/API/State/StateLockAcquireResponse.hs +23/−0
- src/Hercules/API/State/StateLockLease.hs +28/−0
- src/Hercules/API/State/StateLockUpdateRequest.hs +11/−0
- src/Hercules/Frontend.hs +4/−1
CHANGELOG.md view
@@ -5,6 +5,18 @@ 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.7.1.0] - 2021-09-06++### Added++ - Notification settings+ - Email info+ - State locks: opt-in locks to be used in conjunction with state files. Use of locks is not enforced.++### Changed++ - `DerivationOutput.outputPath` is now nullable when retrieving build info+ ## [0.7.0.0] - 2021-06-22 ### Added@@ -86,7 +98,8 @@ Initial release -[0.6.0.0]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.6.0.1...hercules-ci-api-0.7.0.0+[0.7.1.0]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.7.0.0...hercules-ci-api-0.7.1.0+[0.7.0.0]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.6.0.1...hercules-ci-api-0.7.0.0 [0.6.0.1]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.6.0.0...hercules-ci-api-0.6.0.1 [0.6.0.0]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.5.0.0...hercules-ci-api-0.6.0.0 [0.5.0.0]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.4.0.0...hercules-ci-api-0.5.0.0
hercules-ci-api.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: hercules-ci-api-version: 0.7.0.0+version: 0.7.1.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@@ -29,6 +29,9 @@ Hercules.API.Accounts.CLIAuthorizationRequestStatus Hercules.API.Accounts.CLIToken Hercules.API.Accounts.CLITokensResponse+ Hercules.API.Accounts.NotificationSettings+ Hercules.API.Accounts.NotificationSettingsPatch+ Hercules.API.Accounts.SimpleAccount Hercules.API.Agents Hercules.API.Agents.AgentInfo Hercules.API.Agents.AgentSession@@ -77,10 +80,15 @@ Hercules.API.Repos.RepoKey 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+ Hercules.API.State.StateLockAcquireRequest+ Hercules.API.State.StateLockAcquireResponse+ Hercules.API.State.StateLockLease+ Hercules.API.State.StateLockUpdateRequest Hercules.API.State.StateVersion Hercules.Frontend
src/Hercules/API/Accounts.hs view
@@ -13,6 +13,8 @@ import Hercules.API.Accounts.CLIAuthorizationRequestCreateResponse (CLIAuthorizationRequestCreateResponse) import Hercules.API.Accounts.CLIAuthorizationRequestStatus (CLIAuthorizationRequestStatus) import Hercules.API.Accounts.CLITokensResponse (CLITokensResponse)+import Hercules.API.Accounts.NotificationSettings (NotificationSettings)+import Hercules.API.Accounts.NotificationSettingsPatch (NotificationSettingsPatch) import Hercules.API.Prelude hiding (id) import Hercules.API.SourceHostingSite.SourceHostingSite ( SourceHostingSite,@@ -53,6 +55,25 @@ { accountByAuth :: f :- Substitute ("accounts" :> "me" :> Placeholder) (ToServantApi (AccountResourceGroup auth)),+ accountByAuthGetNotificationSettings ::+ f+ :- Summary "Retrieve notification settings"+ :> "accounts"+ :> "me"+ :> "settings"+ :> "notifications"+ :> auth+ :> Get '[JSON] NotificationSettings,+ accountByAuthPatchNotificationSettings ::+ f+ :- Summary "Update notification settings"+ :> "accounts"+ :> "me"+ :> "settings"+ :> "notifications"+ :> ReqBody '[JSON] NotificationSettingsPatch+ :> auth+ :> Patch '[JSON] NotificationSettings, accountById :: f :- Substitute
+ src/Hercules/API/Accounts/NotificationSettings.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Accounts.NotificationSettings where++import Hercules.API.Accounts.SimpleAccount (SimpleAccount)+import Hercules.API.Prelude+import Hercules.API.SourceHostingSite.SimpleSite (SimpleSite)++data NotificationLevel+ = Ignore+ | All+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data NotificationSetting = NotificationSetting+ { notificationLevel :: Maybe NotificationLevel,+ notificationEmail :: Maybe Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data NotificationAccountOverride = NotificationSettingsOverride+ { account :: SimpleAccount,+ setting :: NotificationSetting+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data AuthorizedEmail = AuthorizedEmail+ { address :: Text,+ isPrimary :: Bool,+ source :: Maybe SimpleSite+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data NotificationSettings = NotificationSettings+ { authorizedEmails :: [AuthorizedEmail],+ defaultSetting :: Maybe NotificationSetting,+ accountOverrides :: [NotificationAccountOverride]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Accounts/NotificationSettingsPatch.hs view
@@ -0,0 +1,13 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Accounts.NotificationSettingsPatch where++import Hercules.API.Accounts.Account (Account)+import Hercules.API.Accounts.NotificationSettings (NotificationSetting)+import Hercules.API.Prelude++data NotificationSettingsPatch = NotificationSettingsPatch+ { defaultSetting :: Maybe NotificationSetting,+ accountOverrides :: Map (Id Account) NotificationSetting+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Accounts/SimpleAccount.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Accounts.SimpleAccount where++import Hercules.API.Accounts.Account (Account, AccountType)+import Hercules.API.Prelude+import Hercules.API.SourceHostingSite.SimpleSite (SimpleSite)++data SimpleAccount = SimpleAccount+ { id :: Id Account,+ name :: Text,+ displayName :: Text,+ typ :: AccountType,+ imageURL :: Text,+ site :: SimpleSite+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Build/DerivationInfo/DerivationOutput.hs view
@@ -6,6 +6,6 @@ data DerivationOutput = DerivationOutput { outputName :: Text,- outputPath :: Text+ outputPath :: Maybe Text } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Projects/Project.hs view
@@ -15,6 +15,7 @@ repoId :: Id Repo, enabled :: Bool, siteSlug :: Name SourceHostingSite,+ ownerSlug :: Name Account, slug :: Name Project, displayName :: Text, imageURL :: Maybe Text,
+ src/Hercules/API/SourceHostingSite/SimpleSite.hs view
@@ -0,0 +1,13 @@+{-# 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/State.hs view
@@ -12,6 +12,9 @@ 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)+import Hercules.API.State.StateLockUpdateRequest (StateLockUpdateRequest) import Servant.API import Servant.API.Generic @@ -47,7 +50,14 @@ :> "data" :> QueryParam' '[Optional, Strict] "version" Int :> auth- :> StreamGet NoFraming OctetStream (Headers '[ContentLength, ContentDisposition] (SourceIO RawBytes))+ :> StreamGet NoFraming OctetStream (Headers '[ContentLength, ContentDisposition] (SourceIO RawBytes)),+ acquireLock ::+ f :- Summary "Acquire a lock"+ :> "lock"+ :> Capture' '[Required, Strict] "lockName" Text+ :> ReqBody '[JSON] StateLockAcquireRequest+ :> auth+ :> Post '[JSON] StateLockAcquireResponse } deriving (Generic) @@ -71,6 +81,17 @@ :> Capture' '[Required, Strict] "project" (Name Project) :> Placeholder )- (ToServantApi (ProjectStateResourceGroup auth))+ (ToServantApi (ProjectStateResourceGroup auth)),+ updateLockLease ::+ f :- "lock-leases"+ :> Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease")+ :> ReqBody '[JSON] StateLockUpdateRequest+ :> auth+ :> Post '[JSON] StateLockAcquiredResponse,+ deleteLockLease ::+ f :- "lock-leases"+ :> Capture' '[Required, Strict] "lockLeaseId" (Id "StateLockLease")+ :> auth+ :> Delete '[JSON] NoContent } deriving (Generic)
+ src/Hercules/API/State/StateLockAcquireRequest.hs view
@@ -0,0 +1,20 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.State.StateLockAcquireRequest where++import Hercules.API.Prelude++data StateLockAcquireRequest = StateLockAcquireRequest+ { -- | A description of the activity that the lock is for. This may appear in+ -- logs when other clients are blocked.+ description :: Text,+ -- | @True@ to request an exclusive lock. Non-exclusive locks are only mutually exclusive with exclusive locks.+ exclusive :: Bool,+ -- | For recursive locking. Set this to the value of environment variable+ -- HERCULES_CI_LOCK_LEASE_ID when present.+ parent :: Maybe (Id "StateLockLease"),+ -- | Generate a random key to make sure that a retry can be successful.+ idempotencyKey :: Maybe (Id "IdempotencyKey")+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/State/StateLockAcquireResponse.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.State.StateLockAcquireResponse where++import Hercules.API.Prelude+import Hercules.API.State.StateLockLease (StateLockLease)++data StateLockAcquireResponse+ = Acquired StateLockAcquiredResponse+ | Blocked StateLockBlockedResponse+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data StateLockAcquiredResponse = StateLockAcquiredResponse+ { leaseId :: Id "StateLockLease",+ expirationTime :: UTCTime+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data StateLockBlockedResponse = LockBlockedResponse+ { blockedByLeases :: [StateLockLease]+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/State/StateLockLease.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.State.StateLockLease where++import Hercules.API.Accounts.SimpleAccount (SimpleAccount)+import Hercules.API.Prelude+import Hercules.API.Projects.SimpleJob (SimpleJob)++data StateLockLease = StateLockLease+ { id :: Id "StateLockLease",+ -- | When the lease was granted.+ startTime :: UTCTime,+ -- | Time of expiry. The lease can be terminated or extended by the actor.+ expirationTime :: UTCTime,+ -- | In case the lock was acquired by a user.+ user :: Maybe SimpleAccount,+ -- | In case the lock was acquired by an effect.+ job :: Maybe SimpleJob,+ -- | User-provided text describing the reason to lock. May be empty.+ description :: Text,+ -- | A pre-existing lock lease. This allows a lease to be granted when the+ -- actor knows it already has a lock lease.+ parent :: Maybe (Id "StateLockLease"),+ -- | Whether the lock is exclusive.+ exclusive :: Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/State/StateLockUpdateRequest.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.State.StateLockUpdateRequest where++import Hercules.API.Prelude++data StateLockUpdateRequest = StateLockUpdateRequest+ { description :: Maybe Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/Frontend.hs view
@@ -40,7 +40,10 @@ :> Capture' [Required, Strict] "project" (Name Project) :> "jobs" :> Capture' [Required, Strict] "jobIndex" Int- :> view+ :> view,+ notificationSettings ::+ f+ :- "settings" :> "notifications" :> view } deriving (Generic)