@usine/github/github-app
Classes
Section titled “Classes”AppAuthenticationError
Section titled “AppAuthenticationError”The App private key cannot sign. Raised once, when the App layer is built.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AppAuthenticationError(…
args):AppAuthenticationError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
AppCredentials
Section titled “AppCredentials”The App credentials the orchestrator keeps and never passes to a worker.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AppCredentials(…
args):AppCredentials
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyappId:number&Brand<"GitHubAppId">
privateKey
Section titled “privateKey”
readonlyprivateKey:Redacted<string&Brand<"GitHubAppPrivateKey">>
AppPermissionError
Section titled “AppPermissionError”The installation lacks required repository grants; missing entries use name:level form.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AppPermissionError(…
args):AppPermissionError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
missing
Section titled “missing”
readonlymissing: readonlystring[]
CoveredProject
Section titled “CoveredProject”A registered repository covered by the discovered GitHub App installation.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CoveredProject(…
args):CoveredProject
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”installationId
Section titled “installationId”
readonlyinstallationId:number&Brand<"GitHubInstallationId">
repository
Section titled “repository”
readonlyrepository:string&Brand<"RepositoryName">
repositoryId
Section titled “repositoryId”
readonlyrepositoryId:number&Brand<"GitHubRepositoryId">
GitHubApiError
Section titled “GitHubApiError”A failed GitHub request, with an HTTP status when a response was received.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GitHubApiError(…
args):GitHubApiError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
operation
Section titled “operation”
readonlyoperation:"create-repository-label"|"discover-installation"|"fetch-item-labels"|"fetch-issue-snapshot"|"fetch-pull-request-snapshot"|"list-installation-repositories"|"list-repository-labels"|"mint-installation-token"|"mint-worker-token"|"poll-repository-changes"|"update-item-labels"
status
Section titled “status”
readonlystatus:Option<number>
GitHubApp
Section titled “GitHubApp”The factory’s GitHub identity and repository access. Orchestrator operations share installation-wide access; each Worker token is newly minted for the repository assigned to its Attempt.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:object
The service’s operations: what yield* GitHubApp returns.
installation
Section titled “installation”
readonlyinstallation: () =>Effect.Effect<Installation,GitHubAppError>
Returns the App installation after checking its required permissions.
Returns
Section titled “Returns”Effect.Effect<Installation, GitHubAppError>
installationToken
Section titled “installationToken”
readonlyinstallationToken: () =>Effect.Effect<InstallationToken,GitHubAppError>
Returns the shared installation-wide token for orchestrator operations, renewing it near expiry.
Returns
Section titled “Returns”Effect.Effect<InstallationToken, GitHubAppError>
projectAccess
Section titled “projectAccess”
readonlyprojectAccess: (registry) =>Effect.Effect<ReadonlyArray<ProjectAccess>,GitHubAppError>
Reports access for every registry repository, retaining uncovered Projects as individual errors.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
registry |
ReadonlyArray<RepositoryName> |
Returns
Section titled “Returns”Effect.Effect<ReadonlyArray<ProjectAccess>, GitHubAppError>
workerToken
Section titled “workerToken”
readonlyworkerToken: (project) =>Effect.Effect<InstallationToken,GitHubAppError>
Mints a fresh token restricted to the covered Project’s repository for a Worker.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
project |
CoveredProject |
Returns
Section titled “Returns”Effect.Effect<InstallationToken, GitHubAppError>
readonlystaticlayer:Layer<GitHubApp,AppAuthenticationError,HttpClient|GitHubCredentials>
GitHubCredentials
Section titled “GitHubCredentials”Supplies AppCredentials, so where credentials come from stays separate from how the App uses them.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:AppCredentials
The service’s operations: what yield* GitHubCredentials returns.
GitHubRateLimitError
Section titled “GitHubRateLimitError”GitHub deferred the request until retryAt; callers can schedule a later attempt.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GitHubRateLimitError(…
args):GitHubRateLimitError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
operation
Section titled “operation”
readonlyoperation:"create-repository-label"|"discover-installation"|"fetch-item-labels"|"fetch-issue-snapshot"|"fetch-pull-request-snapshot"|"list-installation-repositories"|"list-repository-labels"|"mint-installation-token"|"mint-worker-token"|"poll-repository-changes"|"update-item-labels"
retryAt
Section titled “retryAt”
readonlyretryAt:Utc
Installation
Section titled “Installation”The discovered App installation and the account that owns it.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Installation(…
args):Installation
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”accountLogin
Section titled “accountLogin”
readonlyaccountLogin:string
readonlyid:number&Brand<"GitHubInstallationId">
InstallationDiscoveryError
Section titled “InstallationDiscoveryError”The App has no unambiguous active installation to use for repository access.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InstallationDiscoveryError(…
args):InstallationDiscoveryError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
reason
Section titled “reason”
readonlyreason:"missing"|"multiple"|"suspended"
InstallationToken
Section titled “InstallationToken”A redacted installation credential with its expiry and permitted repository scope.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InstallationToken(…
args):InstallationToken
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”expiresAt
Section titled “expiresAt”
readonlyexpiresAt:Utc
readonlyscope:InstallationWide|SingleRepository
readonlyvalue:Redacted<string>
InstallationWide
Section titled “InstallationWide”Token access to every repository covered by the installation.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InstallationWide(…
args):InstallationWide
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props?: object, options?: MakeOptions] |
Returns
Section titled “Returns”InvalidGitHubResponseError
Section titled “InvalidGitHubResponseError”GitHub returned a response that cannot be decoded or is missing required content.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InvalidGitHubResponseError(…
args):InvalidGitHubResponseError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”detail
Section titled “detail”
readonlydetail:string
What made the response invalid: the decode path, the missing field, or the GraphQL errors.
message
Section titled “message”
readonlymessage:string
operation
Section titled “operation”
readonlyoperation:"create-repository-label"|"discover-installation"|"fetch-item-labels"|"fetch-issue-snapshot"|"fetch-pull-request-snapshot"|"list-installation-repositories"|"list-repository-labels"|"mint-installation-token"|"mint-worker-token"|"poll-repository-changes"|"update-item-labels"
ProjectNotInstalledError
Section titled “ProjectNotInstalledError”A registry repository the installation does not cover. Raised per project, so covered siblings still load.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProjectNotInstalledError(…
args):ProjectNotInstalledError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
repository
Section titled “repository”
readonlyrepository:string&Brand<"RepositoryName">
SingleRepository
Section titled “SingleRepository”Token access restricted to the repository assigned to one Attempt.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SingleRepository(…
args):SingleRepository
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”repository
Section titled “repository”
readonlyrepository:string&Brand<"RepositoryName">
repositoryId
Section titled “repositoryId”
readonlyrepositoryId:number&Brand<"GitHubRepositoryId">
Interfaces
Section titled “Interfaces”InstalledRepository
Section titled “InstalledRepository”A repository reported by GitHub for an installation, identified by its numeric id and full name.
Properties
Section titled “Properties”
readonlyid:number&Brand<"GitHubRepositoryId">
readonlyname:string&Brand<"RepositoryName">
Type Aliases
Section titled “Type Aliases”AppId = typeof
AppId.Type
The numeric GitHub App identity included in signed App JWTs.
GitHubAppError
Section titled “GitHubAppError”GitHubAppError = typeof
GitHubAppError.Type
Failures from discovering installation access or making an authenticated GitHub request.
GitHubOperation
Section titled “GitHubOperation”GitHubOperation = typeof
GitHubOperation.Type
The GitHub request that failed, shared by API, rate-limit, and response errors.
InstallationDiscoveryReason
Section titled “InstallationDiscoveryReason”InstallationDiscoveryReason = typeof
InstallationDiscoveryReason.Type
Why App installation discovery could not select one usable installation.
InstallationId
Section titled “InstallationId”InstallationId = typeof
InstallationId.Type
The numeric identity of an installation of the factory’s GitHub App.
PrivateKey
Section titled “PrivateKey”PrivateKey = typeof
PrivateKey.Type
A PEM-encoded RSA private key used to authenticate the GitHub App.
ProjectAccess
Section titled “ProjectAccess”ProjectAccess = typeof
ProjectAccess.Type
The installation coverage result for one registered repository.
RepositoryId
Section titled “RepositoryId”RepositoryId = typeof
RepositoryId.Type
GitHub’s numeric repository identity, used to restrict installation tokens.
RequiredRepositoryPermission
Section titled “RequiredRepositoryPermission”RequiredRepositoryPermission = keyof typeof
REQUIRED_REPOSITORY_PERMISSIONS
TokenScope
Section titled “TokenScope”TokenScope = typeof
TokenScope.Type
The repository coverage requested when minting an installation token.
Variables
Section titled “Variables”
constAppId:Schema.brand<Schema.Int,"GitHubAppId">
The numeric GitHub App identity included in signed App JWTs.
deriveProjectAccess
Section titled “deriveProjectAccess”
constderiveProjectAccess: (installation,registry,installed) =>ReadonlyArray<ProjectAccess>
Checks each registry repository against the installation’s repositories and returns one ProjectAccess per project.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
installation |
Installation |
registry |
ReadonlyArray<RepositoryName> |
installed |
ReadonlyArray<InstalledRepository> |
Returns
Section titled “Returns”ReadonlyArray<ProjectAccess>
GitHubAppError
Section titled “GitHubAppError”
constGitHubAppError:Schema.Union<readonly [typeofInstallationDiscoveryError, typeofAppPermissionError, typeofGitHubApiError, typeofGitHubRateLimitError, typeofInvalidGitHubResponseError]>
Failures from discovering installation access or making an authenticated GitHub request.
GitHubOperation
Section titled “GitHubOperation”
constGitHubOperation:Schema.Literals<readonly ["create-repository-label","discover-installation","fetch-item-labels","fetch-issue-snapshot","fetch-pull-request-snapshot","list-installation-repositories","list-repository-labels","mint-installation-token","mint-worker-token","poll-repository-changes","update-item-labels"]>
The GitHub request that failed, shared by API, rate-limit, and response errors.
InstallationDiscoveryReason
Section titled “InstallationDiscoveryReason”
constInstallationDiscoveryReason:Schema.Literals<readonly ["missing","multiple","suspended"]>
Why App installation discovery could not select one usable installation.
InstallationId
Section titled “InstallationId”
constInstallationId:Schema.brand<Schema.Int,"GitHubInstallationId">
The numeric identity of an installation of the factory’s GitHub App.
missingPermissions
Section titled “missingPermissions”
constmissingPermissions: (granted) =>ReadonlyArray<string>
The required repository permissions an installation grant does not satisfy, as name:level strings.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
granted |
Readonly<Record<string, string>> |
Returns
Section titled “Returns”ReadonlyArray<string>
PrivateKey
Section titled “PrivateKey”
constPrivateKey:Schema.brand<Schema.NonEmptyString,"GitHubAppPrivateKey">
A PEM-encoded RSA private key used to authenticate the GitHub App.
ProjectAccess
Section titled “ProjectAccess”
constProjectAccess:Schema.Union<readonly [typeofCoveredProject, typeofProjectNotInstalledError]>
The installation coverage result for one registered repository.
RedactedPrivateKey
Section titled “RedactedPrivateKey”
constRedactedPrivateKey:Schema.RedactedFromValue<Schema.brand<Schema.NonEmptyString,"GitHubAppPrivateKey">>
An App signing key that stays redacted in diagnostics and cannot be encoded.
RepositoryId
Section titled “RepositoryId”
constRepositoryId:Schema.brand<Schema.Int,"GitHubRepositoryId">
GitHub’s numeric repository identity, used to restrict installation tokens.
REQUIRED_REPOSITORY_PERMISSIONS
Section titled “REQUIRED_REPOSITORY_PERMISSIONS”
constREQUIRED_REPOSITORY_PERMISSIONS:object
Repository grants required for polling, label updates, and agent-authored changes.
Type Declaration
Section titled “Type Declaration”checks
Section titled “checks”
readonlychecks:"read"
contents
Section titled “contents”
readonlycontents:"write"
issues
Section titled “issues”
readonlyissues:"write"
metadata
Section titled “metadata”
readonlymetadata:"read"
pull_requests
Section titled “pull_requests”
readonlypull_requests:"write"
TokenScope
Section titled “TokenScope”
constTokenScope:Schema.Union<readonly [typeofInstallationWide, typeofSingleRepository]>
The repository coverage requested when minting an installation token.