unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Cli.Share.Projects

Description

This module contains Share API calls related to projects, wrapped in the Cli monad.

Here, we also validate inputs from Share that the API itself does not. For example, in the API, a project name is just a Text. But because our client requires a richer structure for project names, we try parsing them into a ProjectName, and fail right away if parsing fails.

Synopsis

API types

data RemoteProject Source #

A remote project.

Instances

Instances details
Generic RemoteProject Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

Associated Types

type Rep RemoteProject :: Type -> Type #

Show RemoteProject Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

Eq RemoteProject Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

type Rep RemoteProject Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

type Rep RemoteProject = D1 ('MetaData "RemoteProject" "Unison.Cli.Share.Projects.Types" "unison-cli-0.0.0-B9QON8ivVlfDVnczaEfnsV" 'False) (C1 ('MetaCons "RemoteProject" 'PrefixI 'True) (S1 ('MetaSel ('Just "projectId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RemoteProjectId) :*: (S1 ('MetaSel ('Just "projectName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProjectName) :*: S1 ('MetaSel ('Just "latestRelease") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Semver)))))

data RemoteProjectBranch Source #

A remote project branch.

Instances

Instances details
Generic RemoteProjectBranch Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

Associated Types

type Rep RemoteProjectBranch :: Type -> Type #

Show RemoteProjectBranch Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

Eq RemoteProjectBranch Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

type Rep RemoteProjectBranch Source # 
Instance details

Defined in Unison.Cli.Share.Projects.Types

API functions

getProjectById :: RemoteProjectId -> Cli (Maybe RemoteProject) Source #

Get a project by id.

On success, update the remote_project table.

getProjectByName :: ProjectName -> Cli (Maybe RemoteProject) Source #

Get a project by name.

On success, update the remote_project table.

getProjectByName' :: ProjectName -> Cli (Either ClientError (Maybe RemoteProject)) Source #

Variant of getProjectByName that returns servant client errors.

createProject :: ProjectName -> Cli (Maybe RemoteProject) Source #

Create a new project. Kinda weird: returns Nothing if the user handle part of the project doesn't exist.

On success, update the remote_project table.

getProjectBranchById :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId RemoteProjectBranchId -> Cli GetProjectBranchResponse Source #

Get a project branch by id.

On success, update the remote_project_branch table.

getProjectBranchByName :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId ProjectBranchName -> Cli GetProjectBranchResponse Source #

Get a project branch by name.

On success, update the remote_project_branch table.

createProjectBranch :: CreateProjectBranchRequest -> Cli (Maybe RemoteProjectBranch) Source #

Create a new project branch.

On success, update the remote_project_branch table.

data SetProjectBranchHeadResponse Source #

Instances

Instances details
Generic SetProjectBranchHeadResponse Source # 
Instance details

Defined in Unison.Cli.Share.Projects

Associated Types

type Rep SetProjectBranchHeadResponse :: Type -> Type #

Show SetProjectBranchHeadResponse Source # 
Instance details

Defined in Unison.Cli.Share.Projects

Eq SetProjectBranchHeadResponse Source # 
Instance details

Defined in Unison.Cli.Share.Projects

type Rep SetProjectBranchHeadResponse Source # 
Instance details

Defined in Unison.Cli.Share.Projects

type Rep SetProjectBranchHeadResponse = D1 ('MetaData "SetProjectBranchHeadResponse" "Unison.Cli.Share.Projects" "unison-cli-0.0.0-B9QON8ivVlfDVnczaEfnsV" 'False) ((C1 ('MetaCons "SetProjectBranchHeadResponseNotFound" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetProjectBranchHeadResponseExpectedCausalHashMismatch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash32))) :+: (C1 ('MetaCons "SetProjectBranchHeadResponsePublishedReleaseIsImmutable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SetProjectBranchHeadResponseDeprecatedReleaseIsImmutable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetProjectBranchHeadResponseSuccess" 'PrefixI 'False) (U1 :: Type -> Type))))

setProjectBranchHead :: SetProjectBranchHeadRequest -> Cli SetProjectBranchHeadResponse Source #

Set a project branch head (can be a fast-forward or force-push).

Temporary special hard-coded base url