# social.grain.group.defs

- Kind: defs
- Authority: group.grain.social
- Lexicon: 1
- Published by [grain.social](https://lexicon.garden/identity/did:plc:e7rftrdyz5e2rw4y6ocszew2), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.group.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.group.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.group.defs/analytics)

## #galleryItem (`social.grain.group.defs#galleryItem`)

Type: object

### Properties

- `alt` (string)
- `aspectRatio` (ref)
  - Reference: `social.grain.defs#aspectRatio`
- `cid` (string · cid, required): Blob CID. Fetch through the space, never the CDN.
- `did` (string · did, required): Repo holding the photo, and its blob.
- `position` (integer, required)
- `uri` (string, required): Space URI of the photo record.

## #galleryRecord (`social.grain.group.defs#galleryRecord`)

Type: object

### Properties

- `createdAt` (string · datetime)
- `description` (string)
- `title` (string, required)
- `uri` (string · at-uri, required)

## #groupRef (`social.grain.group.defs#groupRef`)

Type: object

### Properties

- `did` (string · did, required)
- `displayName` (string)
- `handle` (string, required)
- `item` (string · at-uri, required): The social.grain.group.item that pools this gallery.

## #groupView (`social.grain.group.defs#groupView`)

Type: object

### Properties

- `avatar` (string · uri)
- `description` (string)
- `did` (string · did, required)
- `displayName` (string)
- `handle` (string, required)
- `joinPolicy` (string): How to get in, from the group's public profile.
  - Constraints: knownValues: open | request | invite
- `lastActivityAt` (string · datetime): When the pool last changed.
- `pendingCount` (integer): Submissions awaiting review. Only present for a viewer acting as the group.
- `poolCount` (integer): Galleries in the pool.
- `rules` (array)
  - `items` (ref)
    - Reference: `#rule`
- `url` (string · uri): The group's own site, from its opensocial profile. Where the group is actually run.
- `viewer` (ref)
  - Reference: `#viewerState`

## #photoInput (`social.grain.group.defs#photoInput`)

Type: object

### Properties

- `alt` (string)
- `aspectRatio` (ref, required)
  - Reference: `social.grain.defs#aspectRatio`
- `photo` (blob, required)
  - Constraints: maxSize: 1000000, accept: image/*

## #poolAuthor (`social.grain.group.defs#poolAuthor`)

Type: object

### Properties

- `avatar` (string)
- `avatarThumb` (string): The avatar drawn small, 144 pixels square, for faces in lines and lists.
- `did` (string · did, required)
- `displayName` (string)
- `handle` (string)

## #poolComment (`social.grain.group.defs#poolComment`)

Type: object

### Properties

- `author` (ref, required)
  - Reference: `#poolAuthor`
- `createdAt` (string · datetime)
- `facets` (array)
  - `items` (ref)
    - Reference: `app.bsky.richtext.facet`
- `replyTo` (string · at-uri)
- `rkey` (string, required)
- `text` (string, required)
- `uri` (string · at-uri, required)

## #poolFeedItem (`social.grain.group.defs#poolFeedItem`)

Type: object

### Properties

- `avatar` (string): The author's Grain profile picture, a public record of their own.
- `avatarThumb` (string): The author's Grain profile picture drawn small, 144 pixels square, for faces in lines and lists.
- `commentCount` (integer)
- `createdAt` (string · datetime)
- `description` (string)
- `did` (string · did, required): Whose gallery it is.
- `displayName` (string)
- `favCount` (integer)
- `group` (string · did, required): Whose pool it is in.
- `handle` (string)
- `items` (array, required)
  - `items` (ref)
    - Reference: `#galleryItem`
- `photoCount` (integer, required)
- `rkey` (string, required)
- `space` (string, required)
- `title` (string, required)
- `uri` (string · at-uri): What a favourite or a comment names.
- `viewerFav` (string)

## #poolGallery (`social.grain.group.defs#poolGallery`)

Type: object

### Properties

- `avatar` (string): The author's Grain profile picture, a public record of their own.
- `avatarThumb` (string): The author's Grain profile picture drawn small, 144 pixels square, for faces in lines and lists.
- `commentCount` (integer)
- `cover` (ref)
  - Reference: `#galleryItem`
- `createdAt` (string · datetime)
- `description` (string)
- `did` (string · did, required): Whose gallery it is.
- `displayName` (string)
- `favCount` (integer)
- `handle` (string)
- `photoCount` (integer, required)
- `rkey` (string, required)
- `space` (string, required)
- `title` (string, required)
- `uri` (string · at-uri): What a favourite or a comment names.
- `viewerFav` (string)

## #rule (`social.grain.group.defs#rule`)

Type: object

### Properties

- `text` (string)
- `title` (string, required)
- `uri` (string · at-uri, required)

## #submissionState (`social.grain.group.defs#submissionState`)

Type: object

### Properties

- `item` (string · at-uri): The group's item record, once accepted.
- `status` (string, required)
  - Constraints: knownValues: pending | accepted | declined
- `uri` (string · at-uri, required): The submission record.

## #submissionView (`social.grain.group.defs#submissionView`)

Type: object

### Properties

- `cid` (string · cid, required)
- `createdAt` (string · datetime, required)
- `gallery` (ref, required)
  - Reference: `social.grain.gallery.defs#galleryView`
- `group` (string · did, required)
- `uri` (string · at-uri, required)

## #viewerState (`social.grain.group.defs#viewerState`)

Type: object

### Properties

- `acting` (boolean): The viewer is signed in as this group, so may accept and remove.
- `member` (boolean): The viewer has accepted membership of this group, as their own PDS lists it. A claim, not access: the host decides that.
- `submission` (ref): The viewer's standing for the gallery named in the request, if one was.
  - Reference: `#submissionState`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "galleryItem": {
      "properties": {
        "alt": {
          "type": "string"
        },
        "aspectRatio": {
          "ref": "social.grain.defs#aspectRatio",
          "type": "ref"
        },
        "cid": {
          "description": "Blob CID. Fetch through the space, never the CDN.",
          "format": "cid",
          "type": "string"
        },
        "did": {
          "description": "Repo holding the photo, and its blob.",
          "format": "did",
          "type": "string"
        },
        "position": {
          "type": "integer"
        },
        "uri": {
          "description": "Space URI of the photo record.",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "did",
        "cid",
        "position"
      ],
      "type": "object"
    },
    "galleryRecord": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "title"
      ],
      "type": "object"
    },
    "groupRef": {
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "type": "string"
        },
        "item": {
          "description": "The social.grain.group.item that pools this gallery.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "did",
        "handle",
        "item"
      ],
      "type": "object"
    },
    "groupView": {
      "properties": {
        "avatar": {
          "format": "uri",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "type": "string"
        },
        "joinPolicy": {
          "description": "How to get in, from the group's public profile.",
          "knownValues": [
            "open",
            "request",
            "invite"
          ],
          "type": "string"
        },
        "lastActivityAt": {
          "description": "When the pool last changed.",
          "format": "datetime",
          "type": "string"
        },
        "pendingCount": {
          "description": "Submissions awaiting review. Only present for a viewer acting as the group.",
          "type": "integer"
        },
        "poolCount": {
          "description": "Galleries in the pool.",
          "type": "integer"
        },
        "rules": {
          "items": {
            "ref": "#rule",
            "type": "ref"
          },
          "type": "array"
        },
        "url": {
          "description": "The group's own site, from its opensocial profile. Where the group is actually run.",
          "format": "uri",
          "type": "string"
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref"
        }
      },
      "required": [
        "did",
        "handle"
      ],
      "type": "object"
    },
    "photoInput": {
      "properties": {
        "alt": {
          "type": "string"
        },
        "aspectRatio": {
          "ref": "social.grain.defs#aspectRatio",
          "type": "ref"
        },
        "photo": {
          "accept": [
            "image/*"
          ],
          "maxSize": 1000000,
          "type": "blob"
        }
      },
      "required": [
        "photo",
        "aspectRatio"
      ],
      "type": "object"
    },
    "poolAuthor": {
      "properties": {
        "avatar": {
          "type": "string"
        },
        "avatarThumb": {
          "description": "The avatar drawn small, 144 pixels square, for faces in lines and lists.",
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "poolComment": {
      "properties": {
        "author": {
          "ref": "#poolAuthor",
          "type": "ref"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "facets": {
          "items": {
            "ref": "app.bsky.richtext.facet",
            "type": "ref"
          },
          "type": "array"
        },
        "replyTo": {
          "format": "at-uri",
          "type": "string"
        },
        "rkey": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "rkey",
        "text",
        "author"
      ],
      "type": "object"
    },
    "poolFeedItem": {
      "properties": {
        "avatar": {
          "description": "The author's Grain profile picture, a public record of their own.",
          "type": "string"
        },
        "avatarThumb": {
          "description": "The author's Grain profile picture drawn small, 144 pixels square, for faces in lines and lists.",
          "type": "string"
        },
        "commentCount": {
          "type": "integer"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "description": "Whose gallery it is.",
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "favCount": {
          "type": "integer"
        },
        "group": {
          "description": "Whose pool it is in.",
          "format": "did",
          "type": "string"
        },
        "handle": {
          "type": "string"
        },
        "items": {
          "items": {
            "ref": "#galleryItem",
            "type": "ref"
          },
          "type": "array"
        },
        "photoCount": {
          "type": "integer"
        },
        "rkey": {
          "type": "string"
        },
        "space": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uri": {
          "description": "What a favourite or a comment names.",
          "format": "at-uri",
          "type": "string"
        },
        "viewerFav": {
          "type": "string"
        }
      },
      "required": [
        "space",
        "group",
        "did",
        "rkey",
        "title",
        "photoCount",
        "items"
      ],
      "type": "object"
    },
    "poolGallery": {
      "properties": {
        "avatar": {
          "description": "The author's Grain profile picture, a public record of their own.",
          "type": "string"
        },
        "avatarThumb": {
          "description": "The author's Grain profile picture drawn small, 144 pixels square, for faces in lines and lists.",
          "type": "string"
        },
        "commentCount": {
          "type": "integer"
        },
        "cover": {
          "ref": "#galleryItem",
          "type": "ref"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "description": "Whose gallery it is.",
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "favCount": {
          "type": "integer"
        },
        "handle": {
          "type": "string"
        },
        "photoCount": {
          "type": "integer"
        },
        "rkey": {
          "type": "string"
        },
        "space": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uri": {
          "description": "What a favourite or a comment names.",
          "format": "at-uri",
          "type": "string"
        },
        "viewerFav": {
          "type": "string"
        }
      },
      "required": [
        "space",
        "did",
        "rkey",
        "title",
        "photoCount"
      ],
      "type": "object"
    },
    "rule": {
      "properties": {
        "text": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "title"
      ],
      "type": "object"
    },
    "submissionState": {
      "properties": {
        "item": {
          "description": "The group's item record, once accepted.",
          "format": "at-uri",
          "type": "string"
        },
        "status": {
          "knownValues": [
            "pending",
            "accepted",
            "declined"
          ],
          "type": "string"
        },
        "uri": {
          "description": "The submission record.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "status"
      ],
      "type": "object"
    },
    "submissionView": {
      "properties": {
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "gallery": {
          "ref": "social.grain.gallery.defs#galleryView",
          "type": "ref"
        },
        "group": {
          "format": "did",
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "group",
        "gallery",
        "createdAt"
      ],
      "type": "object"
    },
    "viewerState": {
      "properties": {
        "acting": {
          "description": "The viewer is signed in as this group, so may accept and remove.",
          "type": "boolean"
        },
        "member": {
          "description": "The viewer has accepted membership of this group, as their own PDS lists it. A claim, not access: the host decides that.",
          "type": "boolean"
        },
        "submission": {
          "description": "The viewer's standing for the gallery named in the request, if one was.",
          "ref": "#submissionState",
          "type": "ref"
        }
      },
      "type": "object"
    }
  },
  "id": "social.grain.group.defs",
  "lexicon": 1
}
```
