---
title: "Data model"
description: "The objects that providers return, and the helpers for their keys."
canonical_url: "https://forges.link/reference/data-model"
---
# Data model

> The objects that providers return, and the helpers for their keys.

Every provider returns these shapes, whatever the forge. See [Data model](https://forges.link/concepts/data-model) for how they fit together.

Most objects also carry `raw`, which is the forge's own representation of the object, unchanged. A normalised value often has a `Raw` twin that holds the forge's own value, such as `stateRaw` beside `state`. Events carry the unchanged delivery as `payload`. These fields are not listed below.

## Forges and refs

### `ForgeKind`

Identifier of a forge implementation. Unknown forges are permitted so that
third-party providers can be registered without a core release.

**one of:**

- [`KnownForgeKind`](https://forges.link/reference/data-model#knownforgekind)
- `(string & {})`

### `KnownForgeKind`

The forges this package ships providers for.

**one of:**

- `'github'`
- `'gitlab'`
- `'bitbucket'`
- `'forgejo'`
- `'gitea'`
- `'tangled'`
- `'gitee'`
- `'azure-devops'`
- `'cursor-origin'`
- `'pushin'`
- `'cloudflare-artifacts'`

### `ForgeInstance`

Host of a single forge deployment, for example `github.com` or `codeberg.org`.

**type:** `string`

### `ForgeOrigin`

Where an object comes from: the forge and the instance of that forge.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ThreadKind`

Kind of thread. `'other'` holds forge-specific subjects with no shared kind
(check suites, epics); `ThreadRef.typeRaw` names them.

**one of:**

- `'issue'`
- `'pull_request'`
- `'discussion'`
- `'commit'`
- `'other'`

### `RepoRef`

Addresses a repository by its forge, instance, owner and name.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        owner
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Full namespace path. On forges with nested groups (GitLab) this contains slashes, for example <code>
        acme/platform
      </code>
      
      ; <code>
        name
      </code>
      
       never does.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Repository name. Empty for namespace-scoped refs.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind?
      </code>
    </td>
    
    <td>
      <code>
        'repo' | 'namespace'
      </code>
    </td>
    
    <td>
      <code>
        'namespace'
      </code>
      
       for subjects that belong to a group rather than a repository (GitLab epics). Absent means a repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        externalId?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Stable forge-native identifier that survives renames and transfers: a GitHub, Forgejo or Gitea numeric id, a GitLab project or group id, a Bitbucket UUID or a Tangled repo DID. <a href="https://forges.link/reference/data-model#repokey">
        <code>
          repoKey
        </code>
      </a>
      
       prefers it over <code>
        owner
      </code>
      
       and <code>
        name
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ThreadRef`

Reference to a thread. A thread `number` is unique only within its repo, so
the repo is always carried alongside it.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadkind">
        <code>
          ThreadKind
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        number?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Per-repo thread number, the commit sha for <code>
        kind: 'commit'
      </code>
      
      , or the forge-native id for <code>
        kind: 'other'
      </code>
      
      . Absent when the forge did not identify the thread; such a ref cannot be fetched or keyed until enriched.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        displayNumber?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Human-facing per-repo number, when it differs from <code>
        number
      </code>
      
      . Tangled identifies threads by AT-URI but shows numbers in its UI and webhooks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        externalId?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Globally unique forge-native identifier, where one exists: a GitHub <code>
        node_id
      </code>
      
      , a GitLab global id, or an atproto record URI.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ResolvedThreadRef`

A thread ref whose number is known, and which can therefore be keyed and
fetched. Every thread, comment and review read from a forge carries one.

**extends:** [`ThreadRef`](https://forges.link/reference/data-model#threadref)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Per-repo thread number, the commit sha for <code>
        kind: 'commit'
      </code>
      
      , or the forge-native id for <code>
        kind: 'other'
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadkind">
        <code>
          ThreadKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        displayNumber?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Human-facing per-repo number, when it differs from <code>
        number
      </code>
      
      . Tangled identifies threads by AT-URI but shows numbers in its UI and webhooks. Inherited from <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        externalId?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Globally unique forge-native identifier, where one exists: a GitHub <code>
        node_id
      </code>
      
      , a GitLab global id, or an atproto record URI. Inherited from <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `CommentRef`

Reference to a comment on a thread.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native comment id; an AT-URI on Tangled.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ResolvedCommentRef`

A comment ref whose thread is resolved, and which can therefore be keyed. Every comment read from a forge carries one.

**extends:** [`CommentRef`](https://forges.link/reference/data-model#commentref)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedthreadref">
        <code>
          ResolvedThreadRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native comment id; an AT-URI on Tangled. Inherited from <a href="https://forges.link/reference/data-model#commentref">
        <code>
          CommentRef
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `NotificationRef`

Reference to a notification. Distinct from [`ThreadRef`](https://forges.link/reference/data-model#threadref): a notification
is a per-user delivery record whose lifetime and identity are independent of
the thread it points at.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native notification identifier, used for read/done/unsubscribe writes.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `repoKey()`

Stable identity key for a repository: by `externalId` when known, so renames
and transfers keep the key, otherwise by path, lowercased on forges that
ignore case. A hand-built ref without `externalId` therefore keys
differently from the same repo as a provider returns it.

```ts
function repoKey(repo: RepoRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `parseRepoKey()`

Reads a [`repoKey`](https://forges.link/reference/data-model#repokey) back. Keys built from an `externalId` carry no path,
so `owner` and `name` are empty on those.

```ts
function parseRepoKey(key: string): RepoRef | undefined
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`RepoRef | undefined`](https://forges.link/reference/data-model#reporef)

### `repoSlug()`

The `owner/name` people read and type; the owner alone for a namespace.

```ts
function repoSlug(repo: RepoRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `repoRef()`

The ref of a repository on `origin` from the `owner/name` that people type. The name is what follows the last
slash, so a GitLab subgroup stays in `owner`.

**Example**

```ts
const repo = repoRef(provider, 'acme/widgets')
```

```ts
function repoRef(origin: ForgeOrigin, slug: string): RepoRef
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        origin
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
    </td>
    
    <td>
      The forge and instance, such as a provider.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        slug
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The repository, such as <code>
        acme/widgets
      </code>
      
       or <code>
        acme/platform/widgets
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`RepoRef`](https://forges.link/reference/data-model#reporef)

**Throws:**

- {TypeError} When `slug` has no owner or no name.

### `threadKey()`

Stable identity key for a thread. `'other'` threads are keyed by their
forge-native type so unrelated subjects with the same id never collide.

```ts
function threadKey(thread: ResolvedThreadRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedthreadref">
        <code>
          ResolvedThreadRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `parseThreadKey()`

Reads a [`threadKey`](https://forges.link/reference/data-model#threadkey) back.

```ts
function parseThreadKey(key: string): ResolvedThreadRef | undefined
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`ResolvedThreadRef | undefined`](https://forges.link/reference/data-model#resolvedthreadref)

### `threadSlug()`

`acme/widgets#42`, or `acme/widgets@abc1234` for a commit; uses the display number where the forge has one.

```ts
function threadSlug(ref: ThreadRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `commentKey()`

Stable identity key for a comment: the [`threadKey`](https://forges.link/reference/data-model#threadkey) of its thread and the comment's forge-native id.

```ts
function commentKey(ref: ResolvedCommentRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedcommentref">
        <code>
          ResolvedCommentRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `parseCommentKey()`

Reads a [`commentKey`](https://forges.link/reference/data-model#commentkey) back.

```ts
function parseCommentKey(key: string): ResolvedCommentRef | undefined
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`ResolvedCommentRef | undefined`](https://forges.link/reference/data-model#resolvedcommentref)

### `releaseKey()`

Stable identity key for a release: the [`repoKey`](https://forges.link/reference/data-model#repokey) of its repository and the release's forge-native id.

```ts
function releaseKey(ref: ReleaseRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#releaseref">
        <code>
          ReleaseRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `parseReleaseKey()`

Reads a [`releaseKey`](https://forges.link/reference/data-model#releasekey) back. The key carries no `tag`.

```ts
function parseReleaseKey(key: string): ReleaseRef | undefined
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`ReleaseRef | undefined`](https://forges.link/reference/data-model#releaseref)

### `notificationKey()`

A string that identifies a notification, for use as a key in a map or a store.

```ts
function notificationKey(ref: NotificationRef): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#notificationref">
        <code>
          NotificationRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `parseNotificationKey()`

Reads a [`notificationKey`](https://forges.link/reference/data-model#notificationkey) back.

```ts
function parseNotificationKey(key: string): NotificationRef | undefined
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`NotificationRef | undefined`](https://forges.link/reference/data-model#notificationref)

### `notificationThread()`

The thread a notification concerns, or `undefined` for repo, actor and other subjects.

```ts
function notificationThread(notification: Notification): ThreadRef | undefined
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        notification
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#notification">
        <code>
          Notification
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`ThreadRef | undefined`](https://forges.link/reference/data-model#threadref)

### `affectedKeys()`

Lists the identity keys of the repositories, threads, comments, releases and notifications that an event or a
notification concerns, so that a cache can drop or read again the rows that it holds for them. It sends no request.

A push or a ref event concerns its repository only: a pull request whose head branch moved has no key here, as
finding it takes a read.

**Example**

```ts
for (const event of await provider.webhooks.ingest(delivery)) {
  const affected = affectedKeys(event)
  for (const key of affected.threads) {
    cache.delete(key)
  }
}
```

```ts
function affectedKeys(item: ForgeEvent | Notification): AffectedKeys
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        item
      </code>
    </td>
    
    <td>
      <code>
        ForgeEvent | Notification
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`AffectedKeys`](https://forges.link/reference/data-model#affectedkeys-1)

### `AffectedKeys`

The identity keys of what an event or a notification concerns, grouped by the key function that built them. Each
list holds a key once.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repos
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repokey">
        <code>
          repoKey
        </code>
      </a>
      
      s of every repository the item concerns, including the repository of each thread, so that a listing keyed by repository is covered. For a renamed or transferred repository it also holds the key of the new path and, where the event names it, the old path.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        threads
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadkey">
        <code>
          threadKey
        </code>
      </a>
      
      s.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        comments
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#commentkey">
        <code>
          commentKey
        </code>
      </a>
      
      s of the comment that a <code>
        comment
      </code>
      
       or <code>
        review_comment
      </code>
      
       event names in <code>
        detail.comment
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        releases
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#releasekey">
        <code>
          releaseKey
        </code>
      </a>
      
      s.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        notifications
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#notificationkey">
        <code>
          notificationKey
        </code>
      </a>
      
      s.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        unresolved
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef[]
        </code>
      </a>
    </td>
    
    <td>
      Threads without a <code>
        number
      </code>
      
      , which have no key, and neither has a comment on one. Their repositories are in <code>
        repos
      </code>
      
      , and every thread and comment key starts with the key of its repository followed by <code>
        #
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `isNamespaceRef()`

Whether `ref` addresses an organisation, group or workspace rather than a repository.

```ts
function isNamespaceRef(ref: RepoRef): boolean
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `boolean`

### `isResolvedThread()`

Whether a thread ref has a number, so that it is a `ResolvedThreadRef`.

```ts
function isResolvedThread(thread: ThreadRef): thread is ResolvedThreadRef
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`thread is ResolvedThreadRef`](https://forges.link/reference/data-model#resolvedthreadref)

### `normaliseRepoName()`

`repo` with `owner` and `name` lowercased where the forge ignores case, so equal repositories compare equal.

```ts
function normaliseRepoName(repo: RepoRef): RepoRef
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** [`RepoRef`](https://forges.link/reference/data-model#reporef)

### `namesAreCaseInsensitive()`

Whether `forge` treats owner and repository names case-insensitively. Unknown forges are assumed not to.

```ts
function namesAreCaseInsensitive(forge: ForgeKind): boolean
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `boolean`

## Accounts and repositories

### `RepoVisibility`

Who can see a repository.

**one of:**

- `'public'`
- `'private'`
- `'internal'`

### `RepoPermissions`

The authenticated account's access to a repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        admin
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Full administrative access.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        maintain
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Manage the repository without access to sensitive or destructive settings.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        push
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        triage
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Manage issues and pull requests without write access.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pull
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Read and clone the repository.
    </td>
  </tr>
</tbody>
</table>

### `RepoFeatures`

Which subjects a repository has switched on, where the forge makes them per repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        issues
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pullRequests
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discussions
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        wiki
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        projects
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        releases
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
</tbody>
</table>

### `RepoRole`

A collaborator's role, highest first. `'none'` is an explicit absence of access.

**one of:**

- `'admin'`
- `'maintain'`
- `'write'`
- `'triage'`
- `'read'`
- `'none'`

### `Collaborator`

An account with a role on a repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        actor
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        role
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporole">
        <code>
          RepoRole
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        permissions?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repopermissions">
        <code>
          RepoPermissions
        </code>
      </a>
    </td>
    
    <td>
      What the role allows.
    </td>
  </tr>
</tbody>
</table>

### `Contributor`

A commit author on a repository, as `repos.contributors()` reads it.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        actor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      The account, where the forge links the author to one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The git author name, where the forge reports one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The git author email, where the forge reports one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contributions
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Commits attributed to the contributor, as the forge counts them.
    </td>
  </tr>
</tbody>
</table>

### `ContributorStats`

A contributor's commit activity over time, as `repos.contributorStats()` reads it.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        actor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      The account, where the forge links the commits to one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commits
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Commits by the contributor across all weeks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        weeks
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#contributorweek">
        <code>
          ContributorWeek[]
        </code>
      </a>
    </td>
    
    <td>
      One entry per week, oldest first.
    </td>
  </tr>
</tbody>
</table>

### `ContributorWeek`

One week of a contributor's commit activity.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        week
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Start of the week.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        additions
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Lines added.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        deletions
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Lines deleted.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commits
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Commits that week.
    </td>
  </tr>
</tbody>
</table>

### `RepoTemplate`

An issue or pull request template of a repository, as `repos.templates()` reads it.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <code>
        'issue' | 'pull_request'
      </code>
    </td>
    
    <td>
      What the template opens.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The name of the template, where the forge's API parses one, or its file name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        path?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The file the template lives in. Not available on GitLab.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        format
      </code>
    </td>
    
    <td>
      <code>
        'markdown' | 'form'
      </code>
    </td>
    
    <td>
      <code>
        'form'
      </code>
      
       for a form written in YAML, <code>
        'markdown'
      </code>
      
       for the rest.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The template as the repository stores it: Markdown with any front matter, or the YAML of a form.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The title a new thread starts with, where the forge parses one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        about?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What the template is for, where the forge parses it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels?
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      Labels a new thread gets, where the forge parses them.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        fields?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repotemplatefield">
        <code>
          RepoTemplateField[]
        </code>
      </a>
    </td>
    
    <td>
      The fields of a form, where the forge parses them.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        source?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      Where the template comes from when the forge falls back to another repository, like GitHub's <code>
        .github
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `RepoTemplateField`

One field of an issue form, as the forge parses it.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The kind of input, such as <code>
        'input'
      </code>
      
      , <code>
        'textarea'
      </code>
      
      , <code>
        'dropdown'
      </code>
      
      , <code>
        'checkboxes'
      </code>
      
       or <code>
        'markdown'
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        attributes
      </code>
    </td>
    
    <td>
      <code>
        Record<string, unknown>
      </code>
    </td>
    
    <td>
      The field's label, description, options and default value, as the form declares them.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        validations?
      </code>
    </td>
    
    <td>
      <code>
        Record<string, unknown>
      </code>
    </td>
    
    <td>
      Whether the field is required, and other checks the form declares.
    </td>
  </tr>
</tbody>
</table>

### `TeamRef`

Reference to a team of an organisation. A team belongs to the organisation,
not to a repository, so the ref carries the namespace ref of the
organisation rather than a repository.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        org
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      The organisation, group or workspace the team belongs to.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native team id. Where it is set, <code>
        orgs.teamMembers()
      </code>
      
       prefers it to <code>
        slug
      </code>
      
       on forges that address teams by id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        slug
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      URL-safe identifier unique within the organisation. GitHub has a slug; on GitLab it is the subgroup's path below the group, such as <code>
        platform/web
      </code>
      
      ; Forgejo and Gitea have none, so the team's name stands in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `Team`

A team of an organisation, as `orgs.teams()` lists them. GitLab has no teams
of its own, so a subgroup plays the role of one.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#teamref">
        <code>
          TeamRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        permission?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native repository permission the team grants, where the forge reports one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        parent?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#teamref">
        <code>
          TeamRef
        </code>
      </a>
    </td>
    
    <td>
      The team's parent team, where the forge nests teams: a GitHub parent team, or the GitLab subgroup a nested subgroup belongs to.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Web page of the team, where the forge has one.
    </td>
  </tr>
</tbody>
</table>

### `Repo`

A repository as every forge reports it. Fields that not every forge has, such as `openPullCount`, are optional.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        displayName?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The repository's name where <code>
        ref.name
      </code>
      
       is an identifier rather than the name (a Tangled record key).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        defaultBranch?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        visibility
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repovisibility">
        <code>
          RepoVisibility
        </code>
      </a>
    </td>
    
    <td>
      Who can see the repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isFork
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isArchived
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The repository is archived and read-only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        parent?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      The repository that this one was forked from.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        topics
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      Topics, also called tags, that describe the repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cloneUrls?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Git remotes. Tangled maps the hosting knot to its SSH host.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pushedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Last push, where the listing endpoint reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        openIssueCount?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Open issues only, never combined with pull requests. Absent where the forge reports only the combined count (GitHub).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        openPullCount?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The number of open pull requests, where the forge reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        owner?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      The account or organisation that owns the repository, where the forge reports one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        language?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Primary language, as the forge detects it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        homepage?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Project website, apart from the repository's own <code>
        url
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        licence?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      SPDX identifier of the licence the forge detects, for example <code>
        MIT
      </code>
      
      . SPDX identifiers are case-insensitive, and GitLab reports them in lower case, such as <code>
        mit
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stars?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forks?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        watchers?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Accounts watching the repository's activity, apart from stars.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        permissions?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repopermissions">
        <code>
          RepoPermissions
        </code>
      </a>
    </td>
    
    <td>
      What the authenticated account may do.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergeMethods?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#mergemethod">
        <code>
          MergeMethod[]
        </code>
      </a>
    </td>
    
    <td>
      Merge methods the repository allows, where the forge reports them. Empty means the forge reported none.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        defaultMergeMethod?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#mergemethod">
        <code>
          MergeMethod
        </code>
      </a>
    </td>
    
    <td>
      The repository's default merge method, where the forge reports one. On GitLab, a project that squashes by default reports <code>
        squash
      </code>
      
      , not its base method.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        deleteBranchOnMerge?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The repository's setting for deleting the head branch after a merge, where the forge reports it. Forgejo and Gitea before 1.25 apply it only in their web UI, so <code>
        merge()
      </code>
      
       keeps the branch there. On GitLab it seeds merge requests when they are opened.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergeCommit?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Default text of a merge commit (<code>
        merge
      </code>
      
      ) and a squashed one (<code>
        squash
      </code>
      
      ) as <code>
        MergeCommitDefaults
      </code>
      
      , where the forge reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        features?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repofeatures">
        <code>
          RepoFeatures
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `Actor`

An account: a user, an organisation or a bot.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        login
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native account id: the numeric id on GitHub (<code>
        databaseId
      </code>
      
       in its GraphQL API, not the node id), GitLab, Forgejo, Gitea and Gitee, the UUID on Bitbucket, the identity id on Azure DevOps and the DID on Tangled.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        avatarUrl?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isBotHint
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Hint derived from forge metadata that the actor is automation. Callers own the classification policy.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        app?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The app behind a bot account, where the forge ties one to it (GitHub Apps' <code>
        slug[bot]
      </code>
      
       users).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `User`

A user or organisation account, as `users.get()` reads it.

**extends:** [`Actor`](https://forges.link/reference/data-model#actor)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        bio?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        company?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        location?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        websiteUrl?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        followers?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        following?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        publicRepos?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        login
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native account id: the numeric id on GitHub (<code>
        databaseId
      </code>
      
       in its GraphQL API, not the node id), GitLab, Forgejo, Gitea and Gitee, the UUID on Bitbucket, the identity id on Azure DevOps and the DID on Tangled. Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        avatarUrl?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isBotHint
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Hint derived from forge metadata that the actor is automation. Callers own the classification policy. Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        app?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The app behind a bot account, where the forge ties one to it (GitHub Apps' <code>
        slug[bot]
      </code>
      
       users). Inherited from <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `RepoSearchQuery`

A search for repositories.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        queryRaw?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Forge-native query syntax; see <code>
        SearchQuery.queryRaw
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        owner?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Limit to one account or namespace.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        language?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The main language of the repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sort?
      </code>
    </td>
    
    <td>
      <code>
        'created' | 'updated' | 'stars' | 'relevance'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Defaults to the forge's relevance order.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        direction?
      </code>
    </td>
    
    <td>
      <code>
        'asc' | 'desc'
      </code>
    </td>
    
    <td>
      <code>
        desc
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `RepoTemplateOptions`

Options for `repos.templates()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        kind?
      </code>
    </td>
    
    <td>
      <code>
        'issue' | 'pull_request'
      </code>
    </td>
    
    <td>
      Only templates for this kind of thread. Defaults to both.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `RepoAffiliation`

How the account is attached to the repositories it lists.

**one of:**

- `'owner'`
- `'collaborator'`
- `'organisation_member'`

### `RepoQuery`

Filters for `repos.list()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        affiliation?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repoaffiliation">
        <code>
          RepoAffiliation[]
        </code>
      </a>
    </td>
    
    <td>
      Defaults to every affiliation the forge lists. Unsupported values produce a <code>
        filter_unsupported
      </code>
      
       warning.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        visibility?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repovisibility">
        <code>
          RepoVisibility | 'all'
        </code>
      </a>
    </td>
    
    <td>
      Only repositories with this visibility.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sort?
      </code>
    </td>
    
    <td>
      <code>
        'created' | 'updated' | 'pushed' | 'name'
      </code>
    </td>
    
    <td>
      Defaults to the forge's own order. Unsupported orders produce a <code>
        sort_unsupported
      </code>
      
       warning.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        direction?
      </code>
    </td>
    
    <td>
      <code>
        'asc' | 'desc'
      </code>
    </td>
    
    <td>
      Defaults to the forge's own direction.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `InstallationToken`

A short-lived token that acts as one app installation.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        token
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expiresAt
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        permissions
      </code>
    </td>
    
    <td>
      <code>
        Record<string, string>
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        repositorySelection?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Whether the token reaches all repositories or only selected ones.
    </td>
  </tr>
</tbody>
</table>

### `Installation`

An app installation on an account, with its own credential scope.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        account?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `RepoGetOptions`

Options for `repos.get()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        licence?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Includes the repository's licence in <code>
        Repo.licence
      </code>
      
      . GitLab reports it only on request, because detecting it scans the repository; other forges ignore this option.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `RepoSection`

A repository's section, for linking to the section itself rather than one entry in it.

**one of:**

- `'issues'`
- `'pullRequests'`
- `'compare'`
- `'releases'`
- `'stargazers'`
- `'forks'`
- `'watchers'`

### `OwnerRepoQuery`

Filters for `repos.byOwner()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        visibility?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#repovisibility">
        <code>
          RepoVisibility | 'all'
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Only repositories with this visibility.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subgroups?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Includes the repositories of nested groups, on forges that have them (GitLab).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sort?
      </code>
    </td>
    
    <td>
      <code>
        'created' | 'updated' | 'pushed' | 'name'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Defaults to the forge's own order. Unsupported orders produce a <code>
        sort_unsupported
      </code>
      
       warning.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        direction?
      </code>
    </td>
    
    <td>
      <code>
        'asc' | 'desc'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Defaults to the forge's own direction.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `AddCollaboratorResult`

What `repos.addCollaborator()` did.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        'invited' | 'added'
      </code>
    </td>
    
    <td>
      <code>
        'invited'
      </code>
      
       when the account has to accept an invitation before it has the role, <code>
        'added'
      </code>
      
       when it has the role now, including an account that already had access.
    </td>
  </tr>
</tbody>
</table>

### `TextLimits`

Maximum lengths the forge accepts, in characters.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        bodyLength?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commentLength?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labelLength?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
  </tr>
</tbody>
</table>

## Threads and comments

### `MergeBlockedError`

The pull request cannot be merged yet, typically because of failing or pending checks or branch protection.

**extends:** [`ForgeApiError`](https://forges.link/reference/errors#forgeapierror)

### `MergeConflictError`

The merge conflicts with the base branch, or the head moved since `sha` was read.

**extends:** [`ForgeApiError`](https://forges.link/reference/errors#forgeapierror)

### `MergeMethodRequiredError`

No merge method was given, and the repository allows several or reports none.

**extends:** [`ForgeError`](https://forges.link/reference/errors#forgeerror)

```ts
new MergeMethodRequiredError(allowed: MergeMethod[], context?: ForgeErrorContext, options?: ErrorOptions)
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        allowed
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#mergemethod">
        <code>
          MergeMethod[]
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        context?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/errors#forgeerrorcontext">
        <code>
          ForgeErrorContext
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      <code>
        ErrorOptions
      </code>
    </td>
  </tr>
</tbody>
</table>

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        allowed
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#mergemethod">
        <code>
          MergeMethod[]
        </code>
      </a>
    </td>
    
    <td>
      The merge methods that the repository allows.
    </td>
  </tr>
</tbody>
</table>

### `Label`

A label that a repository defines.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        colour?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The colour as hex digits, without a leading <code>
        #
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `LabelInput`

What a label is created or updated with.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        colour?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Six-digit hex, without the leading <code>
        #
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `Milestone`

A milestone that groups threads.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native milestone id, as <code>
        threads.setMilestone
      </code>
      
       takes it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'closed'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dueOn?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `ThreadState`

Thread state. `'unknown'` is distinct from any real state and signals that
the value was not present in the payload, so the caller may enrich it with
`threads.get()`. Draft status is orthogonal; see `Thread.isDraft`.

**one of:**

- `'open'`
- `'closed'`
- `'merged'`
- `'unknown'`

### `ThreadStack`

Where a pull request sits in a stack of pull requests.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native stack id, where the forge names stacks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        parent?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedthreadref">
        <code>
          ResolvedThreadRef
        </code>
      </a>
    </td>
    
    <td>
      The pull request this one is stacked on. Absent for the root of the stack.
    </td>
  </tr>
</tbody>
</table>

### `Thread`

An issue, pull request, discussion or commit conversation.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedthreadref">
        <code>
          ResolvedThreadRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadkind">
        <code>
          ThreadKind
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadstate">
        <code>
          ThreadState
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stateReason?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native state qualifier, for example <code>
        completed
      </code>
      
       or <code>
        not_planned
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isDraft
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authorAssociation?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#authorassociation">
        <code>
          AuthorAssociation
        </code>
      </a>
    </td>
    
    <td>
      How the author relates to the repository, where the forge reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        assignees
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor[]
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reviewers
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reviewer">
        <code>
          Reviewer[]
        </code>
      </a>
    </td>
    
    <td>
      Reviewers the thread read reports. Some forges report outstanding requests only, others each reviewer's verdict; <code>
        threads.reviews()
      </code>
      
       has every submitted review.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#label">
        <code>
          Label[]
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        closedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      When the pull request was merged, where the forge reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergedBy?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      The account that merged the pull request, where the forge reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        lastActivityAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Latest activity the forge reports for the thread.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        locked?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commentCount?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        participants?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor[]
        </code>
      </a>
    </td>
    
    <td>
      Everyone who authored or commented on the thread, where the forge reports them.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subscription?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#subscriptionstate">
        <code>
          SubscriptionState
        </code>
      </a>
    </td>
    
    <td>
      The authenticated account's subscription, where the thread read already carries it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        milestone?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#milestone">
        <code>
          Milestone
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reactions?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reactionsummary">
        <code>
          ReactionSummary
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        branches?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#pullbranches">
        <code>
          PullBranches
        </code>
      </a>
    </td>
    
    <td>
      Pull requests only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        checks?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkssummary">
        <code>
          ChecksSummary
        </code>
      </a>
    </td>
    
    <td>
      Pull requests only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stats?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#pullstats">
        <code>
          PullStats
        </code>
      </a>
    </td>
    
    <td>
      Pull requests only, where the forge reports counts with the pull request.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stack?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadstack">
        <code>
          ThreadStack
        </code>
      </a>
    </td>
    
    <td>
      Pull requests in a stack: a chain of dependent pull requests, each based on the one before.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        warnings?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#forgewarning">
        <code>
          ForgeWarning[]
        </code>
      </a>
    </td>
    
    <td>
      Non-fatal problems hit while reading the thread, for example an unreachable record.
    </td>
  </tr>
</tbody>
</table>

### `Comment`

A comment on a thread.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedcommentref">
        <code>
          ResolvedCommentRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authorAssociation?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#authorassociation">
        <code>
          AuthorAssociation
        </code>
      </a>
    </td>
    
    <td>
      How the author relates to the repository, where the forge reports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reactions?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reactionsummary">
        <code>
          ReactionSummary
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        thread?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The resolvable conversation the comment belongs to, where the forge has one; <code>
        resolveReviewThread()
      </code>
      
       takes its id.
    </td>
  </tr>
</tbody>
</table>

### `SubscriptionState`

Whether the account gets notifications for a thread.

**one of:**

- `'subscribed'`
- `'ignored'`
- `'none'`

### `ThreadSnapshot`

Fields of a [`Thread`](https://forges.link/reference/data-model#thread) that an event's source carries. A field is absent
when the source does not report it; `labels: []` means the source listed no
labels. `threads.get()` reads the rest.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        title?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadstate">
        <code>
          Exclude<ThreadState, 'unknown'>
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stateReason?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isDraft?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#label">
        <code>
          Label[]
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        branches?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#pullbranches">
        <code>
          PullBranches
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stats?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#pullstats">
        <code>
          PullStats
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergedBy?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

### `ThreadQuery`

Filters for `threads.list()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        kind?
      </code>
    </td>
    
    <td>
      <code>
        'issue' | 'pull_request' | 'discussion'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Omitted lists every listable kind; forges that list kinds separately emit them one after another.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'closed' | 'merged' | 'all'
      </code>
    </td>
    
    <td>
      <code>
        'open'
      </code>
    </td>
    
    <td>
      <code>
        'closed'
      </code>
      
       includes merged pull requests; <code>
        'merged'
      </code>
      
       lists pull requests only, and lists nothing for another <code>
        kind
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels?
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Threads carrying every one of these labels.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Author login.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        assignee?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Assignee login.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        involves?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Threads the login authored, is assigned, commented on or was mentioned in. A listing without this filter ignores it and warns with <code>
        filter_unsupported
      </code>
      
      , as for <code>
        mentions
      </code>
      
       and <code>
        milestone
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mentions?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Threads the login was mentioned in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        milestone?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Milestone title, or <code>
        'none'
      </code>
      
       for threads with no milestone.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        since?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Updated at or after.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAfter?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Created at or after.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sort?
      </code>
    </td>
    
    <td>
      <code>
        'created' | 'updated' | 'comments'
      </code>
    </td>
    
    <td>
      <code>
        'created'
      </code>
    </td>
    
    <td>
      Unsupported orders produce a warning and the forge's own order.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        direction?
      </code>
    </td>
    
    <td>
      <code>
        'asc' | 'desc'
      </code>
    </td>
    
    <td>
      <code>
        'desc'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `SearchQuery`

A structured search. Providers translate it into their own syntax; a
field the forge cannot filter on becomes a `filter_unsupported` warning
on the page rather than a filter applied client-side.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Free text, matched against title and body.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        queryRaw?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Forge-native query syntax, added to the query as is, for qualifiers the other fields don't cover. Forges whose search has no query syntax ignore it with a <code>
        filter_unsupported
      </code>
      
       warning.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        repo?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Limit to one repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind?
      </code>
    </td>
    
    <td>
      <code>
        'issue' | 'pull_request'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'closed' | 'all'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Defaults to every state.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        involves?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Threads the login authored, is assigned, commented on or was mentioned in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        assignee?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels?
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Threads carrying every one of these labels.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        since?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Updated at or after.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sort?
      </code>
    </td>
    
    <td>
      <code>
        'created' | 'updated' | 'comments' | 'relevance'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Defaults to the forge's relevance order.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        direction?
      </code>
    </td>
    
    <td>
      <code>
        'asc' | 'desc'
      </code>
    </td>
    
    <td>
      <code>
        'desc'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `UpsertCommentInput`

What `threads.upsertComment()` needs.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Identifies the comment to replace across runs. It is written into the body as an HTML comment, so it is invisible when rendered but matchable on the next run.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        since?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Only comments updated at or after this time are searched for the key. When retrying a change, pass the time of its first attempt, less a margin for clock skew, so the retry lists only recent comments. A comment with the same key from before <code>
        since
      </code>
      
       is not found, and a new one is created.
    </td>
  </tr>
</tbody>
</table>

### `UpsertCommentResult`

What `threads.upsertComment()` did.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        comment
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#comment">
        <code>
          Comment
        </code>
      </a>
    </td>
    
    <td>
      The comment that was created or edited.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
      
       when a comment with the same key already existed, and was edited or already had the body.
    </td>
  </tr>
</tbody>
</table>

### `ThreadCreateInput`

What `threads.create()` needs.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <code>
        'issue' | 'pull_request' | 'discussion'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels?
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      Names of the labels to add.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        assignees?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Array<string | Actor>
        </code>
      </a>
    </td>
    
    <td>
      Logins, or actors where the forge needs ids.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        head?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Pull requests: source branch, optionally <code>
        owner:branch
      </code>
      
       for forks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        base?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Pull requests: target branch.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        draft?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Open the pull request as a draft.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        category?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Discussions: category name or id.
    </td>
  </tr>
</tbody>
</table>

### `ThreadUpdateInput`

The fields that `threads.update()` changes. Fields left out stay as they are.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        title?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'closed'
      </code>
    </td>
    
    <td>
      Closes or reopens the thread. To give a reason, use <code>
        threads.close()
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        labels?
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      Names of the labels to replace the current ones; <code>
        []
      </code>
      
       clears them.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        assignees?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Array<string | Actor>
        </code>
      </a>
    </td>
    
    <td>
      Logins, or actors where the forge needs ids, to replace the assignees; <code>
        []
      </code>
      
       clears them.
    </td>
  </tr>
</tbody>
</table>

### `GetManyResult`

One `threads.getMany()` entry, in input order; narrow on `ok`.

**one of:**

- `{ ok: true, ref: ThreadRef, thread: Thread }`
- `{ ok: false, ref: ThreadRef, warning: ForgeWarning }`

### `MergeMethod`

How a pull request is merged.

**one of:**

- `'merge'`
- `'squash'`
- `'rebase'`
- `'rebase_merge'`
- `'fast_forward_only'`

### `MergeCommitDefaults`

Where the default title and message of a merge or squash commit come from.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        title?
      </code>
    </td>
    
    <td>
      <code>
        'pull_request_title' | 'commit_or_pull_request_title' | 'merge_message'
      </code>
    </td>
    
    <td>
      The pull request title, the commit's own title when there's just one, or the classic <code>
        Merge pull request #1 from acme/fix
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message?
      </code>
    </td>
    
    <td>
      <code>
        'pull_request_body' | 'pull_request_title' | 'commit_messages' | 'blank'
      </code>
    </td>
    
    <td>
      The pull request body or title, its commit messages, or nothing at all.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        template?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      A template for the whole message, with placeholders such as GitLab's <code>
        %{title}
      </code>
      
      . Absent while the forge sticks to its built-in one.
    </td>
  </tr>
</tbody>
</table>

### `MergeOptions`

Options for `threads.merge()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        method?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#mergemethod">
        <code>
          MergeMethod
        </code>
      </a>
    </td>
    
    <td>
      Defaults to the repository's only allowed method.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Expected head sha; the merge is refused if the branch has moved.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Merge commit title. Where the forge takes a single message, it goes above <code>
        message
      </code>
      
      , separated by a blank line.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Merge commit body, where the forge takes one. Where the forge takes a single message and <code>
        title
      </code>
      
       is unset, this is the whole message.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        whenChecksPass?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Queue the merge until required checks pass, where the forge supports it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ApproveAndMergeOptions`

Options for `threads.approveAndMerge()`.

**extends:** [`MergeOptions`](https://forges.link/reference/data-model#mergeoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Review body sent with the approval. Rejected where approvals carry no body (Azure DevOps, Bitbucket, GitLab).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        method?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#mergemethod">
        <code>
          MergeMethod
        </code>
      </a>
    </td>
    
    <td>
      Defaults to the repository's only allowed method. Inherited from <a href="https://forges.link/reference/data-model#mergeoptions">
        <code>
          MergeOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Expected head sha; the merge is refused if the branch has moved. Inherited from <a href="https://forges.link/reference/data-model#mergeoptions">
        <code>
          MergeOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Merge commit title. Where the forge takes a single message, it goes above <code>
        message
      </code>
      
      , separated by a blank line. Inherited from <a href="https://forges.link/reference/data-model#mergeoptions">
        <code>
          MergeOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Merge commit body, where the forge takes one. Where the forge takes a single message and <code>
        title
      </code>
      
       is unset, this is the whole message. Inherited from <a href="https://forges.link/reference/data-model#mergeoptions">
        <code>
          MergeOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        whenChecksPass?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Queue the merge until required checks pass, where the forge supports it. Inherited from <a href="https://forges.link/reference/data-model#mergeoptions">
        <code>
          MergeOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `MergeResult`

What `threads.merge()` and `threads.approveAndMerge()` resolve with.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        'merged' | 'queued'
      </code>
    </td>
    
    <td>
      <code>
        'merged'
      </code>
      
       once the pull request has merged. <code>
        'queued'
      </code>
      
       when the forge merges it later: with <code>
        whenChecksPass
      </code>
      
      , or where it completes the merge in the background (Azure DevOps, and Bitbucket when the merge outlasts its timeout).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The commit that the merge made on the base branch, where the response reports it.
    </td>
  </tr>
</tbody>
</table>

### `CloseReason`

Why a thread was closed.

**one of:**

- `'completed'`
- `'not_planned'`
- `'duplicate'`

### `CloseOptions`

Options for `threads.close()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        reason?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#closereason">
        <code>
          CloseReason
        </code>
      </a>
    </td>
    
    <td>
      Mapped to the forge's own reason where it has one; forges without close reasons close the thread without one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reasonRaw?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native reason, sent as is; takes precedence over <code>
        reason
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `CommentOptions`

Options for `threads.comment()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Writes the hidden marker of <code>
        upsertComment()
      </code>
      
       for this key into the body, so that <code>
        upsertComment()
      </code>
      
       with the same key edits this comment instead of posting another.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `MilestoneListOptions`

Options for `repos.milestones()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'closed' | 'all'
      </code>
    </td>
    
    <td>
      <code>
        'open'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `SubscribeOptions`

Options for `sources.subscribe()`.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Resume after this cursor, as yielded by an earlier <a href="https://forges.link/reference/data-model#subscriptionitem">
        <code>
          SubscriptionItem
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborting closes the connection and ends iteration without an error.
    </td>
  </tr>
</tbody>
</table>

### `SubscriptionItem`

One item from a push subscription.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        event
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeevent">
        <code>
          ForgeEvent
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Opaque position after <code>
        event
      </code>
      
      ; persist it and pass it back to resume.
    </td>
  </tr>
</tbody>
</table>

### `AuthorAssociation`

How the author of a thread or comment relates to its repository:

- `owner` owns the repository.
- `member` belongs to the organisation that owns it.
- `collaborator` was invited to collaborate on it.
- `contributor` has committed to it before.
- `first_time_contributor` has not committed to it before.
- `first_timer` has not committed to any repository on the forge before.
- `none` has none of these, or is a placeholder for an unclaimed account.
- `unknown` is an association with no normalised value; `authorAssociationRaw` names it.

**one of:**

- `'owner'`
- `'member'`
- `'collaborator'`
- `'contributor'`
- `'first_time_contributor'`
- `'first_timer'`
- `'none'`
- `'unknown'`

### `commentMarker()`

The hidden marker `threads.upsertComment()` writes into a comment body to
find it again. It renders as nothing on every forge that renders Markdown
as HTML.

```ts
function commentMarker(key: string): string
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `string`

### `hasCommentMarker()`

Whether `body` carries the marker for `key`.

```ts
function hasCommentMarker(body: string, key: string): boolean
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `boolean`

## Reactions

### `ReactionContent`

The reactions every forge with reactions has in common, named as GitHub
names them. A [`Reaction`](https://forges.link/reference/data-model#reaction) whose forge-native name has no entry here
has `content: 'other'`, with the forge-native name in `contentRaw`.

**type:** [`(typeof REACTION_CONTENTS)[number]`](https://forges.link/reference/data-model#reaction_contents)

### `Reaction`

One reaction left on a thread or a comment, as `threads.reactions()` lists them.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        content
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reactioncontent">
        <code>
          ReactionContent | 'other'
        </code>
      </a>
    </td>
    
    <td>
      <code>
        'other'
      </code>
      
       where the forge's name has no entry in <a href="https://forges.link/reference/data-model#reactioncontent">
        <code>
          ReactionContent
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        actor
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `ReactionSummary`

The reactions on a thread or comment, counted.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        total
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The number of reactions of every kind.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        counts
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reactioncontent">
        <code>
          Partial<Record<ReactionContent, number>>
        </code>
      </a>
    </td>
    
    <td>
      The number of reactions of each kind. A reaction with no <a href="https://forges.link/reference/data-model#reactioncontent">
        <code>
          ReactionContent
        </code>
      </a>
      
       entry has no key here.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        viewerReacted?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reactioncontent">
        <code>
          ReactionContent[]
        </code>
      </a>
    </td>
    
    <td>
      Reactions the authenticated account has left. Absent when the forge does not report them.
    </td>
  </tr>
</tbody>
</table>

### `REACTION_CONTENTS`

Every name [`ReactionContent`](https://forges.link/reference/data-model#reactioncontent) covers.

**type:** `readonly ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"]`

## Reviews

### `ReviewState`

What a review or a reviewer says about a pull request. `unknown` is a state that the model does not name.

**one of:**

- `'approved'`
- `'changes_requested'`
- `'commented'`
- `'pending'`
- `'dismissed'`
- `'unknown'`

### `ReviewRef`

Reference to a review on a pull request.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native review id; a synthesised <code>
        approval:<login>
      </code>
      
       where the forge has approvals but no review objects.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ReviewComment`

A comment left on a line of the diff as part of a review.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedcommentref">
        <code>
          ResolvedCommentRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        path?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        line?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Line in the file the comment is anchored to, in the side it is anchored to.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        side?
      </code>
    </td>
    
    <td>
      <code>
        'left' | 'right'
      </code>
    </td>
    
    <td>
      <code>
        'left'
      </code>
      
       is the base of the diff, <code>
        'right'
      </code>
      
       the head.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        inReplyTo?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native id of the comment this one replies to.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        thread?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The resolvable conversation the comment belongs to, where the forge has one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `Review`

A review of a pull request.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedreviewref">
        <code>
          ResolvedReviewRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reviewstate">
        <code>
          ReviewState
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        submittedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        comments
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reviewcomment">
        <code>
          ReviewComment[] | false
        </code>
      </a>
    </td>
    
    <td>
      Inline comments submitted with the review. <code>
        false
      </code>
      
       where the forge has approvals but no review objects to hang comments on.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `ReviewEvent`

What a review does when it is submitted. Omitted creates a pending review where the forge has them.

**one of:**

- `'approve'`
- `'request_changes'`
- `'comment'`

### `ReviewCommentInput`

An inline comment to send with a review.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        line?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Line in the diff, in <code>
        side
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        side?
      </code>
    </td>
    
    <td>
      <code>
        'left' | 'right'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        startLine?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      First line of a multi-line comment.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `ReviewInput`

What `threads.createReview()` needs.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        event?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reviewevent">
        <code>
          ReviewEvent
        </code>
      </a>
    </td>
    
    <td>
      Omitted creates a pending review, where the forge has them; submit it with <code>
        submitReview
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        comments?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reviewcommentinput">
        <code>
          ReviewCommentInput[]
        </code>
      </a>
    </td>
    
    <td>
      Inline comments to send with the review.
    </td>
  </tr>
</tbody>
</table>

### `Reviewer`

A reviewer who was asked to review a pull request, and what they said.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        actor
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reviewstate">
        <code>
          ReviewState
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isTeam?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True when the reviewer is a team rather than an account.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        requestedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      When the pending review was last requested. Absent where the forge doesn't report it; on GitHub, <code>
        threads.getMany()
      </code>
      
       reports it.
    </td>
  </tr>
</tbody>
</table>

### `ResolvedReviewRef`

A review ref whose thread is resolved. Every review read from a forge carries one.

**extends:** [`ReviewRef`](https://forges.link/reference/data-model#reviewref)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedthreadref">
        <code>
          ResolvedThreadRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native review id; a synthesised <code>
        approval:<login>
      </code>
      
       where the forge has approvals but no review objects. Inherited from <a href="https://forges.link/reference/data-model#reviewref">
        <code>
          ReviewRef
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `PullBranches`

The branches of a pull request.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        head
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      <code>
        sha
      </code>
      
       is absent on forges where a pull is a patch rather than a branch (Tangled).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        head.ref
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        head.sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        head.repo?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      The repository that holds the head branch, which differs for a fork.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        base.ref
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        base.sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergeCommitSha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The merge commit, once the pull request is merged.
    </td>
  </tr>
</tbody>
</table>

### `PullStats`

The size of a pull request's change. Each count is absent where the forge doesn't report it exactly.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        additions?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Lines added.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        deletions?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Lines removed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        changedFileCount?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Files changed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commitCount?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Commits on the pull request.
    </td>
  </tr>
</tbody>
</table>

## Checks and CI

### `CheckRef`

One check run, commit status or CI job.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        'check_run' | 'status' | 'job' | 'policy'
      </code>
    </td>
    
    <td>
      What the id addresses: a check run, a commit status, a CI job, or a branch policy evaluation.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ChecksSummary`

Combined state of the checks on a pull request's head commit. `failure`
when any check failed, else `pending` while any runs, else `success`.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <code>
        'pending' | 'success' | 'failure' | 'unknown'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        total?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Absent when the forge reports only a combined state.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        failed?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `CheckState`

`neutral` covers skipped and informational results, which neither pass nor fail.

**one of:**

- `'pending'`
- `'success'`
- `'failure'`
- `'neutral'`
- `'unknown'`

### `Check`

One check on a commit: a check run, a commit status, a job or a policy evaluation.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkref">
        <code>
          CheckRef
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkstate">
        <code>
          CheckState
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        startedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        completedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
  </tr>
</tbody>
</table>

### `CheckReportInput`

What `checks.report` writes: a commit status everywhere, a check run on GitHub under app auth.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Status context or check run name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkstate">
        <code>
          Exclude<CheckState, 'unknown'>
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      A short description of the state.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Where a person goes to see the detail.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        externalId?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The caller's own id for the check, where the forge stores one.
    </td>
  </tr>
</tbody>
</table>

### `CiRunRef`

A CI run: a workflow run, a pipeline, or a build.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `CiJobRef`

One job inside a run. `run` is absent when the job was addressed on its own.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        run?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#cirunref">
        <code>
          CiRunRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `CiRun`

A CI run, such as a workflow run or a pipeline.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#cirunref">
        <code>
          CiRunRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkstate">
        <code>
          CheckState
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        number?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Per-repo run number, where the forge has one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        branch?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The commit that the run ran on.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        actor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        startedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        completedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `CiJob`

One job of a CI run.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#cijobref">
        <code>
          CiJobRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkstate">
        <code>
          CheckState
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stage?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Stage or group the job belongs to, where the forge has one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        startedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        completedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `CiRunQuery`

Filters for `ci.runs()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        branch?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#checkstate">
        <code>
          Exclude<CheckState, 'unknown'>
        </code>
      </a>
    </td>
    
    <td>
      Normalised state; forges that filter on their own names translate it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Files and commits

### `BranchMovedError`

`contents.commitFiles()` was given an `expectedHead`, and the branch no longer points at it.

**extends:** [`ForgeApiError`](https://forges.link/reference/errors#forgeapierror)

### `CommitRef`

A commit addressed by its full sha.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The full sha of the commit.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `FileEncoding`

`'binary'` carries bytes; `'utf-8'` carries text the forge reported as text.

**one of:**

- `'utf-8'`
- `'binary'`

### `FileMetadata`

What a forge reports about a file, apart from its content.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The path from the repository root.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Blob sha, where the forge reports one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        size?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Web page for the file at this ref, where the forge has one.
    </td>
  </tr>
</tbody>
</table>

### `FileContent`

A file's contents. Narrow on `encoding` to get text or bytes.

**one of:**

- [`FileMetadata & { encoding: 'utf-8', content: string }`](https://forges.link/reference/data-model#filemetadata)
- [`FileMetadata & { encoding: 'binary', content: Uint8Array }`](https://forges.link/reference/data-model#filemetadata)

### `FileOptions`

Options for `contents.file()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Branch, tag or sha. Defaults to the repository's default branch.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        as?
      </code>
    </td>
    
    <td>
      <code>
        'text' | 'binary'
      </code>
    </td>
    
    <td>
      <code>
        'binary'
      </code>
    </td>
    
    <td>
      <code>
        'text'
      </code>
      
       decodes as UTF-8 and rejects with <a href="https://forges.link/reference/errors#contentnottexterror">
        <code>
          ContentNotTextError
        </code>
      </a>
      
       when the bytes are not text.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `FileChange`

A file that `contents.commitFiles()` writes or deletes.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The path from the repository root.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        content
      </code>
    </td>
    
    <td>
      <code>
        string | Uint8Array | null
      </code>
    </td>
    
    <td>
      The new contents, with a string written as UTF-8, or <code>
        null
      </code>
      
       to delete the file.
    </td>
  </tr>
</tbody>
</table>

### `CommitFilesInput`

The commit that `contents.commitFiles()` makes.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        branch
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The branch to commit to.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The commit message.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        changes
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#filechange">
        <code>
          FileChange[]
        </code>
      </a>
    </td>
    
    <td>
      The files to write or delete. A file that exists is overwritten.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expectedHead?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The sha that the branch must point at. When the branch has moved, the commit rejects with <code>
        BranchMovedError
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createFrom?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Creates <code>
        branch
      </code>
      
       from this branch, tag or sha. The branch must not exist yet.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Who wrote the change. Defaults to the account of the credential. Some forges record it as the committer too.
    </td>
  </tr>
</tbody>
</table>

### `TreeEntryType`

What a tree entry is.

**one of:**

- `'file'`
- `'directory'`
- `'symlink'`
- `'submodule'`

### `TreeEntry`

One entry of a repository tree.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Path from the repository root, without a leading slash.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#treeentrytype">
        <code>
          TreeEntryType
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        size?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The size in bytes, for a file.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mode?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      POSIX mode as the forge reports it, for example <code>
        100644
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `TreeOptions`

Options for `contents.tree()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Branch, tag or sha. Defaults to the repository's default branch.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        path?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Subdirectory to list; the root when omitted.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        recursive?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Every descendant rather than one level. Unsupported on some forges, which then warn.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `Branch`

A branch of a repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The commit that the branch points at.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isDefault?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isProtected?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `Tag`

A tag of a repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Commit the tag points at, after dereferencing an annotated tag where the forge does so.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `CommitSignature`

Git authorship, with the forge account behind it where the forge matched one.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        actor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      The account, where the forge can match it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        date?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      When the commit was authored or committed.
    </td>
  </tr>
</tbody>
</table>

### `FileStatus`

How a commit or pull request changed a file.

**one of:**

- `'added'`
- `'modified'`
- `'removed'`
- `'renamed'`
- `'copied'`
- `'changed'`

### `ChangedFile`

A file that a commit or pull request changed.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        previousPath?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Path before a rename or copy.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#filestatus">
        <code>
          FileStatus
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        additions?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        deletions?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        patch?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Unified diff for the file, where the forge returns one inline.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Blob sha after the change.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isBinary?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The file is binary, so it has no patch.
    </td>
  </tr>
</tbody>
</table>

### `Commit`

A commit.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#commitref">
        <code>
          CommitRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sha
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The full sha.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#commitsignature">
        <code>
          CommitSignature
        </code>
      </a>
    </td>
    
    <td>
      Who wrote the change.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        committer?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#commitsignature">
        <code>
          CommitSignature
        </code>
      </a>
    </td>
    
    <td>
      Who recorded the change.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        parents
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        files?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#changedfile">
        <code>
          ChangedFile[]
        </code>
      </a>
    </td>
    
    <td>
      Present on <code>
        contents.commit
      </code>
      
      ; absent from listings.
    </td>
  </tr>
</tbody>
</table>

### `CommitQuery`

Filters for `contents.commits()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Branch, tag or sha to walk back from.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        since?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Only commits at or after this time.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        until?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Only commits at or before this time.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        path?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Only commits touching this path.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Login or email, as the forge matches it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `CompareOptions`

Options for `contents.compare()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        commitLimit?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The most commits to return. The comparison keeps the newest ones. Where the forge can't send fewer, the provider drops the rest. <code>
        aheadBy
      </code>
      
       still counts every commit where the forge reports the count.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        files?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      Whether to read the changed files. With <code>
        false
      </code>
      
      , <code>
        files
      </code>
      
       is empty and the commits carry no files.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `Comparison`

The difference between two revisions.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        base
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The revision that the comparison starts from.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        head
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The revision that the comparison ends at.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        aheadBy?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The number of commits that <code>
        head
      </code>
      
       has and <code>
        base
      </code>
      
       lacks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        behindBy?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The number of commits that <code>
        base
      </code>
      
       has and <code>
        head
      </code>
      
       lacks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commits
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#commit">
        <code>
          Commit[]
        </code>
      </a>
    </td>
    
    <td>
      The commits between the two revisions, newest first. Forges that cap the list leave out the oldest.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        files
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#changedfile">
        <code>
          ChangedFile[]
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mergeBaseSha?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The merge base, where the forge reports it.
    </td>
  </tr>
</tbody>
</table>

### `CodeMatch`

A file that a code search found. A file whose excerpts span two pages comes back on both.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ref?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The branch, tag or sha the forge searched, where it reports one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        fragments
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#codefragment">
        <code>
          CodeFragment[]
        </code>
      </a>
    </td>
    
    <td>
      The excerpts of the file that matched.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `CodeFragment`

An excerpt of a file that matched a code search.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        text
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        line?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The line the excerpt starts on, where the forge reports it.
    </td>
  </tr>
</tbody>
</table>

### `CommitSearchQuery`

A search for commits.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Free text, matched against the commit message.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        queryRaw?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Forge-native query syntax; see <code>
        SearchQuery.queryRaw
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        repo?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Limit to one repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Commits whose author is this login.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        committer?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Commits whose committer is this login.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        since?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Authored or committed at or after.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        until?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Authored or committed at or before.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sort?
      </code>
    </td>
    
    <td>
      <code>
        'author_date' | 'committer_date'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Defaults to the forge's relevance order.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        direction?
      </code>
    </td>
    
    <td>
      <code>
        'asc' | 'desc'
      </code>
    </td>
    
    <td>
      <code>
        'desc'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `CodeSearchQuery`

A search for code.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Free text, matched against the contents of files.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        queryRaw?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native query syntax; see <code>
        SearchQuery.queryRaw
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        repo?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      Limit to one repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        owner?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Limit to one account or namespace.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Releases

### `ReleaseRef`

A release, as a notification subject or event target.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native release id; the tag name on forges that key releases by tag.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tag?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ReleaseAssetRef`

A release asset, addressable for download with `releases.downloadAsset`.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        release
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#releaseref">
        <code>
          ReleaseRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native asset id; the asset name, or the link id, on forges that have no asset id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `ReleaseAsset`

A file attached to a release.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#releaseassetref">
        <code>
          ReleaseAssetRef
        </code>
      </a>
    </td>
    
    <td>
      Absent where the forge publishes a download URL but nothing to address the asset by.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        size?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        downloadCount?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contentType?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The media type.
    </td>
  </tr>
</tbody>
</table>

### `Release`

A release of a repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#releaseref">
        <code>
          ReleaseRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tag
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The release notes.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isDraft
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isPrerelease
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        immutable?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The release is immutable: its tag and assets are locked. <code>
        true
      </code>
      
       where the forge supports immutable releases and this one is published as immutable (GitHub). The name, notes, prerelease and latest flags stay editable.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        publishedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        assets?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#releaseasset">
        <code>
          ReleaseAsset[]
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `ReleaseInput`

The fields that `releases.create()` sets.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        tag
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The tag to release. The forge creates it from <code>
        target
      </code>
      
       when it does not exist yet.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The release notes.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        draft?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Saves the release unpublished. <code>
        true
      </code>
      
       rejects with <code>
        UnsupportedOperationError
      </code>
      
       on a forge without drafts.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        prerelease?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Marks the release as a prerelease. <code>
        true
      </code>
      
       rejects with <code>
        UnsupportedOperationError
      </code>
      
       on a forge without prereleases.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        target?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The branch or commit sha to create the tag from when it does not exist yet. GitHub, Forgejo and Gitea default to the default branch; GitLab requires it for a new tag.
    </td>
  </tr>
</tbody>
</table>

### `ReleaseUpdate`

The fields that `releases.update()` changes. Fields left out stay as they are.

**type:** [`Partial<ReleaseInput>`](https://forges.link/reference/data-model#releaseinput)

### `DownloadAssetOptions`

Options for `releases.downloadAsset()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        as?
      </code>
    </td>
    
    <td>
      <code>
        'stream' | 'binary' | 'text'
      </code>
    </td>
    
    <td>
      <code>
        'stream'
      </code>
    </td>
    
    <td>
      <code>
        'binary'
      </code>
      
       reads the whole asset into a <code>
        Uint8Array
      </code>
      
      , and <code>
        'text'
      </code>
      
       decodes it as UTF-8, rejecting with <a href="https://forges.link/reference/errors#contentnottexterror">
        <code>
          ContentNotTextError
        </code>
      </a>
      
       when the bytes are not text. <code>
        'stream'
      </code>
      
       returns the bytes as they arrive.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Security alerts

### `SecurityAlertKind`

What an alert is about. `other` is a kind that the model does not name.

**one of:**

- `'dependency'`
- `'code_scanning'`
- `'secret'`
- `'advisory'`
- `'other'`

### `SecurityAlertRef`

A security alert: a vulnerable dependency, a code scanning result, a leaked secret or an advisory.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native alert id. GitHub numbers each alert kind separately, so <code>
        kind
      </code>
      
       is needed to address one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#securityalertkind">
        <code>
          SecurityAlertKind
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `SecuritySeverity`

How severe an alert is. `unknown` is a level that the model does not name.

**one of:**

- `'critical'`
- `'high'`
- `'medium'`
- `'low'`
- `'unknown'`

### `SecurityAlert`

A security alert on a repository.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#securityalertref">
        <code>
          SecurityAlertRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#securityalertkind">
        <code>
          SecurityAlertKind
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        severity
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#securityseverity">
        <code>
          SecuritySeverity
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'fixed' | 'dismissed' | 'unknown'
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      A short description of the problem.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        package?
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      <code>
        ecosystem
      </code>
      
       is absent where the forge reports only the package name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dismissedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `SecurityAlertListOptions`

Filters for `securityAlerts.list()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        kind?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#securityalertkind">
        <code>
          Exclude<SecurityAlertKind, 'other'>
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Omitted lists every kind the provider can read, one after another.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        state?
      </code>
    </td>
    
    <td>
      <code>
        'open' | 'closed' | 'all'
      </code>
    </td>
    
    <td>
      <code>
        'open'
      </code>
    </td>
    
    <td>
      <code>
        'closed'
      </code>
      
       is fixed or dismissed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Webhooks

### `WebhookVerificationError`

A delivery's signature didn't match.

**extends:** [`ForgeError`](https://forges.link/reference/errors#forgeerror)

### `WebhookRef`

Reference to a registered webhook. `target` is the repository, or a
namespace ref (`kind: 'namespace'`, empty `name`) for an organisation or
workspace hook.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        target
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      The repository or namespace that the hook is registered on.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native hook id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `WebhookDeliveryRef`

Reference to one delivery of a webhook.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        hook
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#webhookref">
        <code>
          WebhookRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        guid?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Delivery guid, where the forge needs it to redeliver.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `WebhookEventType`

A normalised event a provider can deliver, optionally narrowed to one action.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventkind">
        <code>
          EventKind
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        action?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventaction">
        <code>
          EventAction
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

### `Webhook`

A registered webhook. The secret is never readable, so it is never returned.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#webhookref">
        <code>
          WebhookRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        events
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventkind">
        <code>
          EventKind[]
        </code>
      </a>
    </td>
    
    <td>
      Normalised kinds the subscription covers, derived from <code>
        nativeEvents
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        nativeEvents
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      Forge-native event names exactly as the forge stores them.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        active
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contentType?
      </code>
    </td>
    
    <td>
      <code>
        'json' | 'form'
      </code>
    </td>
    
    <td>
      <code>
        'json'
      </code>
      
       or <code>
        'form'
      </code>
      
       where the forge offers a choice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createdAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        secret?
      </code>
    </td>
    
    <td>
      <code>
        never
      </code>
    </td>
    
    <td>
      Never returned: no forge reads a webhook secret back.
    </td>
  </tr>
</tbody>
</table>

### `WebhookInput`

What `webhooks.create()` needs to register a hook.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        events?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventkind">
        <code>
          EventKind[]
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Normalised kinds, translated to the forge's own event names.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        nativeEvents?
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Forge-native event names, sent as given and merged with the translation of <code>
        events
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        secret?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      The secret that signs the deliveries.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contentType?
      </code>
    </td>
    
    <td>
      <code>
        'json' | 'form'
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How to encode the delivery body.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        active?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
</tbody>
</table>

### `WebhookUpdate`

A change to a registered webhook. Fields left out are left as they are.

**type:** [`Partial<WebhookInput>`](https://forges.link/reference/data-model#webhookinput)

### `WebhookDeliveryRecord`

One recorded delivery attempt.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#webhookdeliveryref">
        <code>
          WebhookDeliveryRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        event
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Forge-native event name of the delivery.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The HTTP status that the receiver answered with.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ok
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
      
       when the forge considered the delivery successful.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        deliveredAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        duration?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Round trip in milliseconds, where the forge reports it.
    </td>
  </tr>
</tbody>
</table>

### `WebhookDelivery`

A webhook delivery as received: its headers, its raw body and, optionally, the secret to verify it with.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        headers
      </code>
    </td>
    
    <td>
      <code>
        Headers | Record<string, string>
      </code>
    </td>
    
    <td>
      The request headers, which carry the signature and the event name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string | Uint8Array
      </code>
    </td>
    
    <td>
      Raw body exactly as received; signatures are computed over these bytes.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        secret?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Overrides the provider-level <code>
        webhookSecret
      </code>
      
       for this delivery.
    </td>
  </tr>
</tbody>
</table>

## Notifications and events

### `EventKind`

What an event is about.

**one of:**

- `'comment'`
- `'review'`
- `'review_comment'`
- `'commit'`
- `'label'`
- `'state_change'`
- `'assignment'`
- `'mention'`
- `'referenced'`
- `'reaction'`
- `'push'`
- `'ref'`
- `'repo'`
- `'installation'`
- `'membership'`
- `'release'`
- `'star'`
- `'fork'`
- `'wiki'`
- `'other'`

### `PushCommit`

A commit as a push delivery reports it.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sha
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        author?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

### `EventAction`

What happened, independent of `kind`, so "anything that closed" is
`action === 'closed'` whatever the subject.

**one of:**

- `'opened'`
- `'closed'`
- `'reopened'`
- `'merged'`
- `'edited'`
- `'created'`
- `'deleted'`
- `'submitted'`
- `'labelled'`
- `'unlabelled'`
- `'assigned'`
- `'unassigned'`
- `'review_requested'`
- `'synchronised'`
- `'ready_for_review'`
- `'converted_to_draft'`
- `'published'`
- `'renamed'`
- `'transferred'`
- `'archived'`
- `'unarchived'`
- `'added'`
- `'removed'`
- `'other'`

### `EventDetail`

Typed detail for an event. Discriminated by `type`.

**one of:**

- [`{ type: 'comment', comment?: CommentRef, body?: string }`](https://forges.link/reference/data-model#commentref)
- [`{ type: 'review_comment', comment?: CommentRef, body?: string, path?: string, line?: number }`](https://forges.link/reference/data-model#commentref)
- `{ type: 'review', state: ReviewState, stateRaw?: string, body?: string, review?: ReviewRef }`
- [`{ type: 'state_change', state?: ThreadState, draft?: boolean, reason?: string }`](https://forges.link/reference/data-model#threadstate)
- `{ type: 'label', label: string }`
- [`{ type: 'assignment', assignee?: Actor }`](https://forges.link/reference/data-model#actor)
- [`{ type: 'push', ref: string, before?: string, after?: string, commitCount?: number, forced: boolean, commits: PushCommit[] }`](https://forges.link/reference/data-model#pushcommit)
- `{ type: 'ref', ref: string, refType: 'branch' | 'tag' | (string & {}) }`
- `{ type: 'repo_renamed', from: string, to: string }`
- `{ type: 'repo_transferred', fromOwner?: string, toOwner?: string }`
- `{ type: 'repo_archived', archived: boolean }`
- [`{ type: 'installation', actionRaw: string, installationId?: string, added: RepoRef[], removed: RepoRef[] }`](https://forges.link/reference/data-model#reporef)
- [`{ type: 'membership', actionRaw: string, member?: Actor }`](https://forges.link/reference/data-model#actor)
- [`{ type: 'release', release?: ReleaseRef, tag?: string, name?: string, body?: string, isPrerelease?: boolean, isDraft?: boolean, url?: string }`](https://forges.link/reference/data-model#releaseref)
- [`{ type: 'fork', fork?: RepoRef }`](https://forges.link/reference/data-model#reporef)
- `{ type: 'wiki', title?: string, url?: string }`
- `{ type: 'repo_visibility', isPublic: boolean }`
- `{ type: 'referenced', from?: ThreadRef | CommitRef, fromRepo?: RepoRef, text?: string }`

### `ForgeEvent`

An event on a forge, such as a comment, a state change or a push.

**extends:** [`ForgeOrigin`](https://forges.link/reference/data-model#forgeorigin)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventkind">
        <code>
          EventKind
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        action
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventaction">
        <code>
          EventAction
        </code>
      </a>
    </td>
    
    <td>
      Normalised verb; <code>
        other
      </code>
      
       when the forge's wording has no equivalent.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        summary
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Single line describing the event, suitable for a list row.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        occurredAt
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      When the event happened, from the forge's own timestamp unless <code>
        undated
      </code>
      
       is set.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        undated?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether the forge reported no time for the event. <code>
        occurredAt
      </code>
      
       is then the time the event reached <code>
        forges
      </code>
      
       (or Jetstream, for a Tangled subscription), or the Unix epoch for an entry of a thread's timeline.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        actor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#actor">
        <code>
          Actor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        repo?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        thread?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        threadSnapshot?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadsnapshot">
        <code>
          ThreadSnapshot
        </code>
      </a>
    </td>
    
    <td>
      What the event's source says about <code>
        thread
      </code>
      
      , as of when the forge built the payload.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        isPublic?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether anyone can see the event, where the forge says so. <code>
        false
      </code>
      
       covers private and internal repositories alike.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        detail?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#eventdetail">
        <code>
          EventDetail
        </code>
      </a>
    </td>
    
    <td>
      The details that belong to the kind of event.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        installationId?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      App installation the delivery belongs to, for app webhooks.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        source
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#sourcekind">
        <code>
          SourceKind
        </code>
      </a>
    </td>
    
    <td>
      Delivery mechanism the event arrived through.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forge
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgekind">
        <code>
          ForgeKind
        </code>
      </a>
    </td>
    
    <td>
      Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        instance
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#forgeinstance">
        <code>
          ForgeInstance
        </code>
      </a>
    </td>
    
    <td>
      The host of the instance, such as <code>
        github.com
      </code>
      
       or <code>
        git.example.com
      </code>
      
      . Inherited from <a href="https://forges.link/reference/data-model#forgeorigin">
        <code>
          ForgeOrigin
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `SourceKind`

How an event reached the caller.

**one of:**

- `'poll'`
- `'webhook'`
- `'subscribe'`

### `NotificationReason`

Why a notification was delivered. `'unknown'` covers forges that report no
reason and native reasons with no normalised equivalent; `reasonRaw` keeps
the original.

**one of:**

- `'access_requested'`
- `'approval_requested'`
- `'assigned'`
- `'author'`
- `'ci_activity'`
- `'comment'`
- `'followed'`
- `'invitation'`
- `'manual'`
- `'mention'`
- `'merge_blocked'`
- `'review_requested'`
- `'review_submitted'`
- `'security_alert'`
- `'starred'`
- `'state_change'`
- `'subscribed'`
- `'team_mention'`
- `'unknown'`

### `NotificationSubject`

What a notification is about. Not every notification concerns a thread.

**one of:**

- [`{ type: 'thread', thread: ThreadRef }`](https://forges.link/reference/data-model#threadref)
- [`{ type: 'repo', repo: RepoRef }`](https://forges.link/reference/data-model#reporef)
- [`{ type: 'actor', actor: Actor }`](https://forges.link/reference/data-model#actor)
- [`{ type: 'release', release: ReleaseRef }`](https://forges.link/reference/data-model#releaseref)
- [`{ type: 'security_alert', alert: SecurityAlertRef }`](https://forges.link/reference/data-model#securityalertref)
- [`{ type: 'other', typeRaw: string, repo?: RepoRef, id?: string, url?: string }`](https://forges.link/reference/data-model#reporef)

### `Notification`

A notification of the authenticated account.

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ref
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#notificationref">
        <code>
          NotificationRef
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subject
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#notificationsubject">
        <code>
          NotificationSubject
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reason
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#notificationreason">
        <code>
          NotificationReason
        </code>
      </a>
    </td>
    
    <td>
      Why the account got the notification.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        unread
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subjectState
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadstate">
        <code>
          ThreadState
        </code>
      </a>
    </td>
    
    <td>
      State of a thread subject as reported by the notification payload.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        lastReadAt?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        latestComment?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#resolvedcommentref">
        <code>
          ResolvedCommentRef
        </code>
      </a>
    </td>
    
    <td>
      The latest comment on a thread subject, where the forge links it. Read it with <code>
        threads.getComment()
      </code>
      
      . Absent when the latest activity is not a comment on the thread, such as a review comment.
    </td>
  </tr>
</tbody>
</table>

### `EventFeedOptions`

Options for `repos.events()` and `users.events()`.

**extends:** [`PageOptions`](https://forges.link/reference/requests#pageoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        force?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Read the first page even when the forge asked to wait longer between reads, as GitHub does with <code>
        X-Poll-Interval
      </code>
      
      . Without it, such a read returns a <code>
        throttled
      </code>
      
       page.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `NotificationListOptions`

Options for `notifications.list()`.

**extends:** [`ListOptions`](https://forges.link/reference/requests#listoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        all?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Include notifications already marked read.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        force?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Read the first page even when the forge asked to wait longer between reads, as GitHub does with <code>
        X-Poll-Interval
      </code>
      
      . Without it, such a read returns a <code>
        throttled
      </code>
      
       page.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        since?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Only items updated at or after this time. Inherited from <a href="https://forges.link/reference/requests#listoptions">
        <code>
          ListOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        perPage?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      How many items to ask for. The forge may return fewer. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cursor?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/requests#cursor">
        <code>
          Cursor
        </code>
      </a>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Resume after the page that returned this cursor. Inherited from <a href="https://forges.link/reference/requests#pageoptions">
        <code>
          PageOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `BulkNotificationOptions`

Options for `markAllRead()` and `markAllDone()`.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        repo?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#reporef">
        <code>
          RepoRef
        </code>
      </a>
    </td>
    
    <td>
      Limit to one repository.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        before?
      </code>
    </td>
    
    <td>
      <code>
        Date
      </code>
    </td>
    
    <td>
      Only notifications updated before this time.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

### `NotificationWriteOptions`

Options for changing one notification.

**extends:** [`BaseOptions`](https://forges.link/reference/requests#baseoptions)

<table>
<thead>
  <tr>
    <th>
      Member
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        thread?
      </code>
    </td>
    
    <td>
      <a href="https://forges.link/reference/data-model#threadref">
        <code>
          ThreadRef
        </code>
      </a>
    </td>
    
    <td>
      The thread the notification points at, when the caller already holds it. Providers that would otherwise look it up skip that request.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        signal?
      </code>
    </td>
    
    <td>
      <code>
        AbortSignal
      </code>
    </td>
    
    <td>
      Aborts the operation's requests, and the operation rejects with the signal's reason. Writes the forge has already received are not undone. Inherited from <a href="https://forges.link/reference/requests#baseoptions">
        <code>
          BaseOptions
        </code>
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Dates

### `reviveDates()`

Turns the ISO strings `JSON.stringify` left in a model value back into
`Date`s, at any depth, for every field in [`DATE_FIELDS`](https://forges.link/reference/data-model#date_fields), skipping
`raw` and `payload`. Returns a copy.

```ts
function reviveDates<T>(value: T): T
```

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        value
      </code>
    </td>
    
    <td>
      <code>
        T
      </code>
    </td>
  </tr>
</tbody>
</table>

**Returns:** `T`

### `DATE_FIELDS`

Every `Date` field in the model, by name.

**type:** `ReadonlySet<string>`

These exports are documented elsewhere: [`ReposApi`](https://forges.link/reference/repositories#providerrepos), [`InstallationsApi`](https://forges.link/reference/repositories#providerinstallations), [`UsersApi`](https://forges.link/reference/repositories#providerusers), [`ThreadsApi`](https://forges.link/reference/threads#providerthreads), [`ChecksApi`](https://forges.link/reference/notifications#providerchecks), [`CiApi`](https://forges.link/reference/notifications#providerci), [`ReleasesApi`](https://forges.link/reference/repositories#providerreleases), [`SecurityAlertsApi`](https://forges.link/reference/notifications#providersecurityalerts), [`WebhooksApi`](https://forges.link/reference/notifications#providerwebhooks), [`NotificationsApi`](https://forges.link/reference/notifications#providernotifications).


## Sitemap

See the full [sitemap](https://forges.link/sitemap.md) for all pages.
