···11-import { document, record, object, required, string, integer, array, blob, ref } from '@atcute/lexicon-doc/builder';
11+import {
22+ array,
33+ blob,
44+ document,
55+ integer,
66+ object,
77+ record,
88+ ref,
99+ required,
1010+ string,
1111+} from "@atcute/lexicon-doc/builder";
212313const artistCredit = object({
44- description: 'An artist credit. Either a DID (for atproto users) or a plain name (for non-atproto collaborators), or both.',
55- properties: {
66- did: string({
77- format: 'did',
88- description: 'The atproto DID of the collaborator, if they are an atproto user.',
99- }),
1010- name: string({
1111- maxLength: 128,
1212- description: 'Display name or stage name of the collaborator. Required if DID is absent.',
1313- }),
1414- },
1414+ description:
1515+ "An artist credit. Either a DID (for atproto users) or a plain name (for non-atproto collaborators), or both.",
1616+ properties: {
1717+ did: string({
1818+ format: "did",
1919+ description:
2020+ "The atproto DID of the collaborator, if they are an atproto user.",
2121+ }),
2222+ name: string({
2323+ maxLength: 128,
2424+ description:
2525+ "Display name or stage name of the collaborator. Required if DID is absent.",
2626+ }),
2727+ },
1528});
16291730export default document({
1818- id: 'ca.ansxor.catnip.track',
1919- description: 'A music track record for the Catnip music platform.',
2020- defs: {
2121- main: record({
2222- key: 'tid',
2323- record: object({
2424- properties: {
2525- title: required(string({
2626- maxLength: 256,
2727- description: 'The title of the track.',
2828- })),
3131+ id: "ca.ansxor.catnip.track",
3232+ description: "A music track record for the Catnip music platform.",
3333+ defs: {
3434+ main: record({
3535+ key: "tid",
3636+ record: object({
3737+ properties: {
3838+ title: required(
3939+ string({
4040+ maxLength: 256,
4141+ description: "The title of the track.",
4242+ }),
4343+ ),
29443030- description: string({
3131- maxLength: 2000,
3232- description: 'An optional description or note about the track.',
3333- }),
4545+ description: string({
4646+ maxLength: 2000,
4747+ description: "An optional description or note about the track.",
4848+ }),
34493535- createdAt: required(string({
3636- format: 'datetime',
3737- description: 'Timestamp of when the record was created on the PDS.',
3838- })),
5050+ createdAt: required(
5151+ string({
5252+ format: "datetime",
5353+ description:
5454+ "Timestamp of when the record was created on the PDS.",
5555+ }),
5656+ ),
39574040- releaseDate: string({
4141- format: 'datetime',
4242- description: 'Optional self-reported release date of the track. Used for display only.',
4343- }),
5858+ releaseDate: string({
5959+ format: "datetime",
6060+ description:
6161+ "Optional self-reported release date of the track. Used for display only.",
6262+ }),
44634545- durationMs: integer({
4646- minimum: 0,
4747- description: 'Optional track duration in milliseconds. Treat as a display hint only — not authoritative.',
4848- }),
6464+ durationMs: integer({
6565+ minimum: 0,
6666+ description:
6767+ "Optional track duration in milliseconds. Treat as a display hint only — not authoritative.",
6868+ }),
49695050- artists: array({
5151- maxLength: 32,
5252- description: 'List of artists or collaborators. Each entry must have at least a DID or a name.',
5353- items: ref({ ref: '#artistCredit' }),
5454- }),
7070+ artists: array({
7171+ maxLength: 32,
7272+ description:
7373+ "List of artists or collaborators. Each entry must have at least a DID or a name.",
7474+ items: ref({ ref: "#artistCredit" }),
7575+ }),
55765656- tags: array({
5757- maxLength: 10,
5858- description: 'Optional tags for the track, e.g. genre, mood, instrumentation.',
5959- items: string({
6060- maxLength: 64,
6161- }),
6262- }),
7777+ tags: array({
7878+ maxLength: 10,
7979+ description:
8080+ "Optional tags for the track, e.g. genre, mood, instrumentation.",
8181+ items: string({
8282+ maxLength: 64,
8383+ }),
8484+ }),
63856464- language: string({
6565- maxLength: 16,
6666- description: "BCP 47 language code for the track's lyrics or primary language (e.g. 'en', 'ja', 'fr-CA').",
6767- }),
8686+ language: string({
8787+ maxLength: 16,
8888+ description:
8989+ "BCP 47 language code for the track's lyrics or primary language (e.g. 'en', 'ja', 'fr-CA').",
9090+ }),
68916969- license: string({
7070- knownValues: [
7171- 'CC0',
7272- 'CC BY',
7373- 'CC BY-SA',
7474- 'CC BY-NC',
7575- 'CC BY-NC-SA',
7676- 'CC BY-ND',
7777- 'CC BY-NC-ND',
7878- 'All Rights Reserved',
7979- 'Other',
8080- ],
8181- description: 'The license under which the track is released.',
8282- }),
9292+ license: string({
9393+ knownValues: [
9494+ "CC0",
9595+ "CC BY",
9696+ "CC BY-SA",
9797+ "CC BY-NC",
9898+ "CC BY-NC-SA",
9999+ "CC BY-ND",
100100+ "CC BY-NC-ND",
101101+ "All Rights Reserved",
102102+ "Other",
103103+ ],
104104+ description: "The license under which the track is released.",
105105+ }),
831068484- lyrics: string({
8585- maxLength: 50000,
8686- description: 'Optional lyrics for the track, as plain text.',
8787- }),
107107+ lyrics: string({
108108+ maxLength: 50000,
109109+ description: "Optional lyrics for the track, as plain text.",
110110+ }),
881118989- albumArt: blob({
9090- accept: ['image/jpeg', 'image/png', 'image/webp'],
9191- maxSize: 1000000,
9292- description: 'Optional album art image. Recommended size: at least 500x500px.',
9393- }),
112112+ albumArt: blob({
113113+ accept: ["image/jpeg", "image/png", "image/webp"],
114114+ maxSize: 1000000,
115115+ description:
116116+ "Optional album art image. Recommended size: at least 500x500px.",
117117+ }),
941189595- audio: required(blob({
9696- accept: ['audio/ogg', 'audio/opus'],
9797- maxSize: 52428800,
9898- description: 'Required self-hosted audio file in Opus format (~50MB limit). Mutually exclusive with externalUrl at the app level.',
9999- })),
119119+ audio: required(
120120+ blob({
121121+ accept: ["audio/ogg", "audio/opus"],
122122+ maxSize: 52428800,
123123+ description:
124124+ "Required self-hosted audio file in Opus format (~50MB limit). Mutually exclusive with externalUrl at the app level.",
125125+ }),
126126+ ),
100127101101- externalUrl: string({
102102- format: 'uri',
103103- maxLength: 512,
104104- description: 'Optional link to the track on an external platform (e.g. BandCamp, SoundCloud). Mutually exclusive with audio at the app level.',
105105- }),
106106- },
107107- }),
108108- }),
128128+ externalUrl: string({
129129+ format: "uri",
130130+ maxLength: 512,
131131+ description:
132132+ "Optional link to the track on an external platform (e.g. BandCamp, SoundCloud). Mutually exclusive with audio at the app level.",
133133+ }),
134134+ },
135135+ }),
136136+ }),
109137110110- artistCredit,
111111- },
138138+ artistCredit,
139139+ },
112140});