# ai.newnal.illi.media.defs

- Kind: defs
- Authority: media.illi.newnal.ai
- Lexicon: 1
- Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.media.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.media.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.media.defs/analytics)

## #artworkEventSnapshot (`ai.newnal.illi.media.defs#artworkEventSnapshot`)

Type: object

Full media snapshot; additional fields are allowed and retained.

### Properties

- `artworkId` (string, required)
  - Constraints: minLength: 1
- `compositionVersion` (integer, required)
  - Constraints: minimum: 1
- `revision` (integer, required)
  - Constraints: minimum: 1
- `serviceKey` (string, required)
  - Constraints: minLength: 1
- `spaceKey` (string, required)
  - Constraints: minLength: 1

## #assetEventSnapshot (`ai.newnal.illi.media.defs#assetEventSnapshot`)

Type: object

Full media snapshot; additional fields are allowed and retained.

### Properties

- `assetId` (string, required)
  - Constraints: minLength: 1
- `externalAssetId` (string, required)
  - Constraints: minLength: 1
- `revision` (integer, required)
  - Constraints: minimum: 1
- `serviceKey` (string, required)
  - Constraints: minLength: 1
- `spaceKey` (string, required)
  - Constraints: minLength: 1

## #author (`ai.newnal.illi.media.defs#author`)

Type: object

### Properties

- `did` (string · did, required)

## #derivatives (`ai.newnal.illi.media.defs#derivatives`)

Type: object

### Properties

- `display` (boolean, required)
- `poster` (boolean, required)
- `thumb` (boolean, required)

## #itemView (`ai.newnal.illi.media.defs#itemView`)

Type: object

One album item. Derivatives are made by the media service after the upload and added later, so an item can be shown before they exist: until a photo's thumbnail exists thumbUrl is the original, and a video has no thumbUrl or posterUrl (show a placeholder). processing says whether more is coming.

### Properties

- `aiDescription` (string): Description written by AI analysis. Present once analysis has run; read-only.
- `aiTags` (array): Tags chosen by AI analysis. Present once analysis has run; read-only.
  - `items` (string)
- `author` (ref, required)
  - Reference: `#author`
- `cid` (string · cid, required)
- `createdAt` (string · datetime)
- `derivatives` (ref, required)
  - Reference: `#derivatives`
- `displayUrl` (string)
- `durationMs` (integer)
- `height` (integer)
- `kind` (string, required)
  - Constraints: knownValues: photo | video
- `mediaUrl` (string)
- `mimeType` (string)
- `note` (string)
  - Constraints: maxLength: 3000, maxGraphemes: 300
- `people` (array)
  - Constraints: maxLength: 20
  - `items` (ref)
    - Reference: `ai.newnal.illi.family.mediaItem#person`
- `posterUrl` (string): Video poster frame; absent until the media service has produced it.
- `processing` (string): pending: the media service has not yet finished the basic stages, so thumbnails, dimensions, capture time and similar values can still change. ready: the media service's results have been applied to the item (derivatives that do not apply to the item, such as a display rendition for a small photo, stay absent). failed: processing failed for this item; thumbnails will not arrive until it is retried. Not stored in the mediaItem record; clients tolerate unknown values.
  - Constraints: knownValues: pending | ready | failed
- `size` (integer)
- `takenAt` (string · datetime)
- `takenAtSource` (string): Capture-time source returned by media, including manual user correction.
  - Constraints: knownValues: exif | upload | manual | file_modified
- `takenDate` (string): Local date of capture time in the home time zone; show an upload-date badge when the source is upload.
  - Constraints: maxLength: 10
- `thumbUrl` (string): Thumbnail. A photo's original until its thumbnail exists; absent for a video until its thumbnail exists.
- `uri` (string · at-uri, required)
- `viewUrl` (string): displayUrl when a display rendition exists, else mediaUrl (photos); posterUrl or mediaUrl (videos).
- `width` (integer)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "artworkEventSnapshot": {
      "description": "Full media snapshot; additional fields are allowed and retained.",
      "properties": {
        "artworkId": {
          "minLength": 1,
          "type": "string"
        },
        "compositionVersion": {
          "minimum": 1,
          "type": "integer"
        },
        "revision": {
          "minimum": 1,
          "type": "integer"
        },
        "serviceKey": {
          "minLength": 1,
          "type": "string"
        },
        "spaceKey": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "serviceKey",
        "spaceKey",
        "revision",
        "artworkId",
        "compositionVersion"
      ],
      "type": "object"
    },
    "assetEventSnapshot": {
      "description": "Full media snapshot; additional fields are allowed and retained.",
      "properties": {
        "assetId": {
          "minLength": 1,
          "type": "string"
        },
        "externalAssetId": {
          "minLength": 1,
          "type": "string"
        },
        "revision": {
          "minimum": 1,
          "type": "integer"
        },
        "serviceKey": {
          "minLength": 1,
          "type": "string"
        },
        "spaceKey": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "serviceKey",
        "spaceKey",
        "revision",
        "assetId",
        "externalAssetId"
      ],
      "type": "object"
    },
    "author": {
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "derivatives": {
      "properties": {
        "display": {
          "type": "boolean"
        },
        "poster": {
          "type": "boolean"
        },
        "thumb": {
          "type": "boolean"
        }
      },
      "required": [
        "thumb",
        "display",
        "poster"
      ],
      "type": "object"
    },
    "itemView": {
      "description": "One album item. Derivatives are made by the media service after the upload and added later, so an item can be shown before they exist: until a photo's thumbnail exists thumbUrl is the original, and a video has no thumbUrl or posterUrl (show a placeholder). processing says whether more is coming.",
      "properties": {
        "aiDescription": {
          "description": "Description written by AI analysis. Present once analysis has run; read-only.",
          "type": "string"
        },
        "aiTags": {
          "description": "Tags chosen by AI analysis. Present once analysis has run; read-only.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "author": {
          "ref": "#author",
          "type": "ref"
        },
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "derivatives": {
          "ref": "#derivatives",
          "type": "ref"
        },
        "displayUrl": {
          "type": "string"
        },
        "durationMs": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "kind": {
          "knownValues": [
            "photo",
            "video"
          ],
          "type": "string"
        },
        "mediaUrl": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "note": {
          "maxGraphemes": 300,
          "maxLength": 3000,
          "type": "string"
        },
        "people": {
          "items": {
            "ref": "ai.newnal.illi.family.mediaItem#person",
            "type": "ref"
          },
          "maxLength": 20,
          "type": "array"
        },
        "posterUrl": {
          "description": "Video poster frame; absent until the media service has produced it.",
          "type": "string"
        },
        "processing": {
          "description": "pending: the media service has not yet finished the basic stages, so thumbnails, dimensions, capture time and similar values can still change. ready: the media service's results have been applied to the item (derivatives that do not apply to the item, such as a display rendition for a small photo, stay absent). failed: processing failed for this item; thumbnails will not arrive until it is retried. Not stored in the mediaItem record; clients tolerate unknown values.",
          "knownValues": [
            "pending",
            "ready",
            "failed"
          ],
          "type": "string"
        },
        "size": {
          "type": "integer"
        },
        "takenAt": {
          "format": "datetime",
          "type": "string"
        },
        "takenAtSource": {
          "description": "Capture-time source returned by media, including manual user correction.",
          "knownValues": [
            "exif",
            "upload",
            "manual",
            "file_modified"
          ],
          "type": "string"
        },
        "takenDate": {
          "description": "Local date of capture time in the home time zone; show an upload-date badge when the source is upload.",
          "maxLength": 10,
          "type": "string"
        },
        "thumbUrl": {
          "description": "Thumbnail. A photo's original until its thumbnail exists; absent for a video until its thumbnail exists.",
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        },
        "viewUrl": {
          "description": "displayUrl when a display rendition exists, else mediaUrl (photos); posterUrl or mediaUrl (videos).",
          "type": "string"
        },
        "width": {
          "type": "integer"
        }
      },
      "required": [
        "uri",
        "cid",
        "kind",
        "author",
        "derivatives"
      ],
      "type": "object"
    }
  },
  "id": "ai.newnal.illi.media.defs",
  "lexicon": 1
}
```
