@usine/github/polling
Classes
Section titled “Classes”ChangedIssue
Section titled “ChangedIssue”An issue number and update time reported by repository change detection.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ChangedIssue(…
args):ChangedIssue
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”number
Section titled “number”
readonlynumber:number
updatedAt
Section titled “updatedAt”
readonlyupdatedAt:Utc
ChangedPullRequest
Section titled “ChangedPullRequest”A pull request number and update time reported by repository change detection.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ChangedPullRequest(…
args):ChangedPullRequest
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”number
Section titled “number”
readonlynumber:number
updatedAt
Section titled “updatedAt”
readonlyupdatedAt:Utc
GitHubPolling
Section titled “GitHubPolling”Finds changed GitHub Items and fetches the snapshots used to select work for Loops.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:object
The service’s operations: what yield* GitHubPolling returns.
changes
Section titled “changes”
readonlychanges: (repository,cursor) =>Effect.Effect<ChangeDetection,GitHubAppError>
Finds issue and PR updates since the saved cursor; persist the returned cursor after processing the detected Items.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
repository |
RepositoryName |
cursor |
PollCursor |
Returns
Section titled “Returns”Effect.Effect<ChangeDetection, GitHubAppError>
labels
Section titled “labels”
readonlylabels: (repository,entityTag) =>Effect.Effect<RepositoryLabelCatalog|RepositoryLabelsNotModified,GitHubAppError>
Reads the repository’s label catalog, or confirms the catalog named by entityTag is unchanged.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
repository |
RepositoryName |
entityTag |
Option.Option<EntityTag> |
Returns
Section titled “Returns”Effect.Effect<RepositoryLabelCatalog | RepositoryLabelsNotModified, GitHubAppError>
snapshot
Section titled “snapshot”
readonlysnapshot: (repository,item) =>Effect.Effect<PayloadSnapshot,GitHubAppError>
Fetches an Item’s selection and prompt payload together with its timestamp-independent content hash.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
repository |
RepositoryName |
item |
ChangedItem |
Returns
Section titled “Returns”Effect.Effect<PayloadSnapshot, GitHubAppError>
readonlystaticlayer:Layer<GitHubPolling,never,Crypto|HttpClient|GitHubApp>
IssueSnapshot
Section titled “IssueSnapshot”An issue’s observed payload and the content identity used to decide whether it represents new work.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IssueSnapshot(…
args):IssueSnapshot
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”contentHash
Section titled “contentHash”
readonlycontentHash:string&Brand<"GitHubContentHash">
payload
Section titled “payload”
readonlypayload:object
assignees
Section titled “assignees”
readonlyassignees:object
assignees.nodes
Section titled “assignees.nodes”
readonlynodes: readonlyobject[]
assignees.totalCount
Section titled “assignees.totalCount”
readonlytotalCount:number
author
Section titled “author”
readonlyauthor: {login:string; } |null
readonlybody:string
closedAt
Section titled “closedAt”
readonlyclosedAt:string|null
closedByPullRequestsReferences
Section titled “closedByPullRequestsReferences”
readonlyclosedByPullRequestsReferences:object
closedByPullRequestsReferences.nodes
Section titled “closedByPullRequestsReferences.nodes”
readonlynodes: readonlyobject[]
closedByPullRequestsReferences.totalCount
Section titled “closedByPullRequestsReferences.totalCount”
readonlytotalCount:number
comments
Section titled “comments”
readonlycomments:object
comments.nodes
Section titled “comments.nodes”
readonlynodes: readonlyobject[]
comments.totalCount
Section titled “comments.totalCount”
readonlytotalCount:number
createdAt
Section titled “createdAt”
readonlycreatedAt:string
issueType
Section titled “issueType”
readonlyissueType: {name:string; } |null
labels
Section titled “labels”
readonlylabels:object
labels.nodes
Section titled “labels.nodes”
readonlynodes: readonlyobject[]
labels.totalCount
Section titled “labels.totalCount”
readonlytotalCount:number
milestone
Section titled “milestone”
readonlymilestone: {title:string; } |null
number
Section titled “number”
readonlynumber:number
readonlystate:string
stateReason
Section titled “stateReason”
readonlystateReason:string|null
readonlytitle:string
updatedAt
Section titled “updatedAt”
readonlyupdatedAt:string
readonlyurl:string
PollCursor
Section titled “PollCursor”REST cursor for efficiency only. Losing it is safe because Event dedup is permanent (ADR 0007).
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PollCursor(…
args):PollCursor
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”entityTag
Section titled “entityTag”
readonlyentityTag:Option<string&Brand<"GitHubEntityTag">>
watermark
Section titled “watermark”
readonlywatermark:Option<Utc>
readonlystaticempty:PollCursor
PullRequestSnapshot
Section titled “PullRequestSnapshot”A pull request’s observed payload and the content identity used to decide whether it represents new work.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PullRequestSnapshot(…
args):PullRequestSnapshot
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”contentHash
Section titled “contentHash”
readonlycontentHash:string&Brand<"GitHubContentHash">
payload
Section titled “payload”
readonlypayload:object
additions
Section titled “additions”
readonlyadditions:number
author
Section titled “author”
readonlyauthor: {login:string; } |null
baseRefName
Section titled “baseRefName”
readonlybaseRefName:string
readonlybody:string
changedFiles
Section titled “changedFiles”
readonlychangedFiles:number
closingIssuesReferences
Section titled “closingIssuesReferences”
readonlyclosingIssuesReferences:object
closingIssuesReferences.nodes
Section titled “closingIssuesReferences.nodes”
readonlynodes: readonlyobject[]
closingIssuesReferences.totalCount
Section titled “closingIssuesReferences.totalCount”
readonlytotalCount:number
comments
Section titled “comments”
readonlycomments:object
comments.nodes
Section titled “comments.nodes”
readonlynodes: readonlyobject[]
comments.totalCount
Section titled “comments.totalCount”
readonlytotalCount:number
createdAt
Section titled “createdAt”
readonlycreatedAt:string
deletions
Section titled “deletions”
readonlydeletions:number
headRefName
Section titled “headRefName”
readonlyheadRefName:string
headRefOid
Section titled “headRefOid”
readonlyheadRefOid:string
isDraft
Section titled “isDraft”
readonlyisDraft:boolean
labels
Section titled “labels”
readonlylabels:object
labels.nodes
Section titled “labels.nodes”
readonlynodes: readonlyobject[]
labels.totalCount
Section titled “labels.totalCount”
readonlytotalCount:number
mergeable
Section titled “mergeable”
readonlymergeable:string
merged
Section titled “merged”
readonlymerged:boolean
mergedAt
Section titled “mergedAt”
readonlymergedAt:string|null
mergeStateStatus
Section titled “mergeStateStatus”
readonlymergeStateStatus:string
number
Section titled “number”
readonlynumber:number
reviewDecision
Section titled “reviewDecision”
readonlyreviewDecision:string|null
reviewRequests
Section titled “reviewRequests”
readonlyreviewRequests:object
reviewRequests.nodes
Section titled “reviewRequests.nodes”
readonlynodes: readonlyobject[]
reviewRequests.totalCount
Section titled “reviewRequests.totalCount”
readonlytotalCount:number
reviews
Section titled “reviews”
readonlyreviews:object
reviews.nodes
Section titled “reviews.nodes”
readonlynodes: readonlyobject[]
reviews.totalCount
Section titled “reviews.totalCount”
readonlytotalCount:number
reviewThreads
Section titled “reviewThreads”
readonlyreviewThreads:object
reviewThreads.nodes
Section titled “reviewThreads.nodes”
readonlynodes: readonlyobject[]
reviewThreads.totalCount
Section titled “reviewThreads.totalCount”
readonlytotalCount:number
readonlystate:string
statusCheckRollup
Section titled “statusCheckRollup”
readonlystatusCheckRollup: {state:string; } |null
readonlytitle:string
updatedAt
Section titled “updatedAt”
readonlyupdatedAt:string
readonlyurl:string
RepositoryChanges
Section titled “RepositoryChanges”Changed Items, the next cursor, and whether the page cap left more Items to fetch.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepositoryChanges(…
args):RepositoryChanges
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”backlog
Section titled “backlog”
readonlybacklog:boolean
True when the page cap ended the walk early. The rest arrives next cycle.
backoffUntil
Section titled “backoffUntil”
readonlybackoffUntil:Option<Utc>
Request backoff from rate pressure or Retry-After; excludes the normal polling interval.
cursor
Section titled “cursor”
readonlycursor:PollCursor
readonlyitems: readonly (ChangedIssue|ChangedPullRequest)[]
nextPollAt
Section titled “nextPollAt”
readonlynextPollAt:Option<Utc>
RepositoryLabel
Section titled “RepositoryLabel”One repository label as GitHub defines it. The name routes lanes, and color and description are presentation only.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepositoryLabel(…
args):RepositoryLabel
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlycolor:string&Brand<"GitHubRepositoryLabelColor">
description
Section titled “description”
readonlydescription:Option<string>
readonlyname:string&Brand<"GitHubRepositoryLabelName">
RepositoryLabelCatalog
Section titled “RepositoryLabelCatalog”A complete label catalog with the ETag of its canonical REST URL.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepositoryLabelCatalog(…
args):RepositoryLabelCatalog
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”entityTag
Section titled “entityTag”
readonlyentityTag:Option<string&Brand<"GitHubEntityTag">>
labels
Section titled “labels”
readonlylabels: readonlyRepositoryLabel[]
RepositoryLabelsNotModified
Section titled “RepositoryLabelsNotModified”GitHub confirmed the catalog named by its ETag has not changed.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepositoryLabelsNotModified(…
args):RepositoryLabelsNotModified
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props?: object, options?: MakeOptions] |
Returns
Section titled “Returns”RepositoryNotModified
Section titled “RepositoryNotModified”GitHub confirmed that the repository cursor still describes its current state.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepositoryNotModified(…
args):RepositoryNotModified
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”backoffUntil
Section titled “backoffUntil”
readonlybackoffUntil:Option<Utc>
Request backoff from rate pressure or Retry-After; excludes the normal polling interval.
cursor
Section titled “cursor”
readonlycursor:PollCursor
nextPollAt
Section titled “nextPollAt”
readonlynextPollAt:Option<Utc>
Type Aliases
Section titled “Type Aliases”ChangeDetection
Section titled “ChangeDetection”ChangeDetection = typeof
ChangeDetection.Type
The result of checking repository changes, including the earliest next poll time.
ChangedItem
Section titled “ChangedItem”ChangedItem = typeof
ChangedItem.Type
An issue or pull request whose payload needs to be fetched after change detection.
ContentHash
Section titled “ContentHash”ContentHash = typeof
ContentHash.Type
Identifies an Item’s payload content for Event deduplication; timestamp-only changes keep the same hash.
EntityTag
Section titled “EntityTag”EntityTag = typeof
EntityTag.Type
GitHub’s opaque HTTP validator for a conditional repository or label-catalog request.
IssuePayload
Section titled “IssuePayload”IssuePayload = typeof
IssuePayload.Type
The issue payload slice that if: expressions and prompt interpolation range over.
PayloadSnapshot
Section titled “PayloadSnapshot”PayloadSnapshot = typeof
PayloadSnapshot.Type
The fetched Item state shared by selection, prompt rendering, and Event deduplication.
PullRequestPayload
Section titled “PullRequestPayload”PullRequestPayload = typeof
PullRequestPayload.Type
The pull-request payload slice that if: expressions and prompt interpolation range over.
RepositoryLabelColor
Section titled “RepositoryLabelColor”RepositoryLabelColor = typeof
RepositoryLabelColor.Type
GitHub stores label colors as six hex digits without the leading hash.
RepositoryLabelDetection
Section titled “RepositoryLabelDetection”RepositoryLabelDetection = typeof
RepositoryLabelDetection.Type
A complete label catalog or confirmation that the cached catalog is unchanged.
RepositoryLabelName
Section titled “RepositoryLabelName”RepositoryLabelName = typeof
RepositoryLabelName.Type
A repository label name as returned by GitHub, preserved without case conversion.
Variables
Section titled “Variables”ChangeDetection
Section titled “ChangeDetection”
constChangeDetection:Schema.Union<readonly [typeofRepositoryNotModified, typeofRepositoryChanges]>
The result of checking repository changes, including the earliest next poll time.
ChangedItem
Section titled “ChangedItem”
constChangedItem:Schema.Union<readonly [typeofChangedIssue, typeofChangedPullRequest]>
An issue or pull request whose payload needs to be fetched after change detection.
ContentHash
Section titled “ContentHash”
constContentHash:Schema.brand<Schema.String,"GitHubContentHash">
Identifies an Item’s payload content for Event deduplication; timestamp-only changes keep the same hash.
EntityTag
Section titled “EntityTag”
constEntityTag:Schema.brand<Schema.NonEmptyString,"GitHubEntityTag">
GitHub’s opaque HTTP validator for a conditional repository or label-catalog request.
IssuePayload
Section titled “IssuePayload”
constIssuePayload:Schema.Struct<{assignees:Schema.Struct<{nodes:Schema.$Array<Schema.Struct<{login:Schema.NonEmptyString; }>>;totalCount:Schema.Int; }>;author:Schema.NullOr<Schema.Struct<{login:Schema.NonEmptyString; }>>;body:Schema.String;closedAt:Schema.NullOr<Schema.String>;closedByPullRequestsReferences:Schema.decodeTo<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>,Schema.NullOr<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>>,never,never>;comments:Schema.Struct<{nodes:Schema.$Array<Schema.Struct<{author:Schema.NullOr<Schema.Struct<{login:Schema.NonEmptyString; }>>;body:Schema.String;createdAt:Schema.String; }>>;totalCount:Schema.Int; }>;createdAt:Schema.String;issueType:Schema.NullOr<Schema.Struct<{name:Schema.String; }>>;labels:Schema.decodeTo<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>,Schema.NullOr<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>>,never,never>;milestone:Schema.NullOr<Schema.Struct<{title:Schema.String; }>>;number:Schema.Int;state:Schema.String;stateReason:Schema.NullOr<Schema.String>;title:Schema.String;updatedAt:Schema.String;url:Schema.NonEmptyString; }>
The issue payload slice that if: expressions and prompt interpolation range over.
PayloadSnapshot
Section titled “PayloadSnapshot”
constPayloadSnapshot:Schema.Union<readonly [typeofIssueSnapshot, typeofPullRequestSnapshot]>
The fetched Item state shared by selection, prompt rendering, and Event deduplication.
PullRequestPayload
Section titled “PullRequestPayload”
constPullRequestPayload:Schema.Struct<{additions:Schema.Int;author:Schema.NullOr<Schema.Struct<{login:Schema.NonEmptyString; }>>;baseRefName:Schema.String;body:Schema.String;changedFiles:Schema.Int;closingIssuesReferences:Schema.decodeTo<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>,Schema.NullOr<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>>,never,never>;comments:Schema.Struct<{nodes:Schema.$Array<Schema.Struct<{author:Schema.NullOr<Schema.Struct<{login:Schema.NonEmptyString; }>>;body:Schema.String;createdAt:Schema.String; }>>;totalCount:Schema.Int; }>;createdAt:Schema.String;deletions:Schema.Int;headRefName:Schema.String;headRefOid:Schema.NonEmptyString;isDraft:Schema.Boolean;labels:Schema.decodeTo<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>,Schema.NullOr<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>>,never,never>;mergeable:Schema.withDecodingDefaultKey<Schema.String,never>;merged:Schema.Boolean;mergedAt:Schema.NullOr<Schema.String>;mergeStateStatus:Schema.withDecodingDefaultKey<Schema.String,never>;number:Schema.Int;reviewDecision:Schema.NullOr<Schema.String>;reviewRequests:Schema.decodeTo<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>,Schema.NullOr<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>>,never,never>;reviews:Schema.decodeTo<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>,Schema.NullOr<Schema.Codec<{nodes: readonlyobject[];totalCount:number; }, {nodes: readonlyobject[];totalCount:number; },never,never>>,never,never>;reviewThreads:Schema.Struct<{nodes:Schema.$Array<Schema.Struct<{comments:Schema.Struct<{nodes:Schema.$Array<Schema.Struct<…>>;totalCount:Schema.Int; }>;isOutdated:Schema.Boolean;isResolved:Schema.Boolean;path:Schema.String; }>>;totalCount:Schema.Int; }>;state:Schema.String;statusCheckRollup:Schema.NullOr<Schema.Struct<{state:Schema.String; }>>;title:Schema.String;updatedAt:Schema.String;url:Schema.NonEmptyString; }>
The pull-request payload slice that if: expressions and prompt interpolation range over.
RepositoryLabelColor
Section titled “RepositoryLabelColor”
constRepositoryLabelColor:Schema.brand<Schema.String,"GitHubRepositoryLabelColor">
GitHub stores label colors as six hex digits without the leading hash.
RepositoryLabelDetection
Section titled “RepositoryLabelDetection”
constRepositoryLabelDetection:Schema.Union<readonly [typeofRepositoryLabelCatalog, typeofRepositoryLabelsNotModified]>
A complete label catalog or confirmation that the cached catalog is unchanged.
RepositoryLabelName
Section titled “RepositoryLabelName”
constRepositoryLabelName:Schema.brand<Schema.NonEmptyString,"GitHubRepositoryLabelName">
A repository label name as returned by GitHub, preserved without case conversion.