···11+import { lx } from 'prototypey'
22+import { MB } from '../constants.ts'
33+44+export const siteStandardDocument = lx.lexicon('site.standard.document', {
55+ main: lx.record({
66+ key: 'tid',
77+ type: 'record',
88+ record: lx.object({
99+ site: lx.string({
1010+ required: true,
1111+ format: 'uri',
1212+ description: 'Required URI for parent site or publication (https:// or at://). Use https:// for loose documents. Avoid trailing slashes.'
1313+ }),
1414+ path: lx.string({
1515+ description: 'Optional path, combined with site or publication url value to construct a full url to the document. Prepend with a leading slash.'
1616+ }),
1717+ title: lx.string({
1818+ required: true,
1919+ maxLength: 1280,
2020+ maxGraphemes: 128,
2121+ description: 'Required title of the document.'
2222+ }),
2323+ description: lx.string({
2424+ maxLength: 3000,
2525+ maxGraphemes: 300,
2626+ description: 'Optional brief description or expert of the document.'
2727+ }),
2828+ coverImage: lx.blob({
2929+ maxSize: 1 * MB,
3030+ accept: ['image/*'],
3131+ description: 'Optional image to use as the documents cover. Less than 1MB is size.'
3232+ }),
3333+ content: lx.union([], {
3434+ closed: false,
3535+ description: 'Optional open union to construct content within the record. Can be extended with other lexicons to define any content format.'
3636+ }),
3737+ textContent: lx.string({
3838+ description: 'Optional plaintext representation of the documents contents. Useful for search and other cases.'
3939+ }),
4040+ bskyPostRef: lx.ref('com.atproto.repo.strongRef', {
4141+ description: 'Optional strong reference to a Bluesky post. Useful to keep track of comments off-platform.'
4242+ }),
4343+ tags: lx.array({
4444+ type: 'string',
4545+ }, {
4646+ maxLength: 100,
4747+ description: 'Optional array of strings used to tag/categorize the document. Avoid prepending tags with hashtags ("#").'
4848+ }),
4949+ publishedAt: lx.string({
5050+ required: true,
5151+ format: 'datetime',
5252+ description: 'Required timestamp of the documents publication.'
5353+ }),
5454+ updatedAt: lx.string({
5555+ format: 'datetime',
5656+ description: 'Optional timestamp of the documents last edit.'
5757+ })
5858+ }),
5959+ })
6060+})