···11+{
22+ "lexicon": 1,
33+ "id": "app.rocksky.song.createSong",
44+ "defs": {
55+ "main": {
66+ "type": "procedure",
77+ "description": "Create a new song",
88+ "input": {
99+ "encoding": "application/json",
1010+ "schema": {
1111+ "type": "object",
1212+ "required": [
1313+ "title",
1414+ "artist",
1515+ "album",
1616+ "albumArtist"
1717+ ],
1818+ "properties": {
1919+ "title": {
2020+ "type": "string",
2121+ "description": "The title of the song"
2222+ },
2323+ "artist": {
2424+ "type": "string",
2525+ "description": "The artist of the song"
2626+ },
2727+ "albumArtist": {
2828+ "type": "string",
2929+ "description": "The album artist of the song, if different from the main artist"
3030+ },
3131+ "album": {
3232+ "type": "string",
3333+ "description": "The album of the song, if applicable"
3434+ },
3535+ "duration": {
3636+ "type": "integer",
3737+ "description": "The duration of the song in seconds"
3838+ },
3939+ "mbId": {
4040+ "type": "string",
4141+ "description": "The MusicBrainz ID of the song, if available"
4242+ },
4343+ "albumArt": {
4444+ "type": "string",
4545+ "description": "The URL of the album art for the song",
4646+ "format": "uri"
4747+ },
4848+ "trackNumber": {
4949+ "type": "integer",
5050+ "description": "The track number of the song in the album, if applicable"
5151+ },
5252+ "releaseDate": {
5353+ "type": "string",
5454+ "description": "The release date of the song, formatted as YYYY-MM-DD"
5555+ },
5656+ "year": {
5757+ "type": "integer",
5858+ "description": "The year the song was released"
5959+ },
6060+ "discNumber": {
6161+ "type": "integer",
6262+ "description": "The disc number of the song in the album, if applicable"
6363+ },
6464+ "lyrics": {
6565+ "type": "string",
6666+ "description": "The lyrics of the song, if available"
6767+ }
6868+ }
6969+ }
7070+ },
7171+ "output": {
7272+ "encoding": "application/json",
7373+ "schema": {
7474+ "type": "ref",
7575+ "ref": "app.rocksky.song.defs#songViewDetailed"
7676+ }
7777+ }
7878+ }
7979+ }
8080+}
···11+amends "../../schema/lexicon.pkl"
22+33+lexicon = 1
44+id = "app.rocksky.song.createSong"
55+defs = new Mapping<String, Procedure> {
66+ ["main"] {
77+ type = "procedure"
88+ description = "Create a new song"
99+ input {
1010+ encoding = "application/json"
1111+ schema {
1212+ type = "object"
1313+ required = List("title", "artist", "album", "albumArtist")
1414+ properties {
1515+ ["title"] = new StringType {
1616+ type = "string"
1717+ description = "The title of the song"
1818+ }
1919+ ["artist"] = new StringType {
2020+ type = "string"
2121+ description = "The artist of the song"
2222+ }
2323+ ["albumArtist"] = new StringType {
2424+ type = "string"
2525+ description = "The album artist of the song, if different from the main artist"
2626+ }
2727+ ["album"] = new StringType {
2828+ type = "string"
2929+ description = "The album of the song, if applicable"
3030+ }
3131+ ["duration"] = new IntegerType {
3232+ type = "integer"
3333+ description = "The duration of the song in seconds"
3434+ }
3535+ ["mbId"] = new StringType {
3636+ type = "string"
3737+ description = "The MusicBrainz ID of the song, if available"
3838+ }
3939+ ["albumArt"] = new StringType {
4040+ type = "string"
4141+ description = "The URL of the album art for the song"
4242+ format = "uri"
4343+ }
4444+ ["trackNumber"] = new IntegerType {
4545+ type = "integer"
4646+ description = "The track number of the song in the album, if applicable"
4747+ }
4848+ ["releaseDate"] = new StringType {
4949+ type = "string"
5050+ description = "The release date of the song, formatted as YYYY-MM-DD"
5151+ }
5252+ ["year"] = new IntegerType {
5353+ type = "integer"
5454+ description = "The year the song was released"
5555+ }
5656+ ["discNumber"] = new IntegerType {
5757+ type = "integer"
5858+ description = "The disc number of the song in the album, if applicable"
5959+ }
6060+ ["lyrics"] = new StringType {
6161+ type = "string"
6262+ description = "The lyrics of the song, if available"
6363+ }
6464+ }
6565+ }
6666+ }
6767+ output {
6868+ encoding = "application/json"
6969+ schema = new Ref {
7070+ type = "ref"
7171+ ref = "app.rocksky.song.defs#songViewDetailed"
7272+ }
7373+ }
7474+ }
7575+}
+12
rockskyapi/rocksky-auth/src/lexicon/index.ts
···6161import * as AppRockskyShoutRemoveShout from './types/app/rocksky/shout/removeShout'
6262import * as AppRockskyShoutReplyShout from './types/app/rocksky/shout/replyShout'
6363import * as AppRockskyShoutReportShout from './types/app/rocksky/shout/reportShout'
6464+import * as AppRockskySongCreateSong from './types/app/rocksky/song/createSong'
6465import * as AppRockskySongGetSong from './types/app/rocksky/song/getSong'
6566import * as AppRockskySongGetSongs from './types/app/rocksky/song/getSongs'
6667import * as AppRockskySpotifyGetCurrentlyPlaying from './types/app/rocksky/spotify/getCurrentlyPlaying'
···820821821822 constructor(server: Server) {
822823 this._server = server
824824+ }
825825+826826+ createSong<AV extends AuthVerifier>(
827827+ cfg: ConfigOf<
828828+ AV,
829829+ AppRockskySongCreateSong.Handler<ExtractAuth<AV>>,
830830+ AppRockskySongCreateSong.HandlerReqCtx<ExtractAuth<AV>>
831831+ >,
832832+ ) {
833833+ const nsid = 'app.rocksky.song.createSong' // @ts-ignore
834834+ return this._server.xrpc.method(nsid, cfg)
823835 }
824836825837 getSong<AV extends AuthVerifier>(
+80
rockskyapi/rocksky-auth/src/lexicon/lexicons.ts
···32753275 },
32763276 },
32773277 },
32783278+ AppRockskySongCreateSong: {
32793279+ lexicon: 1,
32803280+ id: 'app.rocksky.song.createSong',
32813281+ defs: {
32823282+ main: {
32833283+ type: 'procedure',
32843284+ description: 'Create a new song',
32853285+ input: {
32863286+ encoding: 'application/json',
32873287+ schema: {
32883288+ type: 'object',
32893289+ required: ['title', 'artist', 'album', 'albumArtist'],
32903290+ properties: {
32913291+ title: {
32923292+ type: 'string',
32933293+ description: 'The title of the song',
32943294+ },
32953295+ artist: {
32963296+ type: 'string',
32973297+ description: 'The artist of the song',
32983298+ },
32993299+ albumArtist: {
33003300+ type: 'string',
33013301+ description:
33023302+ 'The album artist of the song, if different from the main artist',
33033303+ },
33043304+ album: {
33053305+ type: 'string',
33063306+ description: 'The album of the song, if applicable',
33073307+ },
33083308+ duration: {
33093309+ type: 'integer',
33103310+ description: 'The duration of the song in seconds',
33113311+ },
33123312+ mbId: {
33133313+ type: 'string',
33143314+ description: 'The MusicBrainz ID of the song, if available',
33153315+ },
33163316+ albumArt: {
33173317+ type: 'string',
33183318+ description: 'The URL of the album art for the song',
33193319+ format: 'uri',
33203320+ },
33213321+ trackNumber: {
33223322+ type: 'integer',
33233323+ description:
33243324+ 'The track number of the song in the album, if applicable',
33253325+ },
33263326+ releaseDate: {
33273327+ type: 'string',
33283328+ description:
33293329+ 'The release date of the song, formatted as YYYY-MM-DD',
33303330+ },
33313331+ year: {
33323332+ type: 'integer',
33333333+ description: 'The year the song was released',
33343334+ },
33353335+ discNumber: {
33363336+ type: 'integer',
33373337+ description:
33383338+ 'The disc number of the song in the album, if applicable',
33393339+ },
33403340+ lyrics: {
33413341+ type: 'string',
33423342+ description: 'The lyrics of the song, if available',
33433343+ },
33443344+ },
33453345+ },
33463346+ },
33473347+ output: {
33483348+ encoding: 'application/json',
33493349+ schema: {
33503350+ type: 'ref',
33513351+ ref: 'lex:app.rocksky.song.defs#songViewDetailed',
33523352+ },
33533353+ },
33543354+ },
33553355+ },
33563356+ },
32783357 AppRockskySongDefs: {
32793358 lexicon: 1,
32803359 id: 'app.rocksky.song.defs',
···40634142 AppRockskyShoutReplyShout: 'app.rocksky.shout.replyShout',
40644143 AppRockskyShoutReportShout: 'app.rocksky.shout.reportShout',
40654144 AppRockskyShout: 'app.rocksky.shout',
41454145+ AppRockskySongCreateSong: 'app.rocksky.song.createSong',
40664146 AppRockskySongDefs: 'app.rocksky.song.defs',
40674147 AppRockskySongGetSong: 'app.rocksky.song.getSong',
40684148 AppRockskySongGetSongs: 'app.rocksky.song.getSongs',
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import express from 'express'
55+import { ValidationResult, BlobRef } from '@atproto/lexicon'
66+import { lexicons } from '../../../../lexicons'
77+import { isObj, hasProp } from '../../../../util'
88+import { CID } from 'multiformats/cid'
99+import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
1010+import * as AppRockskySongDefs from './defs'
1111+1212+export interface QueryParams {}
1313+1414+export interface InputSchema {
1515+ /** The title of the song */
1616+ title: string
1717+ /** The artist of the song */
1818+ artist: string
1919+ /** The album artist of the song, if different from the main artist */
2020+ albumArtist: string
2121+ /** The album of the song, if applicable */
2222+ album: string
2323+ /** The duration of the song in seconds */
2424+ duration?: number
2525+ /** The MusicBrainz ID of the song, if available */
2626+ mbId?: string
2727+ /** The URL of the album art for the song */
2828+ albumArt?: string
2929+ /** The track number of the song in the album, if applicable */
3030+ trackNumber?: number
3131+ /** The release date of the song, formatted as YYYY-MM-DD */
3232+ releaseDate?: string
3333+ /** The year the song was released */
3434+ year?: number
3535+ /** The disc number of the song in the album, if applicable */
3636+ discNumber?: number
3737+ /** The lyrics of the song, if available */
3838+ lyrics?: string
3939+ [k: string]: unknown
4040+}
4141+4242+export type OutputSchema = AppRockskySongDefs.SongViewDetailed
4343+4444+export interface HandlerInput {
4545+ encoding: 'application/json'
4646+ body: InputSchema
4747+}
4848+4949+export interface HandlerSuccess {
5050+ encoding: 'application/json'
5151+ body: OutputSchema
5252+ headers?: { [key: string]: string }
5353+}
5454+5555+export interface HandlerError {
5656+ status: number
5757+ message?: string
5858+}
5959+6060+export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
6161+export type HandlerReqCtx<HA extends HandlerAuth = never> = {
6262+ auth: HA
6363+ params: QueryParams
6464+ input: HandlerInput
6565+ req: express.Request
6666+ res: express.Response
6767+ resetRouteRateLimits: () => Promise<void>
6868+}
6969+export type Handler<HA extends HandlerAuth = never> = (
7070+ ctx: HandlerReqCtx<HA>,
7171+) => Promise<HandlerOutput> | HandlerOutput