···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import { ValidationResult, BlobRef } from '@atproto/lexicon'
55-import { lexicons } from '../../../../lexicons'
66-import { isObj, hasProp } from '../../../../util'
77-import { CID } from 'multiformats/cid'
88-99-/** Annotation of a sub-string within rich text. */
1010-export interface Main {
1111- index: ByteSlice
1212- features: (Mention | Link | Tag | { $type: string; [k: string]: unknown })[]
1313- [k: string]: unknown
1414-}
1515-1616-export function isMain(v: unknown): v is Main {
1717- return (
1818- isObj(v) &&
1919- hasProp(v, '$type') &&
2020- (v.$type === 'app.bsky.richtext.facet#main' ||
2121- v.$type === 'app.bsky.richtext.facet')
2222- )
2323-}
2424-2525-export function validateMain(v: unknown): ValidationResult {
2626- return lexicons.validate('app.bsky.richtext.facet#main', v)
2727-}
2828-2929-/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */
3030-export interface Mention {
3131- did: string
3232- [k: string]: unknown
3333-}
3434-3535-export function isMention(v: unknown): v is Mention {
3636- return (
3737- isObj(v) &&
3838- hasProp(v, '$type') &&
3939- v.$type === 'app.bsky.richtext.facet#mention'
4040- )
4141-}
4242-4343-export function validateMention(v: unknown): ValidationResult {
4444- return lexicons.validate('app.bsky.richtext.facet#mention', v)
4545-}
4646-4747-/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */
4848-export interface Link {
4949- uri: string
5050- [k: string]: unknown
5151-}
5252-5353-export function isLink(v: unknown): v is Link {
5454- return (
5555- isObj(v) &&
5656- hasProp(v, '$type') &&
5757- v.$type === 'app.bsky.richtext.facet#link'
5858- )
5959-}
6060-6161-export function validateLink(v: unknown): ValidationResult {
6262- return lexicons.validate('app.bsky.richtext.facet#link', v)
6363-}
6464-6565-/** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */
6666-export interface Tag {
6767- tag: string
6868- [k: string]: unknown
6969-}
7070-7171-export function isTag(v: unknown): v is Tag {
7272- return (
7373- isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.richtext.facet#tag'
7474- )
7575-}
7676-7777-export function validateTag(v: unknown): ValidationResult {
7878- return lexicons.validate('app.bsky.richtext.facet#tag', v)
7979-}
8080-8181-/** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */
8282-export interface ByteSlice {
8383- byteStart: number
8484- byteEnd: number
8585- [k: string]: unknown
8686-}
8787-8888-export function isByteSlice(v: unknown): v is ByteSlice {
8989- return (
9090- isObj(v) &&
9191- hasProp(v, '$type') &&
9292- v.$type === 'app.bsky.richtext.facet#byteSlice'
9393- )
9494-}
9595-9696-export function validateByteSlice(v: unknown): ValidationResult {
9797- return lexicons.validate('app.bsky.richtext.facet#byteSlice', v)
9898-}
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import { ValidationResult, BlobRef } from '@atproto/lexicon'
55-import { lexicons } from '../../../../lexicons'
66-import { isObj, hasProp } from '../../../../util'
77-import { CID } from 'multiformats/cid'
88-99-export interface Record {
1010- /** The name of the track */
1111- trackName: string
1212- /** The Musicbrainz ID of the track */
1313- trackMbId?: string
1414- /** The Musicbrainz recording ID of the track */
1515- recordingMbId?: string
1616- /** The length of the track in seconds */
1717- duration?: number
1818- /** The name of the artist */
1919- artistName: string
2020- /** Array of Musicbrainz artist IDs */
2121- artistMbIds?: string[]
2222- /** The name of the release/album */
2323- releaseName?: string
2424- /** The Musicbrainz release ID */
2525- releaseMbId?: string
2626- /** The ISRC code associated with the recording */
2727- isrc?: string
2828- /** The URL associated with this track */
2929- originUrl?: string
3030- /** The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. */
3131- musicServiceBaseDomain?: string
3232- /** A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b */
3333- submissionClientAgent?: string
3434- /** The unix timestamp of when the track was played */
3535- playedTime?: string
3636- [k: string]: unknown
3737-}
3838-3939-export function isRecord(v: unknown): v is Record {
4040- return (
4141- isObj(v) &&
4242- hasProp(v, '$type') &&
4343- (v.$type === 'fm.teal.alpha.play#main' || v.$type === 'fm.teal.alpha.play')
4444- )
4545-}
4646-4747-export function validateRecord(v: unknown): ValidationResult {
4848- return lexicons.validate('fm.teal.alpha.play#main', v)
4949-}
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import { ValidationResult, BlobRef } from '@atproto/lexicon'
55-import { lexicons } from '../../../lexicons'
66-import { isObj, hasProp } from '../../../util'
77-import { CID } from 'multiformats/cid'
88-99-export interface Record {
1010- status: string
1111- createdAt: string
1212- [k: string]: unknown
1313-}
1414-1515-export function isRecord(v: unknown): v is Record {
1616- return (
1717- isObj(v) &&
1818- hasProp(v, '$type') &&
1919- (v.$type === 'xyz.statusphere.status#main' ||
2020- v.$type === 'xyz.statusphere.status')
2121- )
2222-}
2323-2424-export function validateRecord(v: unknown): ValidationResult {
2525- return lexicons.validate('xyz.statusphere.status#main', v)
2626-}
-13
apps/amethyst/lexicons/server/util.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-export function isObj(v: unknown): v is Record<string, unknown> {
55- return typeof v === 'object' && v !== null
66-}
77-88-export function hasProp<K extends PropertyKey>(
99- data: object,
1010- prop: K,
1111-): data is Record<K, unknown> {
1212- return prop in data
1313-}
···11-{
22- "lexicon": 1,
33- "id": "app.bsky.richtext.facet",
44- "defs": {
55- "main": {
66- "type": "object",
77- "description": "Annotation of a sub-string within rich text.",
88- "required": ["index", "features"],
99- "properties": {
1010- "index": { "type": "ref", "ref": "#byteSlice" },
1111- "features": {
1212- "type": "array",
1313- "items": { "type": "union", "refs": ["#mention", "#link", "#tag"] }
1414- }
1515- }
1616- },
1717- "mention": {
1818- "type": "object",
1919- "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.",
2020- "required": ["did"],
2121- "properties": {
2222- "did": { "type": "string", "format": "did" }
2323- }
2424- },
2525- "link": {
2626- "type": "object",
2727- "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.",
2828- "required": ["uri"],
2929- "properties": {
3030- "uri": { "type": "string", "format": "uri" }
3131- }
3232- },
3333- "tag": {
3434- "type": "object",
3535- "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').",
3636- "required": ["tag"],
3737- "properties": {
3838- "tag": { "type": "string", "maxLength": 640, "maxGraphemes": 64 }
3939- }
4040- },
4141- "byteSlice": {
4242- "type": "object",
4343- "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.",
4444- "required": ["byteStart", "byteEnd"],
4545- "properties": {
4646- "byteStart": { "type": "integer", "minimum": 0 },
4747- "byteEnd": { "type": "integer", "minimum": 0 }
4848- }
4949- }
5050- }
5151-}
···11-{
22- "lexicon": 1,
33- "id": "fm.teal.alpha.actor.status",
44- "defs": {
55- "main": {
66- "type": "record",
77- "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned.",
88- "key": "literal:self",
99- "record": {
1010- "type": "object",
1111- "required": ["time", "item"],
1212- "properties": {
1313- "time": {
1414- "type": "string",
1515- "format": "datetime",
1616- "description": "The unix timestamp of when the item was recorded"
1717- },
1818- "item": { "type": "union", "refs": ["fm.teal.alpha.play#record"] }
1919- }
2020- }
2121- }
2222- }
2323-}
···11-{
22- "lexicon": 1,
33- "id": "fm.teal.alpha.play",
44- "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm play. Plays are submitted as a result of a user listening to a track. Plays should be marked as tracked when a user has listened to the entire track if it's under 2 minutes long, or half of the track's duration up to 4 minutes, whichever is longest.",
55- "defs": {
66- "main": {
77- "type": "record",
88- "key": "tid",
99- "record": {
1010- "type": "object",
1111- "required": ["trackName", "artistName"],
1212- "properties": {
1313- "trackName": {
1414- "type": "string",
1515- "minLength": 1,
1616- "maxLength": 256,
1717- "maxGraphemes": 2560,
1818- "description": "The name of the track"
1919- },
2020- "trackMbId": {
2121- "type": "string",
2222-2323- "description": "The Musicbrainz ID of the track"
2424- },
2525- "recordingMbId": {
2626- "type": "string",
2727- "description": "The Musicbrainz recording ID of the track"
2828- },
2929- "duration": {
3030- "type": "integer",
3131- "description": "The length of the track in seconds"
3232- },
3333- "artistName": {
3434- "type": "string",
3535- "minLength": 1,
3636- "maxLength": 256,
3737- "maxGraphemes": 2560,
3838- "description": "The name of the artist"
3939- },
4040- "artistMbIds": {
4141- "type": "array",
4242- "items": {
4343- "type": "string"
4444- },
4545- "description": "Array of Musicbrainz artist IDs"
4646- },
4747- "releaseName": {
4848- "type": "string",
4949- "maxLength": 256,
5050- "maxGraphemes": 2560,
5151- "description": "The name of the release/album"
5252- },
5353- "releaseMbId": {
5454- "type": "string",
5555- "description": "The Musicbrainz release ID"
5656- },
5757- "isrc": {
5858- "type": "string",
5959- "description": "The ISRC code associated with the recording"
6060- },
6161- "originUrl": {
6262- "type": "string",
6363- "description": "The URL associated with this track"
6464- },
6565- "musicServiceBaseDomain": {
6666- "type": "string",
6767- "description": "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com."
6868- },
6969- "submissionClientAgent": {
7070- "type": "string",
7171- "maxLength": 256,
7272- "maxGraphemes": 2560,
7373- "description": "A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b"
7474- },
7575- "playedTime": {
7676- "type": "string",
7777- "format": "datetime",
7878- "description": "The unix timestamp of when the track was played"
7979- }
8080- }
8181- }
8282- }
8383- }
8484-}