From f4cb7cb230acd3dc4aee1caae0f1c7191b5c9714 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Thu, 17 Jul 2025 08:37:53 +0300 Subject: [PATCH] [api] update lexicons --- apps/api/lexicons/player/addItemsToQueue.json | 32 ++ apps/api/lexicons/player/defs.json | 12 + .../lexicons/player/getCurrentlyPlaying.json | 3 + .../api/lexicons/player/getPlaybackQueue.json | 25 + apps/api/lexicons/player/next.json | 10 +- apps/api/lexicons/player/pause.json | 10 +- apps/api/lexicons/player/play.json | 10 +- apps/api/lexicons/player/playDirectory.json | 24 + apps/api/lexicons/player/playFile.json | 24 + apps/api/lexicons/player/previous.json | 10 +- apps/api/lexicons/player/seek.json | 3 + .../api/lexicons/playlist/createPlaylist.json | 26 ++ .../lexicons/playlist/insertDirectory.json | 27 ++ apps/api/lexicons/playlist/insertFiles.json | 30 ++ .../api/lexicons/playlist/removePlaylist.json | 23 + apps/api/lexicons/playlist/removeTrack.json | 28 ++ apps/api/lexicons/playlist/startPlaylist.json | 23 + apps/api/lexicons/song/lovedSong.json | 140 ------ apps/api/package.json | 1 + apps/api/pkl/defs/player/addItemsToQueue.pkl | 30 ++ apps/api/pkl/defs/player/defs.pkl | 12 + .../pkl/defs/player/getCurrentlyPlaying.pkl | 3 + apps/api/pkl/defs/player/getPlaybackQueue.pkl | 25 + apps/api/pkl/defs/player/next.pkl | 8 + apps/api/pkl/defs/player/pause.pkl | 8 + apps/api/pkl/defs/player/play.pkl | 8 + apps/api/pkl/defs/player/playDirectory.pkl | 22 + apps/api/pkl/defs/player/playFile.pkl | 22 + apps/api/pkl/defs/player/previous.pkl | 8 + apps/api/pkl/defs/player/seek.pkl | 7 +- apps/api/pkl/defs/playlist/createPlaylist.pkl | 24 + .../api/pkl/defs/playlist/insertDirectory.pkl | 25 + apps/api/pkl/defs/playlist/insertFiles.pkl | 28 ++ apps/api/pkl/defs/playlist/removePlaylist.pkl | 21 + apps/api/pkl/defs/playlist/removeTrack.pkl | 25 + apps/api/pkl/defs/playlist/startPlaylist.pkl | 21 + apps/api/pkl/defs/song/lovedSong.pkl | 151 ------ apps/api/src/lexicon/index.ts | 120 +++++ apps/api/src/lexicon/lexicons.ts | 437 ++++++++++++------ .../lexicon/types/app/rocksky/lovedSong.ts | 66 --- .../app/rocksky/player/addItemsToQueue.ts | 37 ++ .../lexicon/types/app/rocksky/player/defs.ts | 25 + .../app/rocksky/player/getCurrentlyPlaying.ts | 1 + .../app/rocksky/player/getPlaybackQueue.ts | 42 ++ .../lexicon/types/app/rocksky/player/next.ts | 4 +- .../lexicon/types/app/rocksky/player/pause.ts | 4 +- .../lexicon/types/app/rocksky/player/play.ts | 4 +- .../types/app/rocksky/player/playDirectory.ts | 35 ++ .../types/app/rocksky/player/playFile.ts | 35 ++ .../types/app/rocksky/player/previous.ts | 4 +- .../lexicon/types/app/rocksky/player/seek.ts | 1 + .../app/rocksky/playlist/createPlaylist.ts | 37 ++ .../app/rocksky/playlist/insertDirectory.ts | 37 ++ .../types/app/rocksky/playlist/insertFiles.ts | 36 ++ .../app/rocksky/playlist/removePlaylist.ts | 35 ++ .../types/app/rocksky/playlist/removeTrack.ts | 37 ++ .../app/rocksky/playlist/startPlaylist.ts | 35 ++ .../components/ContextMenu/ContextMenu.tsx | 4 +- 58 files changed, 1444 insertions(+), 501 deletions(-) create mode 100644 apps/api/lexicons/player/addItemsToQueue.json create mode 100644 apps/api/lexicons/player/getPlaybackQueue.json create mode 100644 apps/api/lexicons/player/playDirectory.json create mode 100644 apps/api/lexicons/player/playFile.json create mode 100644 apps/api/lexicons/playlist/createPlaylist.json create mode 100644 apps/api/lexicons/playlist/insertDirectory.json create mode 100644 apps/api/lexicons/playlist/insertFiles.json create mode 100644 apps/api/lexicons/playlist/removePlaylist.json create mode 100644 apps/api/lexicons/playlist/removeTrack.json create mode 100644 apps/api/lexicons/playlist/startPlaylist.json delete mode 100644 apps/api/lexicons/song/lovedSong.json create mode 100644 apps/api/pkl/defs/player/addItemsToQueue.pkl create mode 100644 apps/api/pkl/defs/player/getPlaybackQueue.pkl create mode 100644 apps/api/pkl/defs/player/playDirectory.pkl create mode 100644 apps/api/pkl/defs/player/playFile.pkl create mode 100644 apps/api/pkl/defs/playlist/createPlaylist.pkl create mode 100644 apps/api/pkl/defs/playlist/insertDirectory.pkl create mode 100644 apps/api/pkl/defs/playlist/insertFiles.pkl create mode 100644 apps/api/pkl/defs/playlist/removePlaylist.pkl create mode 100644 apps/api/pkl/defs/playlist/removeTrack.pkl create mode 100644 apps/api/pkl/defs/playlist/startPlaylist.pkl delete mode 100644 apps/api/pkl/defs/song/lovedSong.pkl delete mode 100644 apps/api/src/lexicon/types/app/rocksky/lovedSong.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/player/addItemsToQueue.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/player/getPlaybackQueue.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/player/playDirectory.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/player/playFile.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/playlist/createPlaylist.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/playlist/insertDirectory.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/playlist/insertFiles.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/playlist/removePlaylist.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/playlist/removeTrack.ts create mode 100644 apps/api/src/lexicon/types/app/rocksky/playlist/startPlaylist.ts diff --git a/apps/api/lexicons/player/addItemsToQueue.json b/apps/api/lexicons/player/addItemsToQueue.json new file mode 100644 index 00000000..4e75805a --- /dev/null +++ b/apps/api/lexicons/player/addItemsToQueue.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "app.rocksky.player.addItemsToQueue", + "defs": { + "main": { + "type": "procedure", + "description": "Add items to the player's queue", + "parameters": { + "type": "params", + "required": [ + "items" + ], + "properties": { + "playerId": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "string", + "description": "List of file identifiers to add to the queue" + } + }, + "position": { + "type": "integer", + "description": "Position in the queue to insert the items at, defaults to the end if not specified" + } + } + } + } + } +} diff --git a/apps/api/lexicons/player/defs.json b/apps/api/lexicons/player/defs.json index cdb221de..4e9ea694 100644 --- a/apps/api/lexicons/player/defs.json +++ b/apps/api/lexicons/player/defs.json @@ -10,6 +10,18 @@ "description": "The title of the currently playing track" } } + }, + "playbackQueueViewDetailed": { + "type": "object", + "properties": { + "tracks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.rocksky.song.defs.songViewBasic" + } + } + } } } } diff --git a/apps/api/lexicons/player/getCurrentlyPlaying.json b/apps/api/lexicons/player/getCurrentlyPlaying.json index 43bcccee..3b75c02f 100644 --- a/apps/api/lexicons/player/getCurrentlyPlaying.json +++ b/apps/api/lexicons/player/getCurrentlyPlaying.json @@ -8,6 +8,9 @@ "parameters": { "type": "params", "properties": { + "playerId": { + "type": "string" + }, "actor": { "type": "string", "description": "Handle or DID of the actor to retrieve the currently playing track for. If not provided, defaults to the current user.", diff --git a/apps/api/lexicons/player/getPlaybackQueue.json b/apps/api/lexicons/player/getPlaybackQueue.json new file mode 100644 index 00000000..cb2f46f8 --- /dev/null +++ b/apps/api/lexicons/player/getPlaybackQueue.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.rocksky.player.getPlaybackQueue", + "defs": { + "main": { + "type": "query", + "description": "Retrieve the current playback queue", + "parameters": { + "type": "params", + "properties": { + "playerId": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "app.rocksky.player.defs#playbackQueueViewDetailed" + } + } + } + } +} diff --git a/apps/api/lexicons/player/next.json b/apps/api/lexicons/player/next.json index b9e340be..f07d4cf4 100644 --- a/apps/api/lexicons/player/next.json +++ b/apps/api/lexicons/player/next.json @@ -4,7 +4,15 @@ "defs": { "main": { "type": "procedure", - "description": "Play the next track in the queue" + "description": "Play the next track in the queue", + "parameters": { + "type": "params", + "properties": { + "playerId": { + "type": "string" + } + } + } } } } diff --git a/apps/api/lexicons/player/pause.json b/apps/api/lexicons/player/pause.json index 38758a6e..741c9def 100644 --- a/apps/api/lexicons/player/pause.json +++ b/apps/api/lexicons/player/pause.json @@ -4,7 +4,15 @@ "defs": { "main": { "type": "procedure", - "description": "Pause the currently playing track" + "description": "Pause the currently playing track", + "parameters": { + "type": "params", + "properties": { + "playerId": { + "type": "string" + } + } + } } } } diff --git a/apps/api/lexicons/player/play.json b/apps/api/lexicons/player/play.json index e27bc466..39c646af 100644 --- a/apps/api/lexicons/player/play.json +++ b/apps/api/lexicons/player/play.json @@ -4,7 +4,15 @@ "defs": { "main": { "type": "procedure", - "description": "Resume playback of the currently paused track" + "description": "Resume playback of the currently paused track", + "parameters": { + "type": "params", + "properties": { + "playerId": { + "type": "string" + } + } + } } } } diff --git a/apps/api/lexicons/player/playDirectory.json b/apps/api/lexicons/player/playDirectory.json new file mode 100644 index 00000000..a9a5985b --- /dev/null +++ b/apps/api/lexicons/player/playDirectory.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "app.rocksky.player.playDirectory", + "defs": { + "main": { + "type": "procedure", + "description": "Play all tracks in a directory", + "parameters": { + "type": "params", + "required": [ + "directoryId" + ], + "properties": { + "playerId": { + "type": "string" + }, + "directoryId": { + "type": "string" + } + } + } + } + } +} diff --git a/apps/api/lexicons/player/playFile.json b/apps/api/lexicons/player/playFile.json new file mode 100644 index 00000000..d9abca9e --- /dev/null +++ b/apps/api/lexicons/player/playFile.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "app.rocksky.player.playFile", + "defs": { + "main": { + "type": "procedure", + "description": "Play a specific audio file", + "parameters": { + "type": "params", + "required": [ + "fileId" + ], + "properties": { + "playerId": { + "type": "string" + }, + "fileId": { + "type": "string" + } + } + } + } + } +} diff --git a/apps/api/lexicons/player/previous.json b/apps/api/lexicons/player/previous.json index ae2904d3..a855866c 100644 --- a/apps/api/lexicons/player/previous.json +++ b/apps/api/lexicons/player/previous.json @@ -4,7 +4,15 @@ "defs": { "main": { "type": "procedure", - "description": "Play the previous track in the queue" + "description": "Play the previous track in the queue", + "parameters": { + "type": "params", + "properties": { + "playerId": { + "type": "string" + } + } + } } } } diff --git a/apps/api/lexicons/player/seek.json b/apps/api/lexicons/player/seek.json index 59dbe256..d97f2686 100644 --- a/apps/api/lexicons/player/seek.json +++ b/apps/api/lexicons/player/seek.json @@ -11,6 +11,9 @@ "position" ], "properties": { + "playerId": { + "type": "string" + }, "position": { "type": "integer", "description": "The position in seconds to seek to" diff --git a/apps/api/lexicons/playlist/createPlaylist.json b/apps/api/lexicons/playlist/createPlaylist.json new file mode 100644 index 00000000..b0ce8bd4 --- /dev/null +++ b/apps/api/lexicons/playlist/createPlaylist.json @@ -0,0 +1,26 @@ +{ + "lexicon": 1, + "id": "app.rocksky.playlist.createPlaylist", + "defs": { + "main": { + "type": "procedure", + "description": "Create a new playlist", + "parameters": { + "type": "params", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the playlist" + }, + "description": { + "type": "string", + "description": "A brief description of the playlist" + } + } + } + } + } +} diff --git a/apps/api/lexicons/playlist/insertDirectory.json b/apps/api/lexicons/playlist/insertDirectory.json new file mode 100644 index 00000000..fe53ce40 --- /dev/null +++ b/apps/api/lexicons/playlist/insertDirectory.json @@ -0,0 +1,27 @@ +{ + "lexicon": 1, + "id": "app.rocksky.playlist.insertDirectory", + "defs": { + "main": { + "type": "procedure", + "description": "Insert a directory into a playlist", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "description": "The URI of the playlist to start", + "format": "at-uri" + }, + "directory": { + "type": "string", + "description": "The directory (id) to insert into the playlist" + } + } + } + } + } +} diff --git a/apps/api/lexicons/playlist/insertFiles.json b/apps/api/lexicons/playlist/insertFiles.json new file mode 100644 index 00000000..a95603a7 --- /dev/null +++ b/apps/api/lexicons/playlist/insertFiles.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "app.rocksky.playlist.insertFiles", + "defs": { + "main": { + "type": "procedure", + "description": "Insert files into a playlist", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "description": "The URI of the playlist to start", + "format": "at-uri" + }, + "files": { + "type": "array", + "items": { + "type": "string", + "description": "List of file (id) to insert into the playlist" + } + } + } + } + } + } +} diff --git a/apps/api/lexicons/playlist/removePlaylist.json b/apps/api/lexicons/playlist/removePlaylist.json new file mode 100644 index 00000000..0aacdb12 --- /dev/null +++ b/apps/api/lexicons/playlist/removePlaylist.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "app.rocksky.playlist.removePlaylist", + "defs": { + "main": { + "type": "procedure", + "description": "Remove a playlist", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "description": "The URI of the playlist to remove", + "format": "at-uri" + } + } + } + } + } +} diff --git a/apps/api/lexicons/playlist/removeTrack.json b/apps/api/lexicons/playlist/removeTrack.json new file mode 100644 index 00000000..899ac7f3 --- /dev/null +++ b/apps/api/lexicons/playlist/removeTrack.json @@ -0,0 +1,28 @@ +{ + "lexicon": 1, + "id": "app.rocksky.playlist.removeTrack", + "defs": { + "main": { + "type": "procedure", + "description": "Remove a track from a playlist", + "parameters": { + "type": "params", + "required": [ + "uri", + "position" + ], + "properties": { + "uri": { + "type": "string", + "description": "The URI of the playlist to remove the track from", + "format": "at-uri" + }, + "position": { + "type": "integer", + "description": "The position of the track to remove in the playlist" + } + } + } + } + } +} diff --git a/apps/api/lexicons/playlist/startPlaylist.json b/apps/api/lexicons/playlist/startPlaylist.json new file mode 100644 index 00000000..47cdc4f8 --- /dev/null +++ b/apps/api/lexicons/playlist/startPlaylist.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "app.rocksky.playlist.startPlaylist", + "defs": { + "main": { + "type": "procedure", + "description": "Start a playlist", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "description": "The URI of the playlist to start", + "format": "at-uri" + } + } + } + } + } +} diff --git a/apps/api/lexicons/song/lovedSong.json b/apps/api/lexicons/song/lovedSong.json deleted file mode 100644 index 82da25bf..00000000 --- a/apps/api/lexicons/song/lovedSong.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "lexicon": 1, - "id": "app.rocksky.lovedSong", - "defs": { - "main": { - "type": "record", - "description": "A declaration of a song.", - "key": "tid", - "record": { - "type": "object", - "required": [ - "title", - "artist", - "album", - "duration", - "createdAt" - ], - "properties": { - "title": { - "type": "string", - "description": "The title of the song.", - "minLength": 1, - "maxLength": 512 - }, - "artist": { - "type": "string", - "description": "The artist of the song.", - "minLength": 1, - "maxLength": 256 - }, - "albumArtist": { - "type": "string", - "description": "The album artist of the song.", - "minLength": 1, - "maxLength": 256 - }, - "album": { - "type": "string", - "description": "The album of the song.", - "minLength": 1, - "maxLength": 256 - }, - "duration": { - "type": "integer", - "description": "The duration of the song in seconds.", - "minimum": 1 - }, - "trackNumber": { - "type": "integer", - "description": "The track number of the song in the album.", - "minimum": 1 - }, - "discNumber": { - "type": "integer", - "description": "The disc number of the song in the album.", - "minimum": 1 - }, - "releaseDate": { - "type": "string", - "description": "The release date of the song.", - "format": "datetime" - }, - "year": { - "type": "integer", - "description": "The year the song was released." - }, - "genre": { - "type": "string", - "description": "The genre of the song.", - "maxLength": 256 - }, - "tags": { - "type": "array", - "description": "The tags of the song.", - "items": { - "type": "string", - "minLength": 1, - "maxLength": 256 - } - }, - "composer": { - "type": "string", - "description": "The composer of the song.", - "maxLength": 256 - }, - "lyrics": { - "type": "string", - "description": "The lyrics of the song.", - "maxLength": 10000 - }, - "copyrightMessage": { - "type": "string", - "description": "The copyright message of the song.", - "minLength": 1, - "maxLength": 256 - }, - "wiki": { - "type": "string", - "description": "Informations about the song", - "maxLength": 10000 - }, - "albumArt": { - "type": "blob", - "description": "The album art of the song.", - "accept": [ - "image/png", - "image/jpeg" - ], - "maxSize": 2000000 - }, - "youtubeLink": { - "type": "string", - "description": "The YouTube link of the song.", - "format": "uri" - }, - "spotifyLink": { - "type": "string", - "description": "The Spotify link of the song.", - "format": "uri" - }, - "tidalLink": { - "type": "string", - "description": "The Tidal link of the song.", - "format": "uri" - }, - "appleMusicLink": { - "type": "string", - "description": "The Apple Music link of the song.", - "format": "uri" - }, - "createdAt": { - "type": "string", - "description": "The date when the song was created.", - "format": "datetime" - } - } - } - } - } -} diff --git a/apps/api/package.json b/apps/api/package.json index 8bb7c6e2..1c464d4b 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -16,6 +16,7 @@ "pkl:eval": "pkl eval -f json", "pkl:gen": "tsx ./scripts/pkl.ts", "dev:xrpc": "tsx --watch ./src/server.ts", + "prod:xrpc": "tsx ./src/server.ts", "db:migrate": "drizzle-kit migrate" }, "dependencies": { diff --git a/apps/api/pkl/defs/player/addItemsToQueue.pkl b/apps/api/pkl/defs/player/addItemsToQueue.pkl new file mode 100644 index 00000000..25b6a88e --- /dev/null +++ b/apps/api/pkl/defs/player/addItemsToQueue.pkl @@ -0,0 +1,30 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.player.addItemsToQueue" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Add items to the player's queue" + parameters { + type = "params" + required = List("items") + properties { + ["playerId"] = new StringType { + type = "string" + } + ["items"] = new Array { + type = "array" + items = new StringType { + type = "string" + description = "List of file identifiers to add to the queue" + } + } + ["position"] = new IntegerType { + type = "integer" + description = "Position in the queue to insert the items at, defaults to the end if not specified" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/player/defs.pkl b/apps/api/pkl/defs/player/defs.pkl index 8143eb74..4578e182 100644 --- a/apps/api/pkl/defs/player/defs.pkl +++ b/apps/api/pkl/defs/player/defs.pkl @@ -12,4 +12,16 @@ defs = new Mapping { } } } + ["playbackQueueViewDetailed"] { + type = "object" + properties { + ["tracks"] = new Array { + type = "array" + items = new Ref { + type = "ref" + ref = "app.rocksky.song.defs.songViewBasic" + } + } + } + } } \ No newline at end of file diff --git a/apps/api/pkl/defs/player/getCurrentlyPlaying.pkl b/apps/api/pkl/defs/player/getCurrentlyPlaying.pkl index 097c9b68..cd322d03 100644 --- a/apps/api/pkl/defs/player/getCurrentlyPlaying.pkl +++ b/apps/api/pkl/defs/player/getCurrentlyPlaying.pkl @@ -9,6 +9,9 @@ defs = new Mapping { parameters { type = "params" properties { + ["playerId"] = new StringType { + type = "string" + } ["actor"] = new StringType { type = "string" format = "at-identifier" diff --git a/apps/api/pkl/defs/player/getPlaybackQueue.pkl b/apps/api/pkl/defs/player/getPlaybackQueue.pkl new file mode 100644 index 00000000..0ca833f0 --- /dev/null +++ b/apps/api/pkl/defs/player/getPlaybackQueue.pkl @@ -0,0 +1,25 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.player.getPlaybackQueue" +defs = new Mapping { + ["main"] { + type = "query" + description = "Retrieve the current playback queue" + parameters { + type = "params" + properties { + ["playerId"] = new StringType { + type = "string" + } + } + } + output { + encoding = "application/json" + schema = new Ref { + type = "ref" + ref = "app.rocksky.player.defs#playbackQueueViewDetailed" + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/player/next.pkl b/apps/api/pkl/defs/player/next.pkl index 368ff275..4b31c25f 100644 --- a/apps/api/pkl/defs/player/next.pkl +++ b/apps/api/pkl/defs/player/next.pkl @@ -6,5 +6,13 @@ defs = new Mapping { ["main"] { type = "procedure" description = "Play the next track in the queue" + parameters { + type = "params" + properties { + ["playerId"] = new StringType { + type = "string" + } + } + } } } \ No newline at end of file diff --git a/apps/api/pkl/defs/player/pause.pkl b/apps/api/pkl/defs/player/pause.pkl index 3cd66edc..055f5dc6 100644 --- a/apps/api/pkl/defs/player/pause.pkl +++ b/apps/api/pkl/defs/player/pause.pkl @@ -6,5 +6,13 @@ defs = new Mapping { ["main"] { type = "procedure" description = "Pause the currently playing track" + parameters { + type = "params" + properties { + ["playerId"] = new StringType { + type = "string" + } + } + } } } \ No newline at end of file diff --git a/apps/api/pkl/defs/player/play.pkl b/apps/api/pkl/defs/player/play.pkl index 2cbd07c1..41e2f685 100644 --- a/apps/api/pkl/defs/player/play.pkl +++ b/apps/api/pkl/defs/player/play.pkl @@ -6,5 +6,13 @@ defs = new Mapping { ["main"] { type = "procedure" description = "Resume playback of the currently paused track" + parameters { + type = "params" + properties { + ["playerId"] = new StringType { + type = "string" + } + } + } } } \ No newline at end of file diff --git a/apps/api/pkl/defs/player/playDirectory.pkl b/apps/api/pkl/defs/player/playDirectory.pkl new file mode 100644 index 00000000..46758535 --- /dev/null +++ b/apps/api/pkl/defs/player/playDirectory.pkl @@ -0,0 +1,22 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.player.playDirectory" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Play all tracks in a directory" + parameters { + type = "params" + required = List("directoryId") + properties { + ["playerId"] = new StringType { + type = "string" + } + ["directoryId"] = new StringType { + type = "string" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/player/playFile.pkl b/apps/api/pkl/defs/player/playFile.pkl new file mode 100644 index 00000000..db01342f --- /dev/null +++ b/apps/api/pkl/defs/player/playFile.pkl @@ -0,0 +1,22 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.player.playFile" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Play a specific audio file" + parameters { + type = "params" + required = List("fileId") + properties { + ["playerId"] = new StringType { + type = "string" + } + ["fileId"] = new StringType { + type = "string" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/player/previous.pkl b/apps/api/pkl/defs/player/previous.pkl index c15cac40..f0d2cb32 100644 --- a/apps/api/pkl/defs/player/previous.pkl +++ b/apps/api/pkl/defs/player/previous.pkl @@ -6,5 +6,13 @@ defs = new Mapping { ["main"] { type = "procedure" description = "Play the previous track in the queue" + parameters { + type = "params" + properties { + ["playerId"] = new StringType { + type = "string" + } + } + } } } \ No newline at end of file diff --git a/apps/api/pkl/defs/player/seek.pkl b/apps/api/pkl/defs/player/seek.pkl index dafb9b87..a424bcfc 100644 --- a/apps/api/pkl/defs/player/seek.pkl +++ b/apps/api/pkl/defs/player/seek.pkl @@ -9,8 +9,11 @@ defs = new Mapping { parameters { type = "params" required = List("position") - properties = new Mapping { - ["position"] { + properties = new Mapping { + ["playerId"] = new StringType { + type = "string" + } + ["position"] = new IntegerType { type = "integer" description = "The position in seconds to seek to" } diff --git a/apps/api/pkl/defs/playlist/createPlaylist.pkl b/apps/api/pkl/defs/playlist/createPlaylist.pkl new file mode 100644 index 00000000..95f8b966 --- /dev/null +++ b/apps/api/pkl/defs/playlist/createPlaylist.pkl @@ -0,0 +1,24 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.playlist.createPlaylist" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Create a new playlist" + parameters { + type = "params" + required = List("name") + properties { + ["name"] = new StringType { + type = "string" + description = "The name of the playlist" + } + ["description"] = new StringType { + type = "string" + description = "A brief description of the playlist" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/playlist/insertDirectory.pkl b/apps/api/pkl/defs/playlist/insertDirectory.pkl new file mode 100644 index 00000000..2e0462d2 --- /dev/null +++ b/apps/api/pkl/defs/playlist/insertDirectory.pkl @@ -0,0 +1,25 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.playlist.insertDirectory" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Insert a directory into a playlist" + parameters { + type = "params" + required = List("uri") + properties { + ["uri"] = new StringType { + type = "string" + description = "The URI of the playlist to start" + format = "at-uri" + } + ["directory"] = new StringType { + type = "string" + description = "The directory (id) to insert into the playlist" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/playlist/insertFiles.pkl b/apps/api/pkl/defs/playlist/insertFiles.pkl new file mode 100644 index 00000000..2b59bc7e --- /dev/null +++ b/apps/api/pkl/defs/playlist/insertFiles.pkl @@ -0,0 +1,28 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.playlist.insertFiles" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Insert files into a playlist" + parameters { + type = "params" + required = List("uri") + properties { + ["uri"] = new StringType { + type = "string" + description = "The URI of the playlist to start" + format = "at-uri" + } + ["files"] = new Array { + type = "array" + items = new StringType { + type = "string" + description = "List of file (id) to insert into the playlist" + } + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/playlist/removePlaylist.pkl b/apps/api/pkl/defs/playlist/removePlaylist.pkl new file mode 100644 index 00000000..7e66fa70 --- /dev/null +++ b/apps/api/pkl/defs/playlist/removePlaylist.pkl @@ -0,0 +1,21 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.playlist.removePlaylist" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Remove a playlist" + parameters { + type = "params" + required = List("uri") + properties { + ["uri"] = new StringType { + type = "string" + description = "The URI of the playlist to remove" + format = "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/playlist/removeTrack.pkl b/apps/api/pkl/defs/playlist/removeTrack.pkl new file mode 100644 index 00000000..aa012c34 --- /dev/null +++ b/apps/api/pkl/defs/playlist/removeTrack.pkl @@ -0,0 +1,25 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.playlist.removeTrack" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Remove a track from a playlist" + parameters { + type = "params" + required = List("uri", "position") + properties { + ["uri"] = new StringType { + type = "string" + description = "The URI of the playlist to remove the track from" + format = "at-uri" + } + ["position"] = new IntegerType { + type = "integer" + description = "The position of the track to remove in the playlist" + } + } + } + } +} \ No newline at end of file diff --git a/apps/api/pkl/defs/playlist/startPlaylist.pkl b/apps/api/pkl/defs/playlist/startPlaylist.pkl new file mode 100644 index 00000000..514444d9 --- /dev/null +++ b/apps/api/pkl/defs/playlist/startPlaylist.pkl @@ -0,0 +1,21 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.playlist.startPlaylist" +defs = new Mapping { + ["main"] { + type = "procedure" + description = "Start a playlist" + parameters { + type = "params" + required = List("uri") + properties { + ["uri"] = new StringType { + type = "string" + description = "The URI of the playlist to start" + format = "at-uri" + } + } + } + } +} diff --git a/apps/api/pkl/defs/song/lovedSong.pkl b/apps/api/pkl/defs/song/lovedSong.pkl deleted file mode 100644 index 47f9e66f..00000000 --- a/apps/api/pkl/defs/song/lovedSong.pkl +++ /dev/null @@ -1,151 +0,0 @@ -amends "../../schema/lexicon.pkl" - -lexicon = 1 -id = "app.rocksky.lovedSong" -defs = new Mapping { - ["main"] { - type = "record" - key = "tid" - description = "A declaration of a song." - `record` { - type = "object" - required = List("title", "artist", "album", "duration", "createdAt") - properties { - ["title"] = new StringType { - type = "string" - description = "The title of the song." - minLength = 1 - maxLength = 512 - } - - ["artist"] = new StringType { - type = "string" - description = "The artist of the song." - minLength = 1 - maxLength = 256 - } - - ["albumArtist"] = new StringType { - type = "string" - description = "The album artist of the song." - minLength = 1 - maxLength = 256 - } - - ["album"] = new StringType { - type = "string" - description = "The album of the song." - minLength = 1 - maxLength = 256 - } - - ["duration"] = new IntegerType { - type = "integer" - description = "The duration of the song in seconds." - minimum = 1 - } - - ["trackNumber"] = new IntegerType { - type = "integer" - description = "The track number of the song in the album." - minimum = 1 - } - - ["discNumber"] = new IntegerType { - type = "integer" - description = "The disc number of the song in the album." - minimum = 1 - } - - ["releaseDate"] = new StringType { - type = "string" - description = "The release date of the song." - format = "datetime" - } - - ["year"] = new IntegerType { - type = "integer" - description = "The year the song was released." - } - - ["genre"] = new StringType { - type = "string" - description = "The genre of the song." - maxLength = 256 - } - - ["tags"] = new Array { - type = "array" - description = "The tags of the song." - items = new StringType { - type = "string" - minLength = 1 - maxLength = 256 - } - } - - ["composer"] = new StringType { - type = "string" - description = "The composer of the song." - maxLength = 256 - } - - ["lyrics"] = new StringType { - type = "string" - description = "The lyrics of the song." - maxLength = 10000 - } - - ["copyrightMessage"] = new StringType { - type = "string" - description = "The copyright message of the song." - minLength = 1 - maxLength = 256 - } - - ["wiki"] = new StringType { - type = "string" - description = "Informations about the song" - maxLength = 10000 - } - - ["albumArt"] = new Blob { - type = "blob" - description = "The album art of the song." - accept = List("image/png", "image/jpeg") - maxSize = 2000000 - } - - ["youtubeLink"] = new StringType { - type = "string" - description = "The YouTube link of the song." - format = "uri" - } - - ["spotifyLink"] = new StringType { - type = "string" - description = "The Spotify link of the song." - format = "uri" - } - - ["tidalLink"] = new StringType { - type = "string" - description = "The Tidal link of the song." - format = "uri" - } - - ["appleMusicLink"] = new StringType { - type = "string" - description = "The Apple Music link of the song." - format = "uri" - } - - ["createdAt"] = new StringType { - type = "string" - description = "The date when the song was created." - format = "datetime" - } - } - } - } -} diff --git a/apps/api/src/lexicon/index.ts b/apps/api/src/lexicon/index.ts index e3c69c59..858828db 100644 --- a/apps/api/src/lexicon/index.ts +++ b/apps/api/src/lexicon/index.ts @@ -41,14 +41,24 @@ import * as AppRockskyLikeDislikeShout from './types/app/rocksky/like/dislikeSho import * as AppRockskyLikeDislikeSong from './types/app/rocksky/like/dislikeSong' import * as AppRockskyLikeLikeShout from './types/app/rocksky/like/likeShout' import * as AppRockskyLikeLikeSong from './types/app/rocksky/like/likeSong' +import * as AppRockskyPlayerAddItemsToQueue from './types/app/rocksky/player/addItemsToQueue' import * as AppRockskyPlayerGetCurrentlyPlaying from './types/app/rocksky/player/getCurrentlyPlaying' +import * as AppRockskyPlayerGetPlaybackQueue from './types/app/rocksky/player/getPlaybackQueue' import * as AppRockskyPlayerNext from './types/app/rocksky/player/next' import * as AppRockskyPlayerPause from './types/app/rocksky/player/pause' +import * as AppRockskyPlayerPlayDirectory from './types/app/rocksky/player/playDirectory' +import * as AppRockskyPlayerPlayFile from './types/app/rocksky/player/playFile' import * as AppRockskyPlayerPlay from './types/app/rocksky/player/play' import * as AppRockskyPlayerPrevious from './types/app/rocksky/player/previous' import * as AppRockskyPlayerSeek from './types/app/rocksky/player/seek' +import * as AppRockskyPlaylistCreatePlaylist from './types/app/rocksky/playlist/createPlaylist' import * as AppRockskyPlaylistGetPlaylist from './types/app/rocksky/playlist/getPlaylist' import * as AppRockskyPlaylistGetPlaylists from './types/app/rocksky/playlist/getPlaylists' +import * as AppRockskyPlaylistInsertDirectory from './types/app/rocksky/playlist/insertDirectory' +import * as AppRockskyPlaylistInsertFiles from './types/app/rocksky/playlist/insertFiles' +import * as AppRockskyPlaylistRemovePlaylist from './types/app/rocksky/playlist/removePlaylist' +import * as AppRockskyPlaylistRemoveTrack from './types/app/rocksky/playlist/removeTrack' +import * as AppRockskyPlaylistStartPlaylist from './types/app/rocksky/playlist/startPlaylist' import * as AppRockskyScrobbleCreateScrobble from './types/app/rocksky/scrobble/createScrobble' import * as AppRockskyScrobbleGetScrobble from './types/app/rocksky/scrobble/getScrobble' import * as AppRockskyScrobbleGetScrobbles from './types/app/rocksky/scrobble/getScrobbles' @@ -571,6 +581,17 @@ export class AppRockskyPlayerNS { this._server = server } + addItemsToQueue( + cfg: ConfigOf< + AV, + AppRockskyPlayerAddItemsToQueue.Handler>, + AppRockskyPlayerAddItemsToQueue.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.player.addItemsToQueue' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getCurrentlyPlaying( cfg: ConfigOf< AV, @@ -582,6 +603,17 @@ export class AppRockskyPlayerNS { return this._server.xrpc.method(nsid, cfg) } + getPlaybackQueue( + cfg: ConfigOf< + AV, + AppRockskyPlayerGetPlaybackQueue.Handler>, + AppRockskyPlayerGetPlaybackQueue.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.player.getPlaybackQueue' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + next( cfg: ConfigOf< AV, @@ -604,6 +636,28 @@ export class AppRockskyPlayerNS { return this._server.xrpc.method(nsid, cfg) } + playDirectory( + cfg: ConfigOf< + AV, + AppRockskyPlayerPlayDirectory.Handler>, + AppRockskyPlayerPlayDirectory.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.player.playDirectory' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + playFile( + cfg: ConfigOf< + AV, + AppRockskyPlayerPlayFile.Handler>, + AppRockskyPlayerPlayFile.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.player.playFile' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + play( cfg: ConfigOf< AV, @@ -645,6 +699,17 @@ export class AppRockskyPlaylistNS { this._server = server } + createPlaylist( + cfg: ConfigOf< + AV, + AppRockskyPlaylistCreatePlaylist.Handler>, + AppRockskyPlaylistCreatePlaylist.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.playlist.createPlaylist' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getPlaylist( cfg: ConfigOf< AV, @@ -666,6 +731,61 @@ export class AppRockskyPlaylistNS { const nsid = 'app.rocksky.playlist.getPlaylists' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + + insertDirectory( + cfg: ConfigOf< + AV, + AppRockskyPlaylistInsertDirectory.Handler>, + AppRockskyPlaylistInsertDirectory.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.playlist.insertDirectory' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + insertFiles( + cfg: ConfigOf< + AV, + AppRockskyPlaylistInsertFiles.Handler>, + AppRockskyPlaylistInsertFiles.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.playlist.insertFiles' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + removePlaylist( + cfg: ConfigOf< + AV, + AppRockskyPlaylistRemovePlaylist.Handler>, + AppRockskyPlaylistRemovePlaylist.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.playlist.removePlaylist' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + removeTrack( + cfg: ConfigOf< + AV, + AppRockskyPlaylistRemoveTrack.Handler>, + AppRockskyPlaylistRemoveTrack.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.playlist.removeTrack' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + startPlaylist( + cfg: ConfigOf< + AV, + AppRockskyPlaylistStartPlaylist.Handler>, + AppRockskyPlaylistStartPlaylist.HandlerReqCtx> + >, + ) { + const nsid = 'app.rocksky.playlist.startPlaylist' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } } export class AppRockskyScrobbleNS { diff --git a/apps/api/src/lexicon/lexicons.ts b/apps/api/src/lexicon/lexicons.ts index ef6817cb..d2b3fa2a 100644 --- a/apps/api/src/lexicon/lexicons.ts +++ b/apps/api/src/lexicon/lexicons.ts @@ -1866,6 +1866,37 @@ export const schemaDict = { }, }, }, + AppRockskyPlayerAddItemsToQueue: { + lexicon: 1, + id: 'app.rocksky.player.addItemsToQueue', + defs: { + main: { + type: 'procedure', + description: "Add items to the player's queue", + parameters: { + type: 'params', + required: ['items'], + properties: { + playerId: { + type: 'string', + }, + items: { + type: 'array', + items: { + type: 'string', + description: 'List of file identifiers to add to the queue', + }, + }, + position: { + type: 'integer', + description: + 'Position in the queue to insert the items at, defaults to the end if not specified', + }, + }, + }, + }, + }, + }, AppRockskyPlayerDefs: { lexicon: 1, id: 'app.rocksky.player.defs', @@ -1879,6 +1910,18 @@ export const schemaDict = { }, }, }, + playbackQueueViewDetailed: { + type: 'object', + properties: { + tracks: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.rocksky.song.defs.songViewBasic', + }, + }, + }, + }, }, }, AppRockskyPlayerGetCurrentlyPlaying: { @@ -1891,6 +1934,9 @@ export const schemaDict = { parameters: { type: 'params', properties: { + playerId: { + type: 'string', + }, actor: { type: 'string', description: @@ -1909,6 +1955,31 @@ export const schemaDict = { }, }, }, + AppRockskyPlayerGetPlaybackQueue: { + lexicon: 1, + id: 'app.rocksky.player.getPlaybackQueue', + defs: { + main: { + type: 'query', + description: 'Retrieve the current playback queue', + parameters: { + type: 'params', + properties: { + playerId: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:app.rocksky.player.defs#playbackQueueViewDetailed', + }, + }, + }, + }, + }, AppRockskyPlayerNext: { lexicon: 1, id: 'app.rocksky.player.next', @@ -1916,6 +1987,14 @@ export const schemaDict = { main: { type: 'procedure', description: 'Play the next track in the queue', + parameters: { + type: 'params', + properties: { + playerId: { + type: 'string', + }, + }, + }, }, }, }, @@ -1926,6 +2005,58 @@ export const schemaDict = { main: { type: 'procedure', description: 'Pause the currently playing track', + parameters: { + type: 'params', + properties: { + playerId: { + type: 'string', + }, + }, + }, + }, + }, + }, + AppRockskyPlayerPlayDirectory: { + lexicon: 1, + id: 'app.rocksky.player.playDirectory', + defs: { + main: { + type: 'procedure', + description: 'Play all tracks in a directory', + parameters: { + type: 'params', + required: ['directoryId'], + properties: { + playerId: { + type: 'string', + }, + directoryId: { + type: 'string', + }, + }, + }, + }, + }, + }, + AppRockskyPlayerPlayFile: { + lexicon: 1, + id: 'app.rocksky.player.playFile', + defs: { + main: { + type: 'procedure', + description: 'Play a specific audio file', + parameters: { + type: 'params', + required: ['fileId'], + properties: { + playerId: { + type: 'string', + }, + fileId: { + type: 'string', + }, + }, + }, }, }, }, @@ -1936,6 +2067,14 @@ export const schemaDict = { main: { type: 'procedure', description: 'Resume playback of the currently paused track', + parameters: { + type: 'params', + properties: { + playerId: { + type: 'string', + }, + }, + }, }, }, }, @@ -1946,6 +2085,14 @@ export const schemaDict = { main: { type: 'procedure', description: 'Play the previous track in the queue', + parameters: { + type: 'params', + properties: { + playerId: { + type: 'string', + }, + }, + }, }, }, }, @@ -1961,6 +2108,9 @@ export const schemaDict = { type: 'params', required: ['position'], properties: { + playerId: { + type: 'string', + }, position: { type: 'integer', description: 'The position in seconds to seek to', @@ -1970,6 +2120,30 @@ export const schemaDict = { }, }, }, + AppRockskyPlaylistCreatePlaylist: { + lexicon: 1, + id: 'app.rocksky.playlist.createPlaylist', + defs: { + main: { + type: 'procedure', + description: 'Create a new playlist', + parameters: { + type: 'params', + required: ['name'], + properties: { + name: { + type: 'string', + description: 'The name of the playlist', + }, + description: { + type: 'string', + description: 'A brief description of the playlist', + }, + }, + }, + }, + }, + }, AppRockskyPlaylistDefs: { lexicon: 1, id: 'app.rocksky.playlist.defs', @@ -2161,6 +2335,59 @@ export const schemaDict = { }, }, }, + AppRockskyPlaylistInsertDirectory: { + lexicon: 1, + id: 'app.rocksky.playlist.insertDirectory', + defs: { + main: { + type: 'procedure', + description: 'Insert a directory into a playlist', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + description: 'The URI of the playlist to start', + format: 'at-uri', + }, + directory: { + type: 'string', + description: 'The directory (id) to insert into the playlist', + }, + }, + }, + }, + }, + }, + AppRockskyPlaylistInsertFiles: { + lexicon: 1, + id: 'app.rocksky.playlist.insertFiles', + defs: { + main: { + type: 'procedure', + description: 'Insert files into a playlist', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + description: 'The URI of the playlist to start', + format: 'at-uri', + }, + files: { + type: 'array', + items: { + type: 'string', + description: 'List of file (id) to insert into the playlist', + }, + }, + }, + }, + }, + }, + }, AppRockskyPlaylist: { lexicon: 1, id: 'app.rocksky.playlist', @@ -2225,6 +2452,74 @@ export const schemaDict = { }, }, }, + AppRockskyPlaylistRemovePlaylist: { + lexicon: 1, + id: 'app.rocksky.playlist.removePlaylist', + defs: { + main: { + type: 'procedure', + description: 'Remove a playlist', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + description: 'The URI of the playlist to remove', + format: 'at-uri', + }, + }, + }, + }, + }, + }, + AppRockskyPlaylistRemoveTrack: { + lexicon: 1, + id: 'app.rocksky.playlist.removeTrack', + defs: { + main: { + type: 'procedure', + description: 'Remove a track from a playlist', + parameters: { + type: 'params', + required: ['uri', 'position'], + properties: { + uri: { + type: 'string', + description: 'The URI of the playlist to remove the track from', + format: 'at-uri', + }, + position: { + type: 'integer', + description: + 'The position of the track to remove in the playlist', + }, + }, + }, + }, + }, + }, + AppRockskyPlaylistStartPlaylist: { + lexicon: 1, + id: 'app.rocksky.playlist.startPlaylist', + defs: { + main: { + type: 'procedure', + description: 'Start a playlist', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + description: 'The URI of the playlist to start', + format: 'at-uri', + }, + }, + }, + }, + }, + }, AppRockskyRadioDefs: { lexicon: 1, id: 'app.rocksky.radio.defs', @@ -3572,137 +3867,6 @@ export const schemaDict = { }, }, }, - AppRockskyLovedSong: { - lexicon: 1, - id: 'app.rocksky.lovedSong', - defs: { - main: { - type: 'record', - description: 'A declaration of a song.', - key: 'tid', - record: { - type: 'object', - required: ['title', 'artist', 'album', 'duration', 'createdAt'], - properties: { - title: { - type: 'string', - description: 'The title of the song.', - minLength: 1, - maxLength: 512, - }, - artist: { - type: 'string', - description: 'The artist of the song.', - minLength: 1, - maxLength: 256, - }, - albumArtist: { - type: 'string', - description: 'The album artist of the song.', - minLength: 1, - maxLength: 256, - }, - album: { - type: 'string', - description: 'The album of the song.', - minLength: 1, - maxLength: 256, - }, - duration: { - type: 'integer', - description: 'The duration of the song in seconds.', - minimum: 1, - }, - trackNumber: { - type: 'integer', - description: 'The track number of the song in the album.', - minimum: 1, - }, - discNumber: { - type: 'integer', - description: 'The disc number of the song in the album.', - minimum: 1, - }, - releaseDate: { - type: 'string', - description: 'The release date of the song.', - format: 'datetime', - }, - year: { - type: 'integer', - description: 'The year the song was released.', - }, - genre: { - type: 'string', - description: 'The genre of the song.', - maxLength: 256, - }, - tags: { - type: 'array', - description: 'The tags of the song.', - items: { - type: 'string', - minLength: 1, - maxLength: 256, - }, - }, - composer: { - type: 'string', - description: 'The composer of the song.', - maxLength: 256, - }, - lyrics: { - type: 'string', - description: 'The lyrics of the song.', - maxLength: 10000, - }, - copyrightMessage: { - type: 'string', - description: 'The copyright message of the song.', - minLength: 1, - maxLength: 256, - }, - wiki: { - type: 'string', - description: 'Informations about the song', - maxLength: 10000, - }, - albumArt: { - type: 'blob', - description: 'The album art of the song.', - accept: ['image/png', 'image/jpeg'], - maxSize: 2000000, - }, - youtubeLink: { - type: 'string', - description: 'The YouTube link of the song.', - format: 'uri', - }, - spotifyLink: { - type: 'string', - description: 'The Spotify link of the song.', - format: 'uri', - }, - tidalLink: { - type: 'string', - description: 'The Tidal link of the song.', - format: 'uri', - }, - appleMusicLink: { - type: 'string', - description: 'The Apple Music link of the song.', - format: 'uri', - }, - createdAt: { - type: 'string', - description: 'The date when the song was created.', - format: 'datetime', - }, - }, - }, - }, - }, - }, AppRockskySong: { lexicon: 1, id: 'app.rocksky.song', @@ -4103,17 +4267,27 @@ export const ids = { AppRockskyLike: 'app.rocksky.like', AppRockskyLikeLikeShout: 'app.rocksky.like.likeShout', AppRockskyLikeLikeSong: 'app.rocksky.like.likeSong', + AppRockskyPlayerAddItemsToQueue: 'app.rocksky.player.addItemsToQueue', AppRockskyPlayerDefs: 'app.rocksky.player.defs', AppRockskyPlayerGetCurrentlyPlaying: 'app.rocksky.player.getCurrentlyPlaying', + AppRockskyPlayerGetPlaybackQueue: 'app.rocksky.player.getPlaybackQueue', AppRockskyPlayerNext: 'app.rocksky.player.next', AppRockskyPlayerPause: 'app.rocksky.player.pause', + AppRockskyPlayerPlayDirectory: 'app.rocksky.player.playDirectory', + AppRockskyPlayerPlayFile: 'app.rocksky.player.playFile', AppRockskyPlayerPlay: 'app.rocksky.player.play', AppRockskyPlayerPrevious: 'app.rocksky.player.previous', AppRockskyPlayerSeek: 'app.rocksky.player.seek', + AppRockskyPlaylistCreatePlaylist: 'app.rocksky.playlist.createPlaylist', AppRockskyPlaylistDefs: 'app.rocksky.playlist.defs', AppRockskyPlaylistGetPlaylist: 'app.rocksky.playlist.getPlaylist', AppRockskyPlaylistGetPlaylists: 'app.rocksky.playlist.getPlaylists', + AppRockskyPlaylistInsertDirectory: 'app.rocksky.playlist.insertDirectory', + AppRockskyPlaylistInsertFiles: 'app.rocksky.playlist.insertFiles', AppRockskyPlaylist: 'app.rocksky.playlist', + AppRockskyPlaylistRemovePlaylist: 'app.rocksky.playlist.removePlaylist', + AppRockskyPlaylistRemoveTrack: 'app.rocksky.playlist.removeTrack', + AppRockskyPlaylistStartPlaylist: 'app.rocksky.playlist.startPlaylist', AppRockskyRadioDefs: 'app.rocksky.radio.defs', AppRockskyRadio: 'app.rocksky.radio', AppRockskyScrobbleCreateScrobble: 'app.rocksky.scrobble.createScrobble', @@ -4136,7 +4310,6 @@ export const ids = { AppRockskySongDefs: 'app.rocksky.song.defs', AppRockskySongGetSong: 'app.rocksky.song.getSong', AppRockskySongGetSongs: 'app.rocksky.song.getSongs', - AppRockskyLovedSong: 'app.rocksky.lovedSong', AppRockskySong: 'app.rocksky.song', AppRockskySpotifyDefs: 'app.rocksky.spotify.defs', AppRockskySpotifyGetCurrentlyPlaying: diff --git a/apps/api/src/lexicon/types/app/rocksky/lovedSong.ts b/apps/api/src/lexicon/types/app/rocksky/lovedSong.ts deleted file mode 100644 index cb0aab5e..00000000 --- a/apps/api/src/lexicon/types/app/rocksky/lovedSong.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { lexicons } from '../../../lexicons' -import { isObj, hasProp } from '../../../util' -import { CID } from 'multiformats/cid' - -export interface Record { - /** The title of the song. */ - title: string - /** The artist of the song. */ - artist: string - /** The album artist of the song. */ - albumArtist?: string - /** The album of the song. */ - album: string - /** The duration of the song in seconds. */ - duration: number - /** The track number of the song in the album. */ - trackNumber?: number - /** The disc number of the song in the album. */ - discNumber?: number - /** The release date of the song. */ - releaseDate?: string - /** The year the song was released. */ - year?: number - /** The genre of the song. */ - genre?: string - /** The tags of the song. */ - tags?: string[] - /** The composer of the song. */ - composer?: string - /** The lyrics of the song. */ - lyrics?: string - /** The copyright message of the song. */ - copyrightMessage?: string - /** Informations about the song */ - wiki?: string - /** The album art of the song. */ - albumArt?: BlobRef - /** The YouTube link of the song. */ - youtubeLink?: string - /** The Spotify link of the song. */ - spotifyLink?: string - /** The Tidal link of the song. */ - tidalLink?: string - /** The Apple Music link of the song. */ - appleMusicLink?: string - /** The date when the song was created. */ - createdAt: string - [k: string]: unknown -} - -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.rocksky.lovedSong#main' || - v.$type === 'app.rocksky.lovedSong') - ) -} - -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.rocksky.lovedSong#main', v) -} diff --git a/apps/api/src/lexicon/types/app/rocksky/player/addItemsToQueue.ts b/apps/api/src/lexicon/types/app/rocksky/player/addItemsToQueue.ts new file mode 100644 index 00000000..11482efd --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/player/addItemsToQueue.ts @@ -0,0 +1,37 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + playerId?: string + items: string[] + /** Position in the queue to insert the items at, defaults to the end if not specified */ + position?: number +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/player/defs.ts b/apps/api/src/lexicon/types/app/rocksky/player/defs.ts index 06237d6c..4b198ece 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/defs.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/defs.ts @@ -5,6 +5,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon' import { lexicons } from '../../../../lexicons' import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' +import * as AppRockskySongDefsSongViewBasic from '../song/defs/songViewBasic' export interface CurrentlyPlayingViewDetailed { /** The title of the currently playing track */ @@ -30,3 +31,27 @@ export function validateCurrentlyPlayingViewDetailed( v, ) } + +export interface PlaybackQueueViewDetailed { + tracks?: AppRockskySongDefsSongViewBasic.Main[] + [k: string]: unknown +} + +export function isPlaybackQueueViewDetailed( + v: unknown, +): v is PlaybackQueueViewDetailed { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.rocksky.player.defs#playbackQueueViewDetailed' + ) +} + +export function validatePlaybackQueueViewDetailed( + v: unknown, +): ValidationResult { + return lexicons.validate( + 'app.rocksky.player.defs#playbackQueueViewDetailed', + v, + ) +} diff --git a/apps/api/src/lexicon/types/app/rocksky/player/getCurrentlyPlaying.ts b/apps/api/src/lexicon/types/app/rocksky/player/getCurrentlyPlaying.ts index 8b90df1a..d8839126 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/getCurrentlyPlaying.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/getCurrentlyPlaying.ts @@ -10,6 +10,7 @@ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' import * as AppRockskyPlayerDefs from './defs' export interface QueryParams { + playerId?: string /** Handle or DID of the actor to retrieve the currently playing track for. If not provided, defaults to the current user. */ actor?: string } diff --git a/apps/api/src/lexicon/types/app/rocksky/player/getPlaybackQueue.ts b/apps/api/src/lexicon/types/app/rocksky/player/getPlaybackQueue.ts new file mode 100644 index 00000000..c8538f72 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/player/getPlaybackQueue.ts @@ -0,0 +1,42 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' +import * as AppRockskyPlayerDefs from './defs' + +export interface QueryParams { + playerId?: string +} + +export type InputSchema = undefined +export type OutputSchema = AppRockskyPlayerDefs.PlaybackQueueViewDetailed +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/player/next.ts b/apps/api/src/lexicon/types/app/rocksky/player/next.ts index 7620d0ab..6538f68b 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/next.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/next.ts @@ -8,7 +8,9 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' -export interface QueryParams {} +export interface QueryParams { + playerId?: string +} export type InputSchema = undefined export type HandlerInput = undefined diff --git a/apps/api/src/lexicon/types/app/rocksky/player/pause.ts b/apps/api/src/lexicon/types/app/rocksky/player/pause.ts index 7620d0ab..6538f68b 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/pause.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/pause.ts @@ -8,7 +8,9 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' -export interface QueryParams {} +export interface QueryParams { + playerId?: string +} export type InputSchema = undefined export type HandlerInput = undefined diff --git a/apps/api/src/lexicon/types/app/rocksky/player/play.ts b/apps/api/src/lexicon/types/app/rocksky/player/play.ts index 7620d0ab..6538f68b 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/play.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/play.ts @@ -8,7 +8,9 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' -export interface QueryParams {} +export interface QueryParams { + playerId?: string +} export type InputSchema = undefined export type HandlerInput = undefined diff --git a/apps/api/src/lexicon/types/app/rocksky/player/playDirectory.ts b/apps/api/src/lexicon/types/app/rocksky/player/playDirectory.ts new file mode 100644 index 00000000..bf6cef02 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/player/playDirectory.ts @@ -0,0 +1,35 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + playerId?: string + directoryId: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/player/playFile.ts b/apps/api/src/lexicon/types/app/rocksky/player/playFile.ts new file mode 100644 index 00000000..a9f4b490 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/player/playFile.ts @@ -0,0 +1,35 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + playerId?: string + fileId: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/player/previous.ts b/apps/api/src/lexicon/types/app/rocksky/player/previous.ts index 7620d0ab..6538f68b 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/previous.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/previous.ts @@ -8,7 +8,9 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' -export interface QueryParams {} +export interface QueryParams { + playerId?: string +} export type InputSchema = undefined export type HandlerInput = undefined diff --git a/apps/api/src/lexicon/types/app/rocksky/player/seek.ts b/apps/api/src/lexicon/types/app/rocksky/player/seek.ts index dd93805e..b80265c9 100644 --- a/apps/api/src/lexicon/types/app/rocksky/player/seek.ts +++ b/apps/api/src/lexicon/types/app/rocksky/player/seek.ts @@ -9,6 +9,7 @@ import { CID } from 'multiformats/cid' import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' export interface QueryParams { + playerId?: string /** The position in seconds to seek to */ position: number } diff --git a/apps/api/src/lexicon/types/app/rocksky/playlist/createPlaylist.ts b/apps/api/src/lexicon/types/app/rocksky/playlist/createPlaylist.ts new file mode 100644 index 00000000..2cd02341 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/playlist/createPlaylist.ts @@ -0,0 +1,37 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The name of the playlist */ + name: string + /** A brief description of the playlist */ + description?: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/playlist/insertDirectory.ts b/apps/api/src/lexicon/types/app/rocksky/playlist/insertDirectory.ts new file mode 100644 index 00000000..b1cca96a --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/playlist/insertDirectory.ts @@ -0,0 +1,37 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The URI of the playlist to start */ + uri: string + /** The directory (id) to insert into the playlist */ + directory?: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/playlist/insertFiles.ts b/apps/api/src/lexicon/types/app/rocksky/playlist/insertFiles.ts new file mode 100644 index 00000000..352dfab9 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/playlist/insertFiles.ts @@ -0,0 +1,36 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The URI of the playlist to start */ + uri: string + files?: string[] +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/playlist/removePlaylist.ts b/apps/api/src/lexicon/types/app/rocksky/playlist/removePlaylist.ts new file mode 100644 index 00000000..b04267fa --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/playlist/removePlaylist.ts @@ -0,0 +1,35 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The URI of the playlist to remove */ + uri: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/playlist/removeTrack.ts b/apps/api/src/lexicon/types/app/rocksky/playlist/removeTrack.ts new file mode 100644 index 00000000..f7929ff3 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/playlist/removeTrack.ts @@ -0,0 +1,37 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The URI of the playlist to remove the track from */ + uri: string + /** The position of the track to remove in the playlist */ + position: number +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/api/src/lexicon/types/app/rocksky/playlist/startPlaylist.ts b/apps/api/src/lexicon/types/app/rocksky/playlist/startPlaylist.ts new file mode 100644 index 00000000..eb37cb6f --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/playlist/startPlaylist.ts @@ -0,0 +1,35 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The URI of the playlist to start */ + uri: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response + resetRouteRateLimits: () => Promise +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/apps/web/src/components/ContextMenu/ContextMenu.tsx b/apps/web/src/components/ContextMenu/ContextMenu.tsx index 060e2439..cb4b15b1 100644 --- a/apps/web/src/components/ContextMenu/ContextMenu.tsx +++ b/apps/web/src/components/ContextMenu/ContextMenu.tsx @@ -142,9 +142,9 @@ function ContextMenu(props: ContextMenuProps) { }, }} > -
+
+ ); -- 2.51.2