# social.coves.community.defs

> Published by [coves.social](https://lexicon.garden/identity/did:web:coves.social)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.community.defs)
- [Documentation](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.community.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.community.defs/examples)

## Definitions

### `social.coves.community.defs#viewerState`

**Type**: `object`

The viewing user's relationship to this community

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `banUri` | `string` (at-uri) | No | AT-URI of the ban record if viewer is banned |
| `banned` | `boolean` | No | Whether the viewer is banned from this community |
| `member` | `boolean` | No | Whether the viewer has membership status (AppView-computed) |
| `creator` | `boolean` | No | Whether the viewer created this community |
| `moderator` | `boolean` | No | Whether the viewer is a moderator of this community |
| `reputation` | `integer` | No | Viewer's reputation in this community |
| `subscribed` | `boolean` | No | Whether the viewer is subscribed to this community |
| `subscriptionUri` | `string` (at-uri) | No | AT-URI of the viewer's subscription record if subscribed |

### `social.coves.community.defs#communityView`

**Type**: `object`

Basic community view with essential information and basic stats

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | DID of the community |
| `name` | `string` | Yes | Short community name |
| `avatar` | `string` (uri) | No | URL to community avatar image |
| `handle` | `string` (handle) | No | Current handle resolved from DID |
| `viewer` | `object` | No | Simplified viewer state for list views |
| `postCount` | `integer` | No | Total number of posts in the community |
| `visibility` | `string` | No | Community visibility level |
| `displayName` | `string` | No | Display name for the community |
| `memberCount` | `integer` | No | Number of users with formal membership status |
| `subscriberCount` | `integer` | No | Total number of subscribers |

### `social.coves.community.defs#communityStats`

**Type**: `object`

Aggregated statistics for a community

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `postCount` | `integer` | No | Total number of posts in the community |
| `memberCount` | `integer` | No | Number of users with formal membership status |
| `commentCount` | `integer` | No | Total number of comments across all posts |
| `moderatorCount` | `integer` | No | Number of active moderators |
| `activeUserCount` | `integer` | No | Number of users active in the last 30 days |
| `subscriberCount` | `integer` | No | Total number of subscribers |
| `activePostersCount` | `integer` | No | Number of unique posters in the last 30 days |

### `social.coves.community.defs#communityViewDetailed`

**Type**: `object`

Detailed community view with stats and viewer state

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | DID of the community |
| `name` | `string` | Yes | Short community name |
| `stats` | `ref` → `#communityStats` | No | Aggregated community statistics |
| `avatar` | `string` (uri) | No | URL to community avatar image |
| `banner` | `string` (uri) | No | URL to community banner image |
| `handle` | `string` (handle) | No | Current handle resolved from DID |
| `viewer` | `ref` → `#viewerState` | No | Viewer's relationship to this community |
| `hostedBy` | `string` (did) | No | DID of the instance hosting this community |
| `createdAt` | `string` (datetime) | No |  |
| `createdBy` | `string` (did) | No | DID of the user who created this community |
| `visibility` | `string` | No | Community visibility level |
| `description` | `string` | No | Community description with rich text support |
| `displayName` | `string` | No | Display name for the community |
| `moderationType` | `string` | No | Type of moderation system |
| `contentWarnings` | `array` | No | Required content warnings for this community |
| `createdByProfile` | `ref` → `social.coves.actor.defs#profileView` | No | Profile of the community creator |
| `descriptionFacets` | `array` | No | Rich text annotations for description |

## Raw Schema

```json
{
  "id": "social.coves.community.defs",
  "defs": {
    "viewerState": {
      "type": "object",
      "properties": {
        "banUri": {
          "type": "string",
          "format": "at-uri",
          "description": "AT-URI of the ban record if viewer is banned"
        },
        "banned": {
          "type": "boolean",
          "description": "Whether the viewer is banned from this community"
        },
        "member": {
          "type": "boolean",
          "description": "Whether the viewer has membership status (AppView-computed)"
        },
        "creator": {
          "type": "boolean",
          "description": "Whether the viewer created this community"
        },
        "moderator": {
          "type": "boolean",
          "description": "Whether the viewer is a moderator of this community"
        },
        "reputation": {
          "type": "integer",
          "description": "Viewer's reputation in this community"
        },
        "subscribed": {
          "type": "boolean",
          "description": "Whether the viewer is subscribed to this community"
        },
        "subscriptionUri": {
          "type": "string",
          "format": "at-uri",
          "description": "AT-URI of the viewer's subscription record if subscribed"
        }
      },
      "description": "The viewing user's relationship to this community"
    },
    "communityView": {
      "type": "object",
      "required": [
        "did",
        "name"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "DID of the community"
        },
        "name": {
          "type": "string",
          "maxLength": 63,
          "description": "Short community name"
        },
        "avatar": {
          "type": "string",
          "format": "uri",
          "description": "URL to community avatar image"
        },
        "handle": {
          "type": "string",
          "format": "handle",
          "description": "Current handle resolved from DID"
        },
        "viewer": {
          "type": "object",
          "properties": {
            "member": {
              "type": "boolean",
              "description": "Whether the viewer has membership status"
            },
            "subscribed": {
              "type": "boolean",
              "description": "Whether the viewer is subscribed"
            }
          },
          "description": "Simplified viewer state for list views"
        },
        "postCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of posts in the community"
        },
        "visibility": {
          "type": "string",
          "maxLength": 64,
          "description": "Community visibility level",
          "knownValues": [
            "public",
            "unlisted",
            "private"
          ]
        },
        "displayName": {
          "type": "string",
          "maxLength": 1280,
          "description": "Display name for the community",
          "maxGraphemes": 128
        },
        "memberCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of users with formal membership status"
        },
        "subscriberCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of subscribers"
        }
      },
      "description": "Basic community view with essential information and basic stats"
    },
    "communityStats": {
      "type": "object",
      "properties": {
        "postCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of posts in the community"
        },
        "memberCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of users with formal membership status"
        },
        "commentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of comments across all posts"
        },
        "moderatorCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of active moderators"
        },
        "activeUserCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of users active in the last 30 days"
        },
        "subscriberCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of subscribers"
        },
        "activePostersCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of unique posters in the last 30 days"
        }
      },
      "description": "Aggregated statistics for a community"
    },
    "communityViewDetailed": {
      "type": "object",
      "required": [
        "did",
        "name"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "DID of the community"
        },
        "name": {
          "type": "string",
          "maxLength": 63,
          "description": "Short community name"
        },
        "stats": {
          "ref": "#communityStats",
          "type": "ref",
          "description": "Aggregated community statistics"
        },
        "avatar": {
          "type": "string",
          "format": "uri",
          "description": "URL to community avatar image"
        },
        "banner": {
          "type": "string",
          "format": "uri",
          "description": "URL to community banner image"
        },
        "handle": {
          "type": "string",
          "format": "handle",
          "description": "Current handle resolved from DID"
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref",
          "description": "Viewer's relationship to this community"
        },
        "hostedBy": {
          "type": "string",
          "format": "did",
          "description": "DID of the instance hosting this community"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime"
        },
        "createdBy": {
          "type": "string",
          "format": "did",
          "description": "DID of the user who created this community"
        },
        "visibility": {
          "type": "string",
          "maxLength": 64,
          "description": "Community visibility level",
          "knownValues": [
            "public",
            "unlisted",
            "private"
          ]
        },
        "description": {
          "type": "string",
          "maxLength": 10000,
          "description": "Community description with rich text support",
          "maxGraphemes": 1000
        },
        "displayName": {
          "type": "string",
          "maxLength": 1280,
          "description": "Display name for the community",
          "maxGraphemes": 128
        },
        "moderationType": {
          "type": "string",
          "maxLength": 64,
          "description": "Type of moderation system",
          "knownValues": [
            "moderator",
            "sortition"
          ]
        },
        "contentWarnings": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 32,
            "knownValues": [
              "nsfw",
              "violence",
              "spoilers"
            ]
          },
          "description": "Required content warnings for this community"
        },
        "createdByProfile": {
          "ref": "social.coves.actor.defs#profileView",
          "type": "ref",
          "description": "Profile of the community creator"
        },
        "descriptionFacets": {
          "type": "array",
          "items": {
            "ref": "social.coves.richtext.facet",
            "type": "ref"
          },
          "description": "Rich text annotations for description"
        }
      },
      "description": "Detailed community view with stats and viewer state"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
