# social.colibri.beta.bridge.defs

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.defs/examples)

## Definitions

### `social.colibri.beta.bridge.defs#attribution`

**Type**: `object`

Who wrote a record on another service. The community writes every bridged record, and the AppView honours this attribution only on records the community itself wrote.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `blob` | No | The author's avatar, uploaded to the community's repo. |
| `imported` | `boolean` | No | Set on messages a bridge imported from the room's earlier history. The AppView sends no notifications for them, and marks their live events as imported. |
| `name` | `string` | Yes | The author's display name on the other service when the record was written. |
| `platform` | `string` | Yes | The service the author is on, as its bridge names it. |
| `registration` | `string` (tid) | Yes | Record key of the registration the record was written for. |
| `remoteId` | `string` | Yes | The author's id on the other service. Opaque to Colibri. |
| `remoteMessage` | `string` | No | The id of the message on the other service, which lets a bridge find its own records again. |

### `social.colibri.beta.bridge.defs#backfill`

**Type**: `object`

A request to import a linked room's earlier messages.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `requestedAt` | `string` (datetime) | Yes | When an admin asked for the import. Messages after this were relayed live. |
| `since` | `string` (datetime) | No | The oldest message to import. Absent imports the room's whole history. |

### `social.colibri.beta.bridge.defs#backfillStatus`

**Type**: `object`

Progress of a history import, as the bridge last reported it.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `string` (space-ref) | Yes | The linked channel being filled. |
| `from` | `string` (datetime) | Yes | The start of the time range being imported. |
| `imported` | `integer` | Yes | How many messages the bridge has imported so far. |
| `reached` | `string` (datetime) | No | When the newest imported message in the channel was sent. |
| `requestedAt` | `string` (datetime) | Yes | The request this status belongs to. |
| `state` | `string` | Yes | How far the import is. |
| `until` | `string` (datetime) | Yes | The end of the time range being imported. |
| `updatedAt` | `string` (datetime) | Yes | When the bridge last reported. |

### `social.colibri.beta.bridge.defs#bridgedActor`

**Type**: `object`

Marks a profile view as someone on another service whose messages a bridge relays.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `platform` | `string` | Yes | The service the person is on. |
| `registration` | `string` (tid) | Yes | Record key of the registration the record was written for. |
| `remoteId` | `string` | Yes | Their id on that service. |

### `social.colibri.beta.bridge.defs#bridgedReactor`

**Type**: `object`

Someone on another service who reacted to a message through a bridge.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Their display name on that service when they reacted. |
| `platform` | `string` | Yes | The service the person is on. |
| `registration` | `string` (tid) | Yes | Record key of the registration the reaction was written for. |
| `remoteId` | `string` | Yes | Their id on that service. |

### `social.colibri.beta.bridge.defs#link`

**Type**: `object`

A Colibri channel kept in sync with a room on another service.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `backfill` | `ref` → `#backfill` | No | The latest history import an admin asked for. |
| `channel` | `string` (space-ref) | Yes | The Colibri channel. |
| `remoteName` | `string` | Yes | The room's name on the other service when the link was made. |
| `remoteRoom` | `string` | Yes | The id of the room on the other service. |

### `social.colibri.beta.bridge.defs#pairingView`

**Type**: `object`

A pending pairing, shown to an admin before they confirm it.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `bridge` | `string` (did) | Yes | The bridge that asked to pair. |
| `bridgeHandle` | `string` (handle) | No | The bridge's handle, when it resolves. |
| `expiresAt` | `string` (datetime) | Yes | When the code stops working. |
| `platform` | `string` | Yes | The service the bridge connects to. |
| `remoteSpace` | `string` | Yes | The id of the server, workspace or network on the other service. |
| `remoteSpaceName` | `string` | Yes | Its name on the other service. |

### `social.colibri.beta.bridge.defs#registrationView`

**Type**: `object`

A bridge registered with a community.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `backfills` | `array` | No | Progress of each linked channel's latest history import. |
| `bridge` | `string` (did) | Yes | The bridge's DID. |
| `bridgeHandle` | `string` (handle) | No | The bridge's handle, when it resolves. |
| `community` | `string` (did) | Yes | The community the registration belongs to. |
| `createdAt` | `string` (datetime) | Yes | When the bridge was paired. |
| `createdBy` | `string` (did) | Yes | The admin who paired the bridge. |
| `enabled` | `boolean` | Yes | Whether the bridge may currently write. |
| `id` | `string` (tid) | Yes | Record key of the registration. |
| `links` | `array` | Yes | Channels kept in sync. |
| `mirrorModeration` | `boolean` | No | Whether moderation crosses the bridge. When on, hiding a bridged message removes its original on the other service, and a moderator removing a relayed message there hides it here. |
| `platform` | `string` | Yes | The service the bridge connects to. |
| `remoteSpace` | `string` | Yes | The id of the server, workspace or network on the other service. |
| `remoteSpaceName` | `string` | Yes | Its name on the other service. |
| `updatedAt` | `string` (datetime) | No | When the registration last changed. |

### `social.colibri.beta.bridge.defs#remoteAuthor`

**Type**: `object`

The person on the other service a bridge is writing for.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `blob` | No | An avatar uploaded earlier with uploadBlob. |
| `id` | `string` | Yes | The author's id on the other service. |
| `name` | `string` | Yes | The author's display name on the other service. |

### `social.colibri.beta.bridge.defs#remoteRoom`

**Type**: `object`

A room a bridge can see on the other service, offered to admins when linking channels.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The room's id on the other service. |
| `kind` | `string` | No | What sort of room it is. |
| `name` | `string` | Yes | The room's name. |
| `parent` | `string` | No | Name of the group or category the room sits in, if any. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "attribution": {
      "description": "Who wrote a record on another service. The community writes every bridged record, and the AppView honours this attribution only on records the community itself wrote.",
      "properties": {
        "avatar": {
          "accept": [
            "image/png",
            "image/jpeg",
            "image/gif",
            "image/webp"
          ],
          "description": "The author's avatar, uploaded to the community's repo.",
          "maxSize": 1000000,
          "type": "blob"
        },
        "imported": {
          "description": "Set on messages a bridge imported from the room's earlier history. The AppView sends no notifications for them, and marks their live events as imported.",
          "type": "boolean"
        },
        "name": {
          "description": "The author's display name on the other service when the record was written.",
          "maxLength": 128,
          "type": "string"
        },
        "platform": {
          "description": "The service the author is on, as its bridge names it.",
          "maxLength": 64,
          "type": "string"
        },
        "registration": {
          "description": "Record key of the registration the record was written for.",
          "format": "tid",
          "type": "string"
        },
        "remoteId": {
          "description": "The author's id on the other service. Opaque to Colibri.",
          "maxLength": 256,
          "type": "string"
        },
        "remoteMessage": {
          "description": "The id of the message on the other service, which lets a bridge find its own records again.",
          "maxLength": 256,
          "type": "string"
        }
      },
      "required": [
        "registration",
        "platform",
        "remoteId",
        "name"
      ],
      "type": "object"
    },
    "backfill": {
      "description": "A request to import a linked room's earlier messages.",
      "properties": {
        "requestedAt": {
          "description": "When an admin asked for the import. Messages after this were relayed live.",
          "format": "datetime",
          "type": "string"
        },
        "since": {
          "description": "The oldest message to import. Absent imports the room's whole history.",
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "requestedAt"
      ],
      "type": "object"
    },
    "backfillStatus": {
      "description": "Progress of a history import, as the bridge last reported it.",
      "properties": {
        "channel": {
          "description": "The linked channel being filled.",
          "format": "space-ref",
          "type": "string"
        },
        "from": {
          "description": "The start of the time range being imported.",
          "format": "datetime",
          "type": "string"
        },
        "imported": {
          "description": "How many messages the bridge has imported so far.",
          "minimum": 0,
          "type": "integer"
        },
        "reached": {
          "description": "When the newest imported message in the channel was sent.",
          "format": "datetime",
          "type": "string"
        },
        "requestedAt": {
          "description": "The request this status belongs to.",
          "format": "datetime",
          "type": "string"
        },
        "state": {
          "description": "How far the import is.",
          "knownValues": [
            "running",
            "done",
            "failed"
          ],
          "type": "string"
        },
        "until": {
          "description": "The end of the time range being imported.",
          "format": "datetime",
          "type": "string"
        },
        "updatedAt": {
          "description": "When the bridge last reported.",
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "channel",
        "requestedAt",
        "state",
        "imported",
        "from",
        "until",
        "updatedAt"
      ],
      "type": "object"
    },
    "bridgedActor": {
      "description": "Marks a profile view as someone on another service whose messages a bridge relays.",
      "properties": {
        "platform": {
          "description": "The service the person is on.",
          "maxLength": 64,
          "type": "string"
        },
        "registration": {
          "description": "Record key of the registration the record was written for.",
          "format": "tid",
          "type": "string"
        },
        "remoteId": {
          "description": "Their id on that service.",
          "maxLength": 256,
          "type": "string"
        }
      },
      "required": [
        "registration",
        "platform",
        "remoteId"
      ],
      "type": "object"
    },
    "bridgedReactor": {
      "description": "Someone on another service who reacted to a message through a bridge.",
      "properties": {
        "name": {
          "description": "Their display name on that service when they reacted.",
          "maxLength": 128,
          "type": "string"
        },
        "platform": {
          "description": "The service the person is on.",
          "maxLength": 64,
          "type": "string"
        },
        "registration": {
          "description": "Record key of the registration the reaction was written for.",
          "format": "tid",
          "type": "string"
        },
        "remoteId": {
          "description": "Their id on that service.",
          "maxLength": 256,
          "type": "string"
        }
      },
      "required": [
        "registration",
        "platform",
        "remoteId",
        "name"
      ],
      "type": "object"
    },
    "link": {
      "description": "A Colibri channel kept in sync with a room on another service.",
      "properties": {
        "backfill": {
          "description": "The latest history import an admin asked for.",
          "ref": "#backfill",
          "type": "ref"
        },
        "channel": {
          "description": "The Colibri channel.",
          "format": "space-ref",
          "type": "string"
        },
        "remoteName": {
          "description": "The room's name on the other service when the link was made.",
          "maxLength": 128,
          "type": "string"
        },
        "remoteRoom": {
          "description": "The id of the room on the other service.",
          "maxLength": 256,
          "type": "string"
        }
      },
      "required": [
        "channel",
        "remoteRoom",
        "remoteName"
      ],
      "type": "object"
    },
    "pairingView": {
      "description": "A pending pairing, shown to an admin before they confirm it.",
      "properties": {
        "bridge": {
          "description": "The bridge that asked to pair.",
          "format": "did",
          "type": "string"
        },
        "bridgeHandle": {
          "description": "The bridge's handle, when it resolves.",
          "format": "handle",
          "type": "string"
        },
        "expiresAt": {
          "description": "When the code stops working.",
          "format": "datetime",
          "type": "string"
        },
        "platform": {
          "description": "The service the bridge connects to.",
          "maxLength": 64,
          "type": "string"
        },
        "remoteSpace": {
          "description": "The id of the server, workspace or network on the other service.",
          "maxLength": 256,
          "type": "string"
        },
        "remoteSpaceName": {
          "description": "Its name on the other service.",
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "bridge",
        "platform",
        "remoteSpace",
        "remoteSpaceName",
        "expiresAt"
      ],
      "type": "object"
    },
    "registrationView": {
      "description": "A bridge registered with a community.",
      "properties": {
        "backfills": {
          "description": "Progress of each linked channel's latest history import.",
          "items": {
            "description": "A history import.",
            "ref": "#backfillStatus",
            "type": "ref"
          },
          "type": "array"
        },
        "bridge": {
          "description": "The bridge's DID.",
          "format": "did",
          "type": "string"
        },
        "bridgeHandle": {
          "description": "The bridge's handle, when it resolves.",
          "format": "handle",
          "type": "string"
        },
        "community": {
          "description": "The community the registration belongs to.",
          "format": "did",
          "type": "string"
        },
        "createdAt": {
          "description": "When the bridge was paired.",
          "format": "datetime",
          "type": "string"
        },
        "createdBy": {
          "description": "The admin who paired the bridge.",
          "format": "did",
          "type": "string"
        },
        "enabled": {
          "description": "Whether the bridge may currently write.",
          "type": "boolean"
        },
        "id": {
          "description": "Record key of the registration.",
          "format": "tid",
          "type": "string"
        },
        "links": {
          "description": "Channels kept in sync.",
          "items": {
            "description": "A linked channel.",
            "ref": "#link",
            "type": "ref"
          },
          "type": "array"
        },
        "mirrorModeration": {
          "description": "Whether moderation crosses the bridge. When on, hiding a bridged message removes its original on the other service, and a moderator removing a relayed message there hides it here.",
          "type": "boolean"
        },
        "platform": {
          "description": "The service the bridge connects to.",
          "maxLength": 64,
          "type": "string"
        },
        "remoteSpace": {
          "description": "The id of the server, workspace or network on the other service.",
          "maxLength": 256,
          "type": "string"
        },
        "remoteSpaceName": {
          "description": "Its name on the other service.",
          "maxLength": 128,
          "type": "string"
        },
        "updatedAt": {
          "description": "When the registration last changed.",
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "id",
        "community",
        "bridge",
        "platform",
        "remoteSpace",
        "remoteSpaceName",
        "links",
        "enabled",
        "createdBy",
        "createdAt"
      ],
      "type": "object"
    },
    "remoteAuthor": {
      "description": "The person on the other service a bridge is writing for.",
      "properties": {
        "avatar": {
          "accept": [
            "image/png",
            "image/jpeg",
            "image/gif",
            "image/webp"
          ],
          "description": "An avatar uploaded earlier with uploadBlob.",
          "maxSize": 1000000,
          "type": "blob"
        },
        "id": {
          "description": "The author's id on the other service.",
          "maxLength": 256,
          "type": "string"
        },
        "name": {
          "description": "The author's display name on the other service.",
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "type": "object"
    },
    "remoteRoom": {
      "description": "A room a bridge can see on the other service, offered to admins when linking channels.",
      "properties": {
        "id": {
          "description": "The room's id on the other service.",
          "maxLength": 256,
          "type": "string"
        },
        "kind": {
          "description": "What sort of room it is.",
          "knownValues": [
            "text",
            "voice",
            "announcement",
            "forum",
            "other"
          ],
          "type": "string"
        },
        "name": {
          "description": "The room's name.",
          "maxLength": 128,
          "type": "string"
        },
        "parent": {
          "description": "Name of the group or category the room sits in, if any.",
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "type": "object"
    }
  },
  "id": "social.colibri.beta.bridge.defs",
  "lexicon": 1
}
```
