# town.delve.draft.defs

> Published by [delve.town](https://lexicon.garden/identity/did:plc:qzqct2rrq4u2gmy5g3mjxske)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:qzqct2rrq4u2gmy5g3mjxske/town.delve.draft.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:qzqct2rrq4u2gmy5g3mjxske/town.delve.draft.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:qzqct2rrq4u2gmy5g3mjxske/town.delve.draft.defs/examples)

## Definitions

### `town.delve.draft.defs#draft`

**Type**: `object`

A draft containing an array of draft posts.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `deviceId` | `string` | No | UUIDv4 identifier of the device that created this draft. |
| `deviceName` | `string` | No | The device and/or platform on which the draft was created. |
| `langs` | `array` | No | Indicates human language of posts primary text content. |
| `postgateEmbeddingRules` | `array` | No | Embedding rules for the postgates to be created when this draft is published. |
| `posts` | `array` | Yes | Array of draft posts that compose this draft. |
| `threadgateAllow` | `array` | No | Allow-rules for the threadgate to be created when this draft is published. |

### `town.delve.draft.defs#draftEmbedCaption`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `content` | `string` | Yes |  |
| `lang` | `string` (language) | Yes |  |

### `town.delve.draft.defs#draftEmbedExternal`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (uri) | Yes |  |

### `town.delve.draft.defs#draftEmbedGallery`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `items` | `ref` → `#draftEmbedGalleryItems` | Yes |  |

### `town.delve.draft.defs#draftEmbedGalleryItems`

**Type**: `array`

The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.

**Items**:

Type: `union`

**Constraints**: maxLength: 20

### `town.delve.draft.defs#draftEmbedImage`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `alt` | `string` | No |  |
| `localRef` | `ref` → `#draftEmbedLocalRef` | Yes |  |

### `town.delve.draft.defs#draftEmbedLocalRef`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `path` | `string` | Yes | Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts. |

### `town.delve.draft.defs#draftEmbedRecord`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `record` | `ref` → `com.atproto.repo.strongRef` | Yes |  |

### `town.delve.draft.defs#draftEmbedVideo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `alt` | `string` | No |  |
| `captions` | `array` | No |  |
| `localRef` | `ref` → `#draftEmbedLocalRef` | Yes |  |

### `town.delve.draft.defs#draftPost`

**Type**: `object`

One of the posts that compose a draft.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `embedExternals` | `array` | No |  |
| `embedGallery` | `ref` → `#draftEmbedGallery` | No |  |
| `embedImages` | `array` | No |  |
| `embedRecords` | `array` | No |  |
| `embedVideos` | `array` | No |  |
| `labels` | `union` | No | Self-label values for this post. Effectively content warnings. |
| `text` | `string` | Yes | The primary post content. It has a higher limit than post contents to allow storing a larger text that can later be refined into smaller posts. |

### `town.delve.draft.defs#draftView`

**Type**: `object`

View to present drafts data to users.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes | The time the draft was created. |
| `draft` | `ref` → `#draft` | Yes |  |
| `id` | `string` (tid) | Yes | A TID to be used as a draft identifier. |
| `updatedAt` | `string` (datetime) | Yes | The time the draft was last updated. |

### `town.delve.draft.defs#draftWithId`

**Type**: `object`

A draft with an identifier, used to store drafts in private storage (stash).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `draft` | `ref` → `#draft` | Yes |  |
| `id` | `string` (tid) | Yes | A TID to be used as a draft identifier. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "draft": {
      "description": "A draft containing an array of draft posts.",
      "properties": {
        "deviceId": {
          "description": "UUIDv4 identifier of the device that created this draft.",
          "maxLength": 100,
          "type": "string"
        },
        "deviceName": {
          "description": "The device and/or platform on which the draft was created.",
          "maxLength": 100,
          "type": "string"
        },
        "langs": {
          "description": "Indicates human language of posts primary text content.",
          "items": {
            "format": "language",
            "type": "string"
          },
          "maxLength": 3,
          "type": "array"
        },
        "postgateEmbeddingRules": {
          "description": "Embedding rules for the postgates to be created when this draft is published.",
          "items": {
            "refs": [
              "town.delve.feed.postgate#disableRule"
            ],
            "type": "union"
          },
          "maxLength": 5,
          "type": "array"
        },
        "posts": {
          "description": "Array of draft posts that compose this draft.",
          "items": {
            "ref": "#draftPost",
            "type": "ref"
          },
          "maxLength": 100,
          "minLength": 1,
          "type": "array"
        },
        "threadgateAllow": {
          "description": "Allow-rules for the threadgate to be created when this draft is published.",
          "items": {
            "refs": [
              "town.delve.feed.threadgate#mentionRule",
              "town.delve.feed.threadgate#followerRule",
              "town.delve.feed.threadgate#followingRule",
              "town.delve.feed.threadgate#listRule"
            ],
            "type": "union"
          },
          "maxLength": 5,
          "type": "array"
        }
      },
      "required": [
        "posts"
      ],
      "type": "object"
    },
    "draftEmbedCaption": {
      "properties": {
        "content": {
          "maxLength": 10000,
          "type": "string"
        },
        "lang": {
          "format": "language",
          "type": "string"
        }
      },
      "required": [
        "lang",
        "content"
      ],
      "type": "object"
    },
    "draftEmbedExternal": {
      "properties": {
        "uri": {
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "uri"
      ],
      "type": "object"
    },
    "draftEmbedGallery": {
      "properties": {
        "items": {
          "ref": "#draftEmbedGalleryItems",
          "type": "ref"
        }
      },
      "required": [
        "items"
      ],
      "type": "object"
    },
    "draftEmbedGalleryItems": {
      "description": "The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.",
      "items": {
        "refs": [
          "#draftEmbedImage"
        ],
        "type": "union"
      },
      "maxLength": 20,
      "type": "array"
    },
    "draftEmbedImage": {
      "properties": {
        "alt": {
          "maxGraphemes": 2000,
          "type": "string"
        },
        "localRef": {
          "ref": "#draftEmbedLocalRef",
          "type": "ref"
        }
      },
      "required": [
        "localRef"
      ],
      "type": "object"
    },
    "draftEmbedLocalRef": {
      "properties": {
        "path": {
          "description": "Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts.",
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path"
      ],
      "type": "object"
    },
    "draftEmbedRecord": {
      "properties": {
        "record": {
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        }
      },
      "required": [
        "record"
      ],
      "type": "object"
    },
    "draftEmbedVideo": {
      "properties": {
        "alt": {
          "maxGraphemes": 2000,
          "type": "string"
        },
        "captions": {
          "items": {
            "ref": "#draftEmbedCaption",
            "type": "ref"
          },
          "maxLength": 20,
          "type": "array"
        },
        "localRef": {
          "ref": "#draftEmbedLocalRef",
          "type": "ref"
        }
      },
      "required": [
        "localRef"
      ],
      "type": "object"
    },
    "draftPost": {
      "description": "One of the posts that compose a draft.",
      "properties": {
        "embedExternals": {
          "items": {
            "ref": "#draftEmbedExternal",
            "type": "ref"
          },
          "maxLength": 1,
          "type": "array"
        },
        "embedGallery": {
          "ref": "#draftEmbedGallery",
          "type": "ref"
        },
        "embedImages": {
          "items": {
            "ref": "#draftEmbedImage",
            "type": "ref"
          },
          "maxLength": 4,
          "type": "array"
        },
        "embedRecords": {
          "items": {
            "ref": "#draftEmbedRecord",
            "type": "ref"
          },
          "maxLength": 1,
          "type": "array"
        },
        "embedVideos": {
          "items": {
            "ref": "#draftEmbedVideo",
            "type": "ref"
          },
          "maxLength": 1,
          "type": "array"
        },
        "labels": {
          "description": "Self-label values for this post. Effectively content warnings.",
          "refs": [
            "com.atproto.label.defs#selfLabels"
          ],
          "type": "union"
        },
        "text": {
          "description": "The primary post content. It has a higher limit than post contents to allow storing a larger text that can later be refined into smaller posts.",
          "maxGraphemes": 100000,
          "maxLength": 500000,
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    },
    "draftView": {
      "description": "View to present drafts data to users.",
      "properties": {
        "createdAt": {
          "description": "The time the draft was created.",
          "format": "datetime",
          "type": "string"
        },
        "draft": {
          "ref": "#draft",
          "type": "ref"
        },
        "id": {
          "description": "A TID to be used as a draft identifier.",
          "format": "tid",
          "type": "string"
        },
        "updatedAt": {
          "description": "The time the draft was last updated.",
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "id",
        "draft",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "draftWithId": {
      "description": "A draft with an identifier, used to store drafts in private storage (stash).",
      "properties": {
        "draft": {
          "ref": "#draft",
          "type": "ref"
        },
        "id": {
          "description": "A TID to be used as a draft identifier.",
          "format": "tid",
          "type": "string"
        }
      },
      "required": [
        "id",
        "draft"
      ],
      "type": "object"
    }
  },
  "id": "town.delve.draft.defs",
  "lexicon": 1
}
```
