# fyi.opensocial.defs

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.defs/examples)

## Definitions

### `fyi.opensocial.defs#actorView`

**Type**: `object`

A person, as a view names them: their handle from their DID document, their name and face from the Bluesky profile in their own repo.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `string` (uri) | No | Served renderably by the host, at /img/actor/{did}/{cid}. |
| `did` | `string` (did) | Yes |  |
| `displayName` | `string` | No |  |
| `handle` | `string` (handle) | No |  |

### `fyi.opensocial.defs#eventView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actor` | `string` (did) | No |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `note` | `string` | No |  |
| `reason` | `string` | No |  |
| `reasonType` | `string` | No |  |
| `type` | `string` | Yes |  |
| `val` | `string` | No |  |

### `fyi.opensocial.defs#groupRule`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | No |  |
| `rkey` | `string` | Yes |  |
| `text` | `string` | No |  |
| `title` | `string` | Yes |  |

### `fyi.opensocial.defs#groupView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `string` | No | CID of the avatar blob; the host serves it at /img/{did}/avatar. |
| `banner` | `string` | No | CID of the banner blob; the host serves it at /img/{did}/banner. |
| `deactivated` | `boolean` | No | Set while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on. |
| `description` | `string` | No |  |
| `did` | `string` (did) | Yes |  |
| `displayName` | `string` | No |  |
| `handle` | `string` (handle) | Yes |  |
| `joinPolicy` | `string` | No | How new members get in, as the profile states it. |
| `members` | `string` (space-ref) | Yes |  |
| `meta` | `string` (space-ref) | Yes |  |
| `rules` | `array` | No |  |
| `url` | `string` (uri) | No | The group's own site, if it keeps one. |

### `fyi.opensocial.defs#groupViewDetailed`

**Type**: `object`

A group in full, as the viewer may see it. Profile fields and rules are present only when the viewer may read the meta space.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `string` | No | CID of the avatar blob; the host serves it at /img/{did}/avatar. |
| `banner` | `string` | No | CID of the banner blob; the host serves it at /img/{did}/banner. |
| `deactivated` | `boolean` | No | Set while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on. |
| `description` | `string` | No |  |
| `did` | `string` (did) | Yes |  |
| `displayName` | `string` | No |  |
| `handle` | `string` (handle) | Yes |  |
| `joinPolicy` | `string` | No | How new members get in, as the profile states it. |
| `members` | `string` (space-ref) | Yes |  |
| `meta` | `string` (space-ref) | Yes |  |
| `rules` | `array` | No | In the order they are presented. Absent when the meta space is closed to the viewer. |
| `url` | `string` (uri) | No | The group's own site, if it keeps one. |
| `viewer` | `ref` → `#viewerState` | No |  |

### `fyi.opensocial.defs#inviteView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `expiresAt` | `string` (datetime) | No |  |
| `invitee` | `string` (did) | Yes |  |
| `message` | `string` | No |  |
| `uri` | `string` (at-uri) | Yes |  |

### `fyi.opensocial.defs#joinRequestView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actor` | `ref` → `#actorView` | No | Who is asking, as a view names them. |
| `createdAt` | `string` (datetime) | Yes |  |
| `did` | `string` (did) | Yes |  |
| `invite` | `string` (at-uri) | No |  |
| `message` | `string` | No |  |

### `fyi.opensocial.defs#memberView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actor` | `ref` → `#actorView` | Yes |  |
| `roles` | `array` | Yes |  |

### `fyi.opensocial.defs#roleView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `description` | `string` | No |  |
| `key` | `string` | Yes | The role id: its record key. |
| `name` | `string` | No |  |

### `fyi.opensocial.defs#spaceView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | No |  |
| `readableBy` | `array` | No | The space's read gate, when the viewer may read the space. |
| `type` | `string` (nsid) | Yes |  |
| `uri` | `string` (space-ref) | Yes |  |

### `fyi.opensocial.defs#subjectView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `lastReportedAt` | `string` (datetime) | No |  |
| `reportCount` | `integer` | No |  |
| `status` | `string` | Yes |  |
| `subject` | `string` (uri) | Yes | A record's at-uri, or an account's DID. |
| `updatedAt` | `string` (datetime) | No |  |

### `fyi.opensocial.defs#viewerState`

**Type**: `object`

The requesting account's standing in the group. Only present for authed requests.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `accepted` | `boolean` | No | For a member: whether their own acceptance is in the members space. |
| `actions` | `array` | Yes | The union of actions across the viewer's roles: what the host would let them do. |
| `member` | `boolean` | Yes |  |
| `request` | `ref` → `#joinRequestView` | No | The viewer's own pending request to join, when they are not a member and have one. |
| `roles` | `array` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "actorView": {
      "description": "A person, as a view names them: their handle from their DID document, their name and face from the Bluesky profile in their own repo.",
      "properties": {
        "avatar": {
          "description": "Served renderably by the host, at /img/actor/{did}/{cid}.",
          "format": "uri",
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "eventView": {
      "properties": {
        "actor": {
          "format": "did",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "reasonType": {
          "type": "string"
        },
        "type": {
          "knownValues": [
            "report",
            "label",
            "negate",
            "resolve",
            "escalate",
            "note",
            "eject"
          ],
          "type": "string"
        },
        "val": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "createdAt"
      ],
      "type": "object"
    },
    "groupRule": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "rkey": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "rkey",
        "title"
      ],
      "type": "object"
    },
    "groupView": {
      "properties": {
        "avatar": {
          "description": "CID of the avatar blob; the host serves it at /img/{did}/avatar.",
          "type": "string"
        },
        "banner": {
          "description": "CID of the banner blob; the host serves it at /img/{did}/banner.",
          "type": "string"
        },
        "deactivated": {
          "description": "Set while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on.",
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        },
        "joinPolicy": {
          "description": "How new members get in, as the profile states it.",
          "type": "string"
        },
        "members": {
          "format": "space-ref",
          "type": "string"
        },
        "meta": {
          "format": "space-ref",
          "type": "string"
        },
        "rules": {
          "items": {
            "ref": "#groupRule",
            "type": "ref"
          },
          "type": "array"
        },
        "url": {
          "description": "The group's own site, if it keeps one.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "did",
        "handle",
        "meta",
        "members"
      ],
      "type": "object"
    },
    "groupViewDetailed": {
      "description": "A group in full, as the viewer may see it. Profile fields and rules are present only when the viewer may read the meta space.",
      "properties": {
        "avatar": {
          "description": "CID of the avatar blob; the host serves it at /img/{did}/avatar.",
          "type": "string"
        },
        "banner": {
          "description": "CID of the banner blob; the host serves it at /img/{did}/banner.",
          "type": "string"
        },
        "deactivated": {
          "description": "Set while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on.",
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        },
        "joinPolicy": {
          "description": "How new members get in, as the profile states it.",
          "type": "string"
        },
        "members": {
          "format": "space-ref",
          "type": "string"
        },
        "meta": {
          "format": "space-ref",
          "type": "string"
        },
        "rules": {
          "description": "In the order they are presented. Absent when the meta space is closed to the viewer.",
          "items": {
            "ref": "#groupRule",
            "type": "ref"
          },
          "type": "array"
        },
        "url": {
          "description": "The group's own site, if it keeps one.",
          "format": "uri",
          "type": "string"
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref"
        }
      },
      "required": [
        "did",
        "handle",
        "meta",
        "members"
      ],
      "type": "object"
    },
    "inviteView": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "expiresAt": {
          "format": "datetime",
          "type": "string"
        },
        "invitee": {
          "format": "did",
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "invitee",
        "createdAt"
      ],
      "type": "object"
    },
    "joinRequestView": {
      "properties": {
        "actor": {
          "description": "Who is asking, as a view names them.",
          "ref": "#actorView",
          "type": "ref"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "invite": {
          "format": "at-uri",
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "did",
        "createdAt"
      ],
      "type": "object"
    },
    "memberView": {
      "properties": {
        "actor": {
          "ref": "#actorView",
          "type": "ref"
        },
        "roles": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "actor",
        "roles"
      ],
      "type": "object"
    },
    "roleView": {
      "properties": {
        "description": {
          "type": "string"
        },
        "key": {
          "description": "The role id: its record key.",
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "key"
      ],
      "type": "object"
    },
    "spaceView": {
      "properties": {
        "name": {
          "type": "string"
        },
        "readableBy": {
          "description": "The space's read gate, when the viewer may read the space.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "type": {
          "format": "nsid",
          "type": "string"
        },
        "uri": {
          "format": "space-ref",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "type"
      ],
      "type": "object"
    },
    "subjectView": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "lastReportedAt": {
          "format": "datetime",
          "type": "string"
        },
        "reportCount": {
          "type": "integer"
        },
        "status": {
          "knownValues": [
            "open",
            "escalated",
            "resolved"
          ],
          "type": "string"
        },
        "subject": {
          "description": "A record's at-uri, or an account's DID.",
          "format": "uri",
          "type": "string"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "subject",
        "status",
        "createdAt"
      ],
      "type": "object"
    },
    "viewerState": {
      "description": "The requesting account's standing in the group. Only present for authed requests.",
      "properties": {
        "accepted": {
          "description": "For a member: whether their own acceptance is in the members space.",
          "type": "boolean"
        },
        "actions": {
          "description": "The union of actions across the viewer's roles: what the host would let them do.",
          "items": {
            "ref": "fyi.opensocial.permissions#action",
            "type": "ref"
          },
          "type": "array"
        },
        "member": {
          "type": "boolean"
        },
        "request": {
          "description": "The viewer's own pending request to join, when they are not a member and have one.",
          "ref": "#joinRequestView",
          "type": "ref"
        },
        "roles": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "member",
        "roles",
        "actions"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.defs",
  "lexicon": 1
}
```
