/* * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. */ import { l } from '@atproto/lex-schema' import * as LabelDefs from '../../com/atproto/label/defs.defs.ts' import * as RepoStrongRef from '../../com/atproto/repo/strongRef.defs.ts' const $nsid = 'site.standard.document' type $nsid = typeof $nsid export { $nsid } /** A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently. */ type Main = { $type: 'site.standard.document' /** * Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash. */ path?: string /** * Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes. */ site: l.UriString /** * Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags. */ tags?: string[] /** * Array of values describing relationships between this document and external resources */ links?: l.Unknown$TypedObject /** * Title of the document. */ title: string /** * Self-label values for this post. Effectively content warnings. */ labels?: l.$Typed | l.Unknown$TypedObject /** * Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats. */ content?: l.Unknown$TypedObject /** * Timestamp of the documents last edit. */ updatedAt?: l.DatetimeString /** * Image to used for thumbnail or cover image. Less than 1MB is size. */ coverImage?: l.BlobRef /** * Strong reference to a Bluesky post. Useful to keep track of comments off-platform. */ bskyPostRef?: RepoStrongRef.Main /** * A brief description or excerpt from the document. */ description?: string /** * Timestamp of the documents publish time. */ publishedAt: l.DatetimeString /** * Plaintext representation of the documents contents. Should not contain markdown or other formatting. */ textContent?: string contributors?: Contributor[] } export type { Main } /** A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently. */ const main = /*#__PURE__*/ l.record<'tid', Main>( 'tid', $nsid, /*#__PURE__*/ l.object({ path: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), site: /*#__PURE__*/ l.string({ format: 'uri' }), tags: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.array( /*#__PURE__*/ l.string({ maxLength: 1280, maxGraphemes: 128 }), ), ), links: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.typedUnion([], false)), title: /*#__PURE__*/ l.string({ maxLength: 5000, maxGraphemes: 500 }), labels: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.typedUnion( [ /*#__PURE__*/ l.typedRef( (() => LabelDefs.selfLabels) as any, ), ], false, ), ), content: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.typedUnion([], false)), updatedAt: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.string({ format: 'datetime' }), ), coverImage: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.blob({ accept: ['image/*'], maxSize: 1000000 }), ), bskyPostRef: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.ref( (() => RepoStrongRef.main) as any, ), ), description: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.string({ maxLength: 30000, maxGraphemes: 3000 }), ), publishedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), textContent: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), contributors: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.array( /*#__PURE__*/ l.ref((() => contributor) as any), ), ), }), ) export { main } const $type = $nsid type $type = typeof $type export { $type } export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) export const $build = /*#__PURE__*/ main.build.bind(main) export const $assert = /*#__PURE__*/ main.assert.bind(main) export const $check = /*#__PURE__*/ main.check.bind(main) export const $cast = /*#__PURE__*/ main.cast.bind(main) export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) export const $matches = /*#__PURE__*/ main.matches.bind(main) export const $parse = /*#__PURE__*/ main.parse.bind(main) export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) export const $validate = /*#__PURE__*/ main.validate.bind(main) export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) type Contributor = { $type?: 'site.standard.document#contributor' did: l.DidString role?: string displayName?: string } export type { Contributor } const contributor = /*#__PURE__*/ l.typedObject( $nsid, 'contributor', /*#__PURE__*/ l.object({ did: /*#__PURE__*/ l.string({ format: 'did' }), role: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.string({ maxLength: 1000, maxGraphemes: 100 }), ), displayName: /*#__PURE__*/ l.optional( /*#__PURE__*/ l.string({ maxLength: 1000, maxGraphemes: 100 }), ), }), ) export { contributor }