···11+import { lx } from "prototypey";
22+import { MB } from "../constants.ts";
33+44+export const siteStandardAuthor = lx.lexicon("site.standard.author", {
55+ main: lx.record({
66+ key: "tid",
77+ type: "record",
88+ record: lx.object({
99+ name: lx.string({
1010+ required: true,
1111+ description: "Full name of the author.",
1212+ }),
1313+ title: lx.string({
1414+ maxLength: 1280,
1515+ maxGraphemes: 128,
1616+ description:
1717+ "Author's title as it relates to the organization. e.g. Executive Editor.",
1818+ }),
1919+ bio: lx.string({
2020+ maxLength: 3000,
2121+ maxGraphemes: 300,
2222+ description: "A short biography of the author.",
2323+ }),
2424+ image: lx.blob({
2525+ maxSize: 1 * MB,
2626+ accept: ["image/*"],
2727+ description:
2828+ "Optional image to use in reference to the author. Less than 1MB is size.",
2929+ }),
3030+ atprotoIdRef: lx.ref("com.atproto.repo.strongRef", {
3131+ description:
3232+ "Optional strong reference to an ATProto did representing the author.",
3333+ }),
3434+ }),
3535+ }),
3636+});
+80-59
src/lexicons/site.standard.document.ts
···11-import { lx } from 'prototypey'
22-import { MB } from '../constants.ts'
11+import { lx } from "prototypey";
22+import { siteStandardAuthor } from "./site.standard.author.ts";
33+import { MB } from "../constants.ts";
3444-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-})55+export const siteStandardDocument = lx.lexicon("site.standard.document", {
66+ main: lx.record({
77+ key: "tid",
88+ type: "record",
99+ record: lx.object({
1010+ site: lx.string({
1111+ required: true,
1212+ format: "uri",
1313+ description:
1414+ "Required URI for parent site or publication (https:// or at://). Use https:// for loose documents. Avoid trailing slashes.",
1515+ }),
1616+ path: lx.string({
1717+ description:
1818+ "Optional path, combined with site or publication url value to construct a full url to the document. Prepend with a leading slash.",
1919+ }),
2020+ title: lx.string({
2121+ required: true,
2222+ maxLength: 1280,
2323+ maxGraphemes: 128,
2424+ description: "Required title of the document.",
2525+ }),
2626+ description: lx.string({
2727+ maxLength: 3000,
2828+ maxGraphemes: 300,
2929+ description: "Optional brief description or expert of the document.",
3030+ }),
3131+ coverImage: lx.blob({
3232+ maxSize: 1 * MB,
3333+ accept: ["image/*"],
3434+ description:
3535+ "Optional image to use as the documents cover. Less than 1MB is size.",
3636+ }),
3737+ content: lx.union([], {
3838+ closed: false,
3939+ description:
4040+ "Optional open union to construct content within the record. Can be extended with other lexicons to define any content format.",
4141+ }),
4242+ textContent: lx.string({
4343+ description:
4444+ "Optional plaintext representation of the documents contents. Useful for search and other cases.",
4545+ }),
4646+ bskyPostRef: lx.ref("com.atproto.repo.strongRef", {
4747+ description:
4848+ "Optional strong reference to a Bluesky post. Useful to keep track of comments off-platform.",
4949+ }),
5050+ authors: lx.array(
5151+ {
5252+ type: "ref",
5353+ ref: siteStandardAuthor.json.id,
5454+ },
5555+ {
5656+ description:
5757+ "Optional array of strong references to site.standard.author records.",
5858+ },
5959+ ),
6060+ tags: lx.array(
6161+ {
6262+ type: "string",
6363+ },
6464+ {
6565+ maxLength: 100,
6666+ description:
6767+ 'Optional array of strings used to tag/categorize the document. Avoid prepending tags with hashtags ("#").',
6868+ },
6969+ ),
7070+ publishedAt: lx.string({
7171+ required: true,
7272+ format: "datetime",
7373+ description: "Required timestamp of the documents publication.",
7474+ }),
7575+ updatedAt: lx.string({
7676+ format: "datetime",
7777+ description: "Optional timestamp of the documents last edit.",
7878+ }),
7979+ }),
8080+ }),
8181+});