@keystrokehq/spotify 0.0.16 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -75
- package/dist/action.cjs +21 -0
- package/dist/action.cjs.map +1 -0
- package/dist/action.mjs +21 -0
- package/dist/action.mjs.map +1 -0
- package/dist/actions/add-item-to-playback-queue.cjs +22 -0
- package/dist/actions/add-item-to-playback-queue.cjs.map +1 -0
- package/dist/actions/add-item-to-playback-queue.d.cts +18 -0
- package/dist/actions/add-item-to-playback-queue.d.cts.map +1 -0
- package/dist/actions/add-item-to-playback-queue.d.mts +18 -0
- package/dist/actions/add-item-to-playback-queue.d.mts.map +1 -0
- package/dist/actions/add-item-to-playback-queue.mjs +19 -0
- package/dist/actions/add-item-to-playback-queue.mjs.map +1 -0
- package/dist/actions/add-items-to-playlist.cjs +20 -0
- package/dist/actions/add-items-to-playlist.cjs.map +1 -0
- package/dist/actions/add-items-to-playlist.d.cts +19 -0
- package/dist/actions/add-items-to-playlist.d.cts.map +1 -0
- package/dist/actions/add-items-to-playlist.d.mts +19 -0
- package/dist/actions/add-items-to-playlist.d.mts.map +1 -0
- package/dist/actions/add-items-to-playlist.mjs +17 -0
- package/dist/actions/add-items-to-playlist.mjs.map +1 -0
- package/dist/actions/change-playlist-details.cjs +25 -0
- package/dist/actions/change-playlist-details.cjs.map +1 -0
- package/dist/actions/change-playlist-details.d.cts +24 -0
- package/dist/actions/change-playlist-details.d.cts.map +1 -0
- package/dist/actions/change-playlist-details.d.mts +24 -0
- package/dist/actions/change-playlist-details.d.mts.map +1 -0
- package/dist/actions/change-playlist-details.mjs +22 -0
- package/dist/actions/change-playlist-details.mjs.map +1 -0
- package/dist/actions/check-if-user-follows-artists-or-users.cjs +19 -0
- package/dist/actions/check-if-user-follows-artists-or-users.cjs.map +1 -0
- package/dist/actions/check-if-user-follows-artists-or-users.d.cts +20 -0
- package/dist/actions/check-if-user-follows-artists-or-users.d.cts.map +1 -0
- package/dist/actions/check-if-user-follows-artists-or-users.d.mts +20 -0
- package/dist/actions/check-if-user-follows-artists-or-users.d.mts.map +1 -0
- package/dist/actions/check-if-user-follows-artists-or-users.mjs +16 -0
- package/dist/actions/check-if-user-follows-artists-or-users.mjs.map +1 -0
- package/dist/actions/check-if-users-follow-playlist.cjs +26 -0
- package/dist/actions/check-if-users-follow-playlist.cjs.map +1 -0
- package/dist/actions/check-if-users-follow-playlist.d.cts +21 -0
- package/dist/actions/check-if-users-follow-playlist.d.cts.map +1 -0
- package/dist/actions/check-if-users-follow-playlist.d.mts +21 -0
- package/dist/actions/check-if-users-follow-playlist.d.mts.map +1 -0
- package/dist/actions/check-if-users-follow-playlist.mjs +25 -0
- package/dist/actions/check-if-users-follow-playlist.mjs.map +1 -0
- package/dist/actions/check-user-s-saved-albums.cjs +16 -0
- package/dist/actions/check-user-s-saved-albums.cjs.map +1 -0
- package/dist/actions/check-user-s-saved-albums.d.cts +15 -0
- package/dist/actions/check-user-s-saved-albums.d.cts.map +1 -0
- package/dist/actions/check-user-s-saved-albums.d.mts +15 -0
- package/dist/actions/check-user-s-saved-albums.d.mts.map +1 -0
- package/dist/actions/check-user-s-saved-albums.mjs +13 -0
- package/dist/actions/check-user-s-saved-albums.mjs.map +1 -0
- package/dist/actions/check-user-s-saved-audiobooks.cjs +16 -0
- package/dist/actions/check-user-s-saved-audiobooks.cjs.map +1 -0
- package/dist/actions/check-user-s-saved-audiobooks.d.cts +15 -0
- package/dist/actions/check-user-s-saved-audiobooks.d.cts.map +1 -0
- package/dist/actions/check-user-s-saved-audiobooks.d.mts +15 -0
- package/dist/actions/check-user-s-saved-audiobooks.d.mts.map +1 -0
- package/dist/actions/check-user-s-saved-audiobooks.mjs +13 -0
- package/dist/actions/check-user-s-saved-audiobooks.mjs.map +1 -0
- package/dist/actions/check-user-s-saved-episodes.cjs +16 -0
- package/dist/actions/check-user-s-saved-episodes.cjs.map +1 -0
- package/dist/actions/check-user-s-saved-episodes.d.cts +15 -0
- package/dist/actions/check-user-s-saved-episodes.d.cts.map +1 -0
- package/dist/actions/check-user-s-saved-episodes.d.mts +15 -0
- package/dist/actions/check-user-s-saved-episodes.d.mts.map +1 -0
- package/dist/actions/check-user-s-saved-episodes.mjs +13 -0
- package/dist/actions/check-user-s-saved-episodes.mjs.map +1 -0
- package/dist/actions/check-user-s-saved-shows.cjs +16 -0
- package/dist/actions/check-user-s-saved-shows.cjs.map +1 -0
- package/dist/actions/check-user-s-saved-shows.d.cts +15 -0
- package/dist/actions/check-user-s-saved-shows.d.cts.map +1 -0
- package/dist/actions/check-user-s-saved-shows.d.mts +15 -0
- package/dist/actions/check-user-s-saved-shows.d.mts.map +1 -0
- package/dist/actions/check-user-s-saved-shows.mjs +13 -0
- package/dist/actions/check-user-s-saved-shows.mjs.map +1 -0
- package/dist/actions/check-user-s-saved-tracks.cjs +16 -0
- package/dist/actions/check-user-s-saved-tracks.cjs.map +1 -0
- package/dist/actions/check-user-s-saved-tracks.d.cts +15 -0
- package/dist/actions/check-user-s-saved-tracks.d.cts.map +1 -0
- package/dist/actions/check-user-s-saved-tracks.d.mts +15 -0
- package/dist/actions/check-user-s-saved-tracks.d.mts.map +1 -0
- package/dist/actions/check-user-s-saved-tracks.mjs +13 -0
- package/dist/actions/check-user-s-saved-tracks.mjs.map +1 -0
- package/dist/actions/create-playlist.cjs +72 -0
- package/dist/actions/create-playlist.cjs.map +1 -0
- package/dist/actions/create-playlist.d.cts +71 -0
- package/dist/actions/create-playlist.d.cts.map +1 -0
- package/dist/actions/create-playlist.d.mts +71 -0
- package/dist/actions/create-playlist.d.mts.map +1 -0
- package/dist/actions/create-playlist.mjs +71 -0
- package/dist/actions/create-playlist.mjs.map +1 -0
- package/dist/actions/follow-artists-or-users.cjs +22 -0
- package/dist/actions/follow-artists-or-users.cjs.map +1 -0
- package/dist/actions/follow-artists-or-users.d.cts +21 -0
- package/dist/actions/follow-artists-or-users.d.cts.map +1 -0
- package/dist/actions/follow-artists-or-users.d.mts +21 -0
- package/dist/actions/follow-artists-or-users.d.mts.map +1 -0
- package/dist/actions/follow-artists-or-users.mjs +19 -0
- package/dist/actions/follow-artists-or-users.mjs.map +1 -0
- package/dist/actions/follow-playlist.cjs +22 -0
- package/dist/actions/follow-playlist.cjs.map +1 -0
- package/dist/actions/follow-playlist.d.cts +18 -0
- package/dist/actions/follow-playlist.d.cts.map +1 -0
- package/dist/actions/follow-playlist.d.mts +18 -0
- package/dist/actions/follow-playlist.d.mts.map +1 -0
- package/dist/actions/follow-playlist.mjs +19 -0
- package/dist/actions/follow-playlist.mjs.map +1 -0
- package/dist/actions/get-a-chapter.cjs +78 -0
- package/dist/actions/get-a-chapter.cjs.map +1 -0
- package/dist/actions/get-a-chapter.d.cts +77 -0
- package/dist/actions/get-a-chapter.d.cts.map +1 -0
- package/dist/actions/get-a-chapter.d.mts +77 -0
- package/dist/actions/get-a-chapter.d.mts.map +1 -0
- package/dist/actions/get-a-chapter.mjs +77 -0
- package/dist/actions/get-a-chapter.mjs.map +1 -0
- package/dist/actions/get-album-tracks.cjs +51 -0
- package/dist/actions/get-album-tracks.cjs.map +1 -0
- package/dist/actions/get-album-tracks.d.cts +47 -0
- package/dist/actions/get-album-tracks.d.cts.map +1 -0
- package/dist/actions/get-album-tracks.d.mts +47 -0
- package/dist/actions/get-album-tracks.d.mts.map +1 -0
- package/dist/actions/get-album-tracks.mjs +50 -0
- package/dist/actions/get-album-tracks.mjs.map +1 -0
- package/dist/actions/get-album.cjs +80 -0
- package/dist/actions/get-album.cjs.map +1 -0
- package/dist/actions/get-album.d.cts +79 -0
- package/dist/actions/get-album.d.cts.map +1 -0
- package/dist/actions/get-album.d.mts +79 -0
- package/dist/actions/get-album.d.mts.map +1 -0
- package/dist/actions/get-album.mjs +79 -0
- package/dist/actions/get-album.mjs.map +1 -0
- package/dist/actions/get-an-audiobook.cjs +80 -0
- package/dist/actions/get-an-audiobook.cjs.map +1 -0
- package/dist/actions/get-an-audiobook.d.cts +78 -0
- package/dist/actions/get-an-audiobook.d.cts.map +1 -0
- package/dist/actions/get-an-audiobook.d.mts +78 -0
- package/dist/actions/get-an-audiobook.d.mts.map +1 -0
- package/dist/actions/get-an-audiobook.mjs +79 -0
- package/dist/actions/get-an-audiobook.mjs.map +1 -0
- package/dist/actions/get-artist-s-albums.cjs +48 -0
- package/dist/actions/get-artist-s-albums.cjs.map +1 -0
- package/dist/actions/get-artist-s-albums.d.cts +47 -0
- package/dist/actions/get-artist-s-albums.d.cts.map +1 -0
- package/dist/actions/get-artist-s-albums.d.mts +47 -0
- package/dist/actions/get-artist-s-albums.d.mts.map +1 -0
- package/dist/actions/get-artist-s-albums.mjs +47 -0
- package/dist/actions/get-artist-s-albums.mjs.map +1 -0
- package/dist/actions/get-artist-s-related-artists.cjs +38 -0
- package/dist/actions/get-artist-s-related-artists.cjs.map +1 -0
- package/dist/actions/get-artist-s-related-artists.d.cts +35 -0
- package/dist/actions/get-artist-s-related-artists.d.cts.map +1 -0
- package/dist/actions/get-artist-s-related-artists.d.mts +35 -0
- package/dist/actions/get-artist-s-related-artists.d.mts.map +1 -0
- package/dist/actions/get-artist-s-related-artists.mjs +37 -0
- package/dist/actions/get-artist-s-related-artists.mjs.map +1 -0
- package/dist/actions/get-artist-s-top-tracks.cjs +77 -0
- package/dist/actions/get-artist-s-top-tracks.cjs.map +1 -0
- package/dist/actions/get-artist-s-top-tracks.d.cts +87 -0
- package/dist/actions/get-artist-s-top-tracks.d.cts.map +1 -0
- package/dist/actions/get-artist-s-top-tracks.d.mts +87 -0
- package/dist/actions/get-artist-s-top-tracks.d.mts.map +1 -0
- package/dist/actions/get-artist-s-top-tracks.mjs +76 -0
- package/dist/actions/get-artist-s-top-tracks.mjs.map +1 -0
- package/dist/actions/get-artist.cjs +38 -0
- package/dist/actions/get-artist.cjs.map +1 -0
- package/dist/actions/get-artist.d.cts +35 -0
- package/dist/actions/get-artist.d.cts.map +1 -0
- package/dist/actions/get-artist.d.mts +35 -0
- package/dist/actions/get-artist.d.mts.map +1 -0
- package/dist/actions/get-artist.mjs +37 -0
- package/dist/actions/get-artist.mjs.map +1 -0
- package/dist/actions/get-audiobook-chapters.cjs +61 -0
- package/dist/actions/get-audiobook-chapters.cjs.map +1 -0
- package/dist/actions/get-audiobook-chapters.d.cts +57 -0
- package/dist/actions/get-audiobook-chapters.d.cts.map +1 -0
- package/dist/actions/get-audiobook-chapters.d.mts +57 -0
- package/dist/actions/get-audiobook-chapters.d.mts.map +1 -0
- package/dist/actions/get-audiobook-chapters.mjs +60 -0
- package/dist/actions/get-audiobook-chapters.mjs.map +1 -0
- package/dist/actions/get-available-devices.cjs +26 -0
- package/dist/actions/get-available-devices.cjs.map +1 -0
- package/dist/actions/get-available-devices.d.cts +20 -0
- package/dist/actions/get-available-devices.d.cts.map +1 -0
- package/dist/actions/get-available-devices.d.mts +20 -0
- package/dist/actions/get-available-devices.d.mts.map +1 -0
- package/dist/actions/get-available-devices.mjs +25 -0
- package/dist/actions/get-available-devices.mjs.map +1 -0
- package/dist/actions/get-available-markets.cjs +16 -0
- package/dist/actions/get-available-markets.cjs.map +1 -0
- package/dist/actions/get-available-markets.d.cts +11 -0
- package/dist/actions/get-available-markets.d.cts.map +1 -0
- package/dist/actions/get-available-markets.d.mts +11 -0
- package/dist/actions/get-available-markets.d.mts.map +1 -0
- package/dist/actions/get-available-markets.mjs +13 -0
- package/dist/actions/get-available-markets.mjs.map +1 -0
- package/dist/actions/get-current-user-s-playlists.cjs +62 -0
- package/dist/actions/get-current-user-s-playlists.cjs.map +1 -0
- package/dist/actions/get-current-user-s-playlists.d.cts +58 -0
- package/dist/actions/get-current-user-s-playlists.d.cts.map +1 -0
- package/dist/actions/get-current-user-s-playlists.d.mts +58 -0
- package/dist/actions/get-current-user-s-playlists.d.mts.map +1 -0
- package/dist/actions/get-current-user-s-playlists.mjs +61 -0
- package/dist/actions/get-current-user-s-playlists.mjs.map +1 -0
- package/dist/actions/get-current-user-s-profile.cjs +43 -0
- package/dist/actions/get-current-user-s-profile.cjs.map +1 -0
- package/dist/actions/get-current-user-s-profile.d.cts +34 -0
- package/dist/actions/get-current-user-s-profile.d.cts.map +1 -0
- package/dist/actions/get-current-user-s-profile.d.mts +34 -0
- package/dist/actions/get-current-user-s-profile.d.mts.map +1 -0
- package/dist/actions/get-current-user-s-profile.mjs +42 -0
- package/dist/actions/get-current-user-s-profile.mjs.map +1 -0
- package/dist/actions/get-currently-playing-track.cjs +132 -0
- package/dist/actions/get-currently-playing-track.cjs.map +1 -0
- package/dist/actions/get-currently-playing-track.d.cts +144 -0
- package/dist/actions/get-currently-playing-track.d.cts.map +1 -0
- package/dist/actions/get-currently-playing-track.d.mts +144 -0
- package/dist/actions/get-currently-playing-track.d.mts.map +1 -0
- package/dist/actions/get-currently-playing-track.mjs +131 -0
- package/dist/actions/get-currently-playing-track.mjs.map +1 -0
- package/dist/actions/get-episode.cjs +65 -0
- package/dist/actions/get-episode.cjs.map +1 -0
- package/dist/actions/get-episode.d.cts +63 -0
- package/dist/actions/get-episode.d.cts.map +1 -0
- package/dist/actions/get-episode.d.mts +63 -0
- package/dist/actions/get-episode.d.mts.map +1 -0
- package/dist/actions/get-episode.mjs +64 -0
- package/dist/actions/get-episode.mjs.map +1 -0
- package/dist/actions/get-featured-playlists.cjs +65 -0
- package/dist/actions/get-featured-playlists.cjs.map +1 -0
- package/dist/actions/get-featured-playlists.d.cts +60 -0
- package/dist/actions/get-featured-playlists.d.cts.map +1 -0
- package/dist/actions/get-featured-playlists.d.mts +60 -0
- package/dist/actions/get-featured-playlists.d.mts.map +1 -0
- package/dist/actions/get-featured-playlists.mjs +64 -0
- package/dist/actions/get-featured-playlists.mjs.map +1 -0
- package/dist/actions/get-followed-artists.cjs +55 -0
- package/dist/actions/get-followed-artists.cjs.map +1 -0
- package/dist/actions/get-followed-artists.d.cts +53 -0
- package/dist/actions/get-followed-artists.d.cts.map +1 -0
- package/dist/actions/get-followed-artists.d.mts +53 -0
- package/dist/actions/get-followed-artists.d.mts.map +1 -0
- package/dist/actions/get-followed-artists.mjs +54 -0
- package/dist/actions/get-followed-artists.mjs.map +1 -0
- package/dist/actions/get-new-releases.cjs +57 -0
- package/dist/actions/get-new-releases.cjs.map +1 -0
- package/dist/actions/get-new-releases.d.cts +51 -0
- package/dist/actions/get-new-releases.d.cts.map +1 -0
- package/dist/actions/get-new-releases.d.mts +51 -0
- package/dist/actions/get-new-releases.d.mts.map +1 -0
- package/dist/actions/get-new-releases.mjs +56 -0
- package/dist/actions/get-new-releases.mjs.map +1 -0
- package/dist/actions/get-playback-state.cjs +194 -0
- package/dist/actions/get-playback-state.cjs.map +1 -0
- package/dist/actions/get-playback-state.d.cts +212 -0
- package/dist/actions/get-playback-state.d.cts.map +1 -0
- package/dist/actions/get-playback-state.d.mts +212 -0
- package/dist/actions/get-playback-state.d.mts.map +1 -0
- package/dist/actions/get-playback-state.mjs +193 -0
- package/dist/actions/get-playback-state.mjs.map +1 -0
- package/dist/actions/get-playlist-cover-image.cjs +21 -0
- package/dist/actions/get-playlist-cover-image.cjs.map +1 -0
- package/dist/actions/get-playlist-cover-image.d.cts +19 -0
- package/dist/actions/get-playlist-cover-image.d.cts.map +1 -0
- package/dist/actions/get-playlist-cover-image.d.mts +19 -0
- package/dist/actions/get-playlist-cover-image.d.mts.map +1 -0
- package/dist/actions/get-playlist-cover-image.mjs +20 -0
- package/dist/actions/get-playlist-cover-image.mjs.map +1 -0
- package/dist/actions/get-playlist-items.cjs +114 -0
- package/dist/actions/get-playlist-items.cjs.map +1 -0
- package/dist/actions/get-playlist-items.d.cts +212 -0
- package/dist/actions/get-playlist-items.d.cts.map +1 -0
- package/dist/actions/get-playlist-items.d.mts +212 -0
- package/dist/actions/get-playlist-items.d.mts.map +1 -0
- package/dist/actions/get-playlist-items.mjs +113 -0
- package/dist/actions/get-playlist-items.mjs.map +1 -0
- package/dist/actions/get-playlist.cjs +185 -0
- package/dist/actions/get-playlist.cjs.map +1 -0
- package/dist/actions/get-playlist.d.cts +211 -0
- package/dist/actions/get-playlist.d.cts.map +1 -0
- package/dist/actions/get-playlist.d.mts +211 -0
- package/dist/actions/get-playlist.d.mts.map +1 -0
- package/dist/actions/get-playlist.mjs +184 -0
- package/dist/actions/get-playlist.mjs.map +1 -0
- package/dist/actions/get-recently-played-tracks.cjs +100 -0
- package/dist/actions/get-recently-played-tracks.cjs.map +1 -0
- package/dist/actions/get-recently-played-tracks.d.cts +108 -0
- package/dist/actions/get-recently-played-tracks.d.cts.map +1 -0
- package/dist/actions/get-recently-played-tracks.d.mts +108 -0
- package/dist/actions/get-recently-played-tracks.d.mts.map +1 -0
- package/dist/actions/get-recently-played-tracks.mjs +99 -0
- package/dist/actions/get-recently-played-tracks.mjs.map +1 -0
- package/dist/actions/get-recommendations.cjs +88 -0
- package/dist/actions/get-recommendations.cjs.map +1 -0
- package/dist/actions/get-recommendations.d.cts +127 -0
- package/dist/actions/get-recommendations.d.cts.map +1 -0
- package/dist/actions/get-recommendations.d.mts +127 -0
- package/dist/actions/get-recommendations.d.mts.map +1 -0
- package/dist/actions/get-recommendations.mjs +87 -0
- package/dist/actions/get-recommendations.mjs.map +1 -0
- package/dist/actions/get-several-albums.cjs +83 -0
- package/dist/actions/get-several-albums.cjs.map +1 -0
- package/dist/actions/get-several-albums.d.cts +82 -0
- package/dist/actions/get-several-albums.d.cts.map +1 -0
- package/dist/actions/get-several-albums.d.mts +82 -0
- package/dist/actions/get-several-albums.d.mts.map +1 -0
- package/dist/actions/get-several-albums.mjs +82 -0
- package/dist/actions/get-several-albums.mjs.map +1 -0
- package/dist/actions/get-several-artists.cjs +38 -0
- package/dist/actions/get-several-artists.cjs.map +1 -0
- package/dist/actions/get-several-artists.d.cts +35 -0
- package/dist/actions/get-several-artists.d.cts.map +1 -0
- package/dist/actions/get-several-artists.d.mts +35 -0
- package/dist/actions/get-several-artists.d.mts.map +1 -0
- package/dist/actions/get-several-artists.mjs +37 -0
- package/dist/actions/get-several-artists.mjs.map +1 -0
- package/dist/actions/get-several-audiobooks.cjs +81 -0
- package/dist/actions/get-several-audiobooks.cjs.map +1 -0
- package/dist/actions/get-several-audiobooks.d.cts +80 -0
- package/dist/actions/get-several-audiobooks.d.cts.map +1 -0
- package/dist/actions/get-several-audiobooks.d.mts +80 -0
- package/dist/actions/get-several-audiobooks.d.mts.map +1 -0
- package/dist/actions/get-several-audiobooks.mjs +80 -0
- package/dist/actions/get-several-audiobooks.mjs.map +1 -0
- package/dist/actions/get-several-browse-categories.cjs +40 -0
- package/dist/actions/get-several-browse-categories.cjs.map +1 -0
- package/dist/actions/get-several-browse-categories.d.cts +36 -0
- package/dist/actions/get-several-browse-categories.d.cts.map +1 -0
- package/dist/actions/get-several-browse-categories.d.mts +36 -0
- package/dist/actions/get-several-browse-categories.d.mts.map +1 -0
- package/dist/actions/get-several-browse-categories.mjs +39 -0
- package/dist/actions/get-several-browse-categories.mjs.map +1 -0
- package/dist/actions/get-several-chapters.cjs +79 -0
- package/dist/actions/get-several-chapters.cjs.map +1 -0
- package/dist/actions/get-several-chapters.d.cts +79 -0
- package/dist/actions/get-several-chapters.d.cts.map +1 -0
- package/dist/actions/get-several-chapters.d.mts +79 -0
- package/dist/actions/get-several-chapters.d.mts.map +1 -0
- package/dist/actions/get-several-chapters.mjs +78 -0
- package/dist/actions/get-several-chapters.mjs.map +1 -0
- package/dist/actions/get-several-episodes.cjs +68 -0
- package/dist/actions/get-several-episodes.cjs.map +1 -0
- package/dist/actions/get-several-episodes.d.cts +67 -0
- package/dist/actions/get-several-episodes.d.cts.map +1 -0
- package/dist/actions/get-several-episodes.d.mts +67 -0
- package/dist/actions/get-several-episodes.d.mts.map +1 -0
- package/dist/actions/get-several-episodes.mjs +67 -0
- package/dist/actions/get-several-episodes.mjs.map +1 -0
- package/dist/actions/get-several-shows.cjs +47 -0
- package/dist/actions/get-several-shows.cjs.map +1 -0
- package/dist/actions/get-several-shows.d.cts +42 -0
- package/dist/actions/get-several-shows.d.cts.map +1 -0
- package/dist/actions/get-several-shows.d.mts +42 -0
- package/dist/actions/get-several-shows.d.mts.map +1 -0
- package/dist/actions/get-several-shows.mjs +46 -0
- package/dist/actions/get-several-shows.mjs.map +1 -0
- package/dist/actions/get-several-tracks.cjs +62 -0
- package/dist/actions/get-several-tracks.cjs.map +1 -0
- package/dist/actions/get-several-tracks.d.cts +64 -0
- package/dist/actions/get-several-tracks.d.cts.map +1 -0
- package/dist/actions/get-several-tracks.d.mts +64 -0
- package/dist/actions/get-several-tracks.d.mts.map +1 -0
- package/dist/actions/get-several-tracks.mjs +61 -0
- package/dist/actions/get-several-tracks.mjs.map +1 -0
- package/dist/actions/get-show-episodes.cjs +58 -0
- package/dist/actions/get-show-episodes.cjs.map +1 -0
- package/dist/actions/get-show-episodes.d.cts +53 -0
- package/dist/actions/get-show-episodes.d.cts.map +1 -0
- package/dist/actions/get-show-episodes.d.mts +53 -0
- package/dist/actions/get-show-episodes.d.mts.map +1 -0
- package/dist/actions/get-show-episodes.mjs +57 -0
- package/dist/actions/get-show-episodes.mjs.map +1 -0
- package/dist/actions/get-show.cjs +72 -0
- package/dist/actions/get-show.cjs.map +1 -0
- package/dist/actions/get-show.d.cts +68 -0
- package/dist/actions/get-show.d.cts.map +1 -0
- package/dist/actions/get-show.d.mts +68 -0
- package/dist/actions/get-show.d.mts.map +1 -0
- package/dist/actions/get-show.mjs +71 -0
- package/dist/actions/get-show.mjs.map +1 -0
- package/dist/actions/get-single-browse-category.cjs +29 -0
- package/dist/actions/get-single-browse-category.cjs.map +1 -0
- package/dist/actions/get-single-browse-category.d.cts +24 -0
- package/dist/actions/get-single-browse-category.d.cts.map +1 -0
- package/dist/actions/get-single-browse-category.d.mts +24 -0
- package/dist/actions/get-single-browse-category.d.mts.map +1 -0
- package/dist/actions/get-single-browse-category.mjs +28 -0
- package/dist/actions/get-single-browse-category.mjs.map +1 -0
- package/dist/actions/get-the-user-s-queue.cjs +60 -0
- package/dist/actions/get-the-user-s-queue.cjs.map +1 -0
- package/dist/actions/get-the-user-s-queue.d.cts +86 -0
- package/dist/actions/get-the-user-s-queue.d.cts.map +1 -0
- package/dist/actions/get-the-user-s-queue.d.mts +86 -0
- package/dist/actions/get-the-user-s-queue.d.mts.map +1 -0
- package/dist/actions/get-the-user-s-queue.mjs +59 -0
- package/dist/actions/get-the-user-s-queue.mjs.map +1 -0
- package/dist/actions/get-track-s-audio-analysis.cjs +87 -0
- package/dist/actions/get-track-s-audio-analysis.cjs.map +1 -0
- package/dist/actions/get-track-s-audio-analysis.d.cts +87 -0
- package/dist/actions/get-track-s-audio-analysis.d.cts.map +1 -0
- package/dist/actions/get-track-s-audio-analysis.d.mts +87 -0
- package/dist/actions/get-track-s-audio-analysis.d.mts.map +1 -0
- package/dist/actions/get-track-s-audio-analysis.mjs +86 -0
- package/dist/actions/get-track-s-audio-analysis.mjs.map +1 -0
- package/dist/actions/get-track.cjs +63 -0
- package/dist/actions/get-track.cjs.map +1 -0
- package/dist/actions/get-track.d.cts +57 -0
- package/dist/actions/get-track.d.cts.map +1 -0
- package/dist/actions/get-track.d.mts +57 -0
- package/dist/actions/get-track.d.mts.map +1 -0
- package/dist/actions/get-track.mjs +62 -0
- package/dist/actions/get-track.mjs.map +1 -0
- package/dist/actions/get-user-s-playlists.cjs +63 -0
- package/dist/actions/get-user-s-playlists.cjs.map +1 -0
- package/dist/actions/get-user-s-playlists.d.cts +60 -0
- package/dist/actions/get-user-s-playlists.d.cts.map +1 -0
- package/dist/actions/get-user-s-playlists.d.mts +60 -0
- package/dist/actions/get-user-s-playlists.d.mts.map +1 -0
- package/dist/actions/get-user-s-playlists.mjs +62 -0
- package/dist/actions/get-user-s-playlists.mjs.map +1 -0
- package/dist/actions/get-user-s-profile.cjs +35 -0
- package/dist/actions/get-user-s-profile.cjs.map +1 -0
- package/dist/actions/get-user-s-profile.d.cts +31 -0
- package/dist/actions/get-user-s-profile.d.cts.map +1 -0
- package/dist/actions/get-user-s-profile.d.mts +31 -0
- package/dist/actions/get-user-s-profile.d.mts.map +1 -0
- package/dist/actions/get-user-s-profile.mjs +34 -0
- package/dist/actions/get-user-s-profile.mjs.map +1 -0
- package/dist/actions/get-user-s-saved-albums.cjs +41 -0
- package/dist/actions/get-user-s-saved-albums.cjs.map +1 -0
- package/dist/actions/get-user-s-saved-albums.d.cts +36 -0
- package/dist/actions/get-user-s-saved-albums.d.cts.map +1 -0
- package/dist/actions/get-user-s-saved-albums.d.mts +36 -0
- package/dist/actions/get-user-s-saved-albums.d.mts.map +1 -0
- package/dist/actions/get-user-s-saved-albums.mjs +40 -0
- package/dist/actions/get-user-s-saved-albums.mjs.map +1 -0
- package/dist/actions/get-user-s-saved-audiobooks.cjs +59 -0
- package/dist/actions/get-user-s-saved-audiobooks.cjs.map +1 -0
- package/dist/actions/get-user-s-saved-audiobooks.d.cts +54 -0
- package/dist/actions/get-user-s-saved-audiobooks.d.cts.map +1 -0
- package/dist/actions/get-user-s-saved-audiobooks.d.mts +54 -0
- package/dist/actions/get-user-s-saved-audiobooks.d.mts.map +1 -0
- package/dist/actions/get-user-s-saved-audiobooks.mjs +58 -0
- package/dist/actions/get-user-s-saved-audiobooks.mjs.map +1 -0
- package/dist/actions/get-user-s-saved-episodes.cjs +77 -0
- package/dist/actions/get-user-s-saved-episodes.cjs.map +1 -0
- package/dist/actions/get-user-s-saved-episodes.d.cts +73 -0
- package/dist/actions/get-user-s-saved-episodes.d.cts.map +1 -0
- package/dist/actions/get-user-s-saved-episodes.d.mts +73 -0
- package/dist/actions/get-user-s-saved-episodes.d.mts.map +1 -0
- package/dist/actions/get-user-s-saved-episodes.mjs +76 -0
- package/dist/actions/get-user-s-saved-episodes.mjs.map +1 -0
- package/dist/actions/get-user-s-saved-shows.cjs +59 -0
- package/dist/actions/get-user-s-saved-shows.cjs.map +1 -0
- package/dist/actions/get-user-s-saved-shows.d.cts +51 -0
- package/dist/actions/get-user-s-saved-shows.d.cts.map +1 -0
- package/dist/actions/get-user-s-saved-shows.d.mts +51 -0
- package/dist/actions/get-user-s-saved-shows.d.mts.map +1 -0
- package/dist/actions/get-user-s-saved-shows.mjs +58 -0
- package/dist/actions/get-user-s-saved-shows.mjs.map +1 -0
- package/dist/actions/get-user-s-saved-tracks.cjs +81 -0
- package/dist/actions/get-user-s-saved-tracks.cjs.map +1 -0
- package/dist/actions/get-user-s-saved-tracks.d.cts +90 -0
- package/dist/actions/get-user-s-saved-tracks.d.cts.map +1 -0
- package/dist/actions/get-user-s-saved-tracks.d.mts +90 -0
- package/dist/actions/get-user-s-saved-tracks.d.mts.map +1 -0
- package/dist/actions/get-user-s-saved-tracks.mjs +80 -0
- package/dist/actions/get-user-s-saved-tracks.mjs.map +1 -0
- package/dist/actions/get-user-s-top-artists.cjs +54 -0
- package/dist/actions/get-user-s-top-artists.cjs.map +1 -0
- package/dist/actions/get-user-s-top-artists.d.cts +49 -0
- package/dist/actions/get-user-s-top-artists.d.cts.map +1 -0
- package/dist/actions/get-user-s-top-artists.d.mts +49 -0
- package/dist/actions/get-user-s-top-artists.d.mts.map +1 -0
- package/dist/actions/get-user-s-top-artists.mjs +53 -0
- package/dist/actions/get-user-s-top-artists.mjs.map +1 -0
- package/dist/actions/get-user-s-top-tracks.cjs +93 -0
- package/dist/actions/get-user-s-top-tracks.cjs.map +1 -0
- package/dist/actions/get-user-s-top-tracks.d.cts +103 -0
- package/dist/actions/get-user-s-top-tracks.d.cts.map +1 -0
- package/dist/actions/get-user-s-top-tracks.d.mts +103 -0
- package/dist/actions/get-user-s-top-tracks.d.mts.map +1 -0
- package/dist/actions/get-user-s-top-tracks.mjs +92 -0
- package/dist/actions/get-user-s-top-tracks.mjs.map +1 -0
- package/dist/actions/index.cjs +169 -0
- package/dist/actions/index.d.cts +85 -0
- package/dist/actions/index.d.mts +85 -0
- package/dist/actions/index.mjs +85 -0
- package/dist/actions/pause-playback.cjs +16 -0
- package/dist/actions/pause-playback.cjs.map +1 -0
- package/dist/actions/pause-playback.d.cts +15 -0
- package/dist/actions/pause-playback.d.cts.map +1 -0
- package/dist/actions/pause-playback.d.mts +15 -0
- package/dist/actions/pause-playback.d.mts.map +1 -0
- package/dist/actions/pause-playback.mjs +13 -0
- package/dist/actions/pause-playback.mjs.map +1 -0
- package/dist/actions/remove-playlist-items.cjs +23 -0
- package/dist/actions/remove-playlist-items.cjs.map +1 -0
- package/dist/actions/remove-playlist-items.d.cts +26 -0
- package/dist/actions/remove-playlist-items.d.cts.map +1 -0
- package/dist/actions/remove-playlist-items.d.mts +26 -0
- package/dist/actions/remove-playlist-items.d.mts.map +1 -0
- package/dist/actions/remove-playlist-items.mjs +20 -0
- package/dist/actions/remove-playlist-items.mjs.map +1 -0
- package/dist/actions/remove-user-s-saved-audiobooks.cjs +20 -0
- package/dist/actions/remove-user-s-saved-audiobooks.cjs.map +1 -0
- package/dist/actions/remove-user-s-saved-audiobooks.d.cts +18 -0
- package/dist/actions/remove-user-s-saved-audiobooks.d.cts.map +1 -0
- package/dist/actions/remove-user-s-saved-audiobooks.d.mts +18 -0
- package/dist/actions/remove-user-s-saved-audiobooks.d.mts.map +1 -0
- package/dist/actions/remove-user-s-saved-audiobooks.mjs +19 -0
- package/dist/actions/remove-user-s-saved-audiobooks.mjs.map +1 -0
- package/dist/actions/remove-user-s-saved-episodes.cjs +19 -0
- package/dist/actions/remove-user-s-saved-episodes.cjs.map +1 -0
- package/dist/actions/remove-user-s-saved-episodes.d.cts +16 -0
- package/dist/actions/remove-user-s-saved-episodes.d.cts.map +1 -0
- package/dist/actions/remove-user-s-saved-episodes.d.mts +16 -0
- package/dist/actions/remove-user-s-saved-episodes.d.mts.map +1 -0
- package/dist/actions/remove-user-s-saved-episodes.mjs +16 -0
- package/dist/actions/remove-user-s-saved-episodes.mjs.map +1 -0
- package/dist/actions/remove-user-s-saved-shows.cjs +19 -0
- package/dist/actions/remove-user-s-saved-shows.cjs.map +1 -0
- package/dist/actions/remove-user-s-saved-shows.d.cts +17 -0
- package/dist/actions/remove-user-s-saved-shows.d.cts.map +1 -0
- package/dist/actions/remove-user-s-saved-shows.d.mts +17 -0
- package/dist/actions/remove-user-s-saved-shows.d.mts.map +1 -0
- package/dist/actions/remove-user-s-saved-shows.mjs +16 -0
- package/dist/actions/remove-user-s-saved-shows.mjs.map +1 -0
- package/dist/actions/remove-user-s-saved-tracks.cjs +22 -0
- package/dist/actions/remove-user-s-saved-tracks.cjs.map +1 -0
- package/dist/actions/remove-user-s-saved-tracks.d.cts +18 -0
- package/dist/actions/remove-user-s-saved-tracks.d.cts.map +1 -0
- package/dist/actions/remove-user-s-saved-tracks.d.mts +18 -0
- package/dist/actions/remove-user-s-saved-tracks.d.mts.map +1 -0
- package/dist/actions/remove-user-s-saved-tracks.mjs +19 -0
- package/dist/actions/remove-user-s-saved-tracks.mjs.map +1 -0
- package/dist/actions/remove-users-saved-albums.cjs +19 -0
- package/dist/actions/remove-users-saved-albums.cjs.map +1 -0
- package/dist/actions/remove-users-saved-albums.d.cts +16 -0
- package/dist/actions/remove-users-saved-albums.d.cts.map +1 -0
- package/dist/actions/remove-users-saved-albums.d.mts +16 -0
- package/dist/actions/remove-users-saved-albums.d.mts.map +1 -0
- package/dist/actions/remove-users-saved-albums.mjs +16 -0
- package/dist/actions/remove-users-saved-albums.mjs.map +1 -0
- package/dist/actions/save-albums-for-current-user.cjs +19 -0
- package/dist/actions/save-albums-for-current-user.cjs.map +1 -0
- package/dist/actions/save-albums-for-current-user.d.cts +16 -0
- package/dist/actions/save-albums-for-current-user.d.cts.map +1 -0
- package/dist/actions/save-albums-for-current-user.d.mts +16 -0
- package/dist/actions/save-albums-for-current-user.d.mts.map +1 -0
- package/dist/actions/save-albums-for-current-user.mjs +16 -0
- package/dist/actions/save-albums-for-current-user.mjs.map +1 -0
- package/dist/actions/save-audiobooks-for-current-user.cjs +19 -0
- package/dist/actions/save-audiobooks-for-current-user.cjs.map +1 -0
- package/dist/actions/save-audiobooks-for-current-user.d.cts +16 -0
- package/dist/actions/save-audiobooks-for-current-user.d.cts.map +1 -0
- package/dist/actions/save-audiobooks-for-current-user.d.mts +16 -0
- package/dist/actions/save-audiobooks-for-current-user.d.mts.map +1 -0
- package/dist/actions/save-audiobooks-for-current-user.mjs +16 -0
- package/dist/actions/save-audiobooks-for-current-user.mjs.map +1 -0
- package/dist/actions/save-episodes-for-current-user.cjs +19 -0
- package/dist/actions/save-episodes-for-current-user.cjs.map +1 -0
- package/dist/actions/save-episodes-for-current-user.d.cts +16 -0
- package/dist/actions/save-episodes-for-current-user.d.cts.map +1 -0
- package/dist/actions/save-episodes-for-current-user.d.mts +16 -0
- package/dist/actions/save-episodes-for-current-user.d.mts.map +1 -0
- package/dist/actions/save-episodes-for-current-user.mjs +16 -0
- package/dist/actions/save-episodes-for-current-user.mjs.map +1 -0
- package/dist/actions/save-shows-for-current-user.cjs +16 -0
- package/dist/actions/save-shows-for-current-user.cjs.map +1 -0
- package/dist/actions/save-shows-for-current-user.d.cts +15 -0
- package/dist/actions/save-shows-for-current-user.d.cts.map +1 -0
- package/dist/actions/save-shows-for-current-user.d.mts +15 -0
- package/dist/actions/save-shows-for-current-user.d.mts.map +1 -0
- package/dist/actions/save-shows-for-current-user.mjs +13 -0
- package/dist/actions/save-shows-for-current-user.mjs.map +1 -0
- package/dist/actions/save-tracks-for-current-user.cjs +25 -0
- package/dist/actions/save-tracks-for-current-user.cjs.map +1 -0
- package/dist/actions/save-tracks-for-current-user.d.cts +24 -0
- package/dist/actions/save-tracks-for-current-user.d.cts.map +1 -0
- package/dist/actions/save-tracks-for-current-user.d.mts +24 -0
- package/dist/actions/save-tracks-for-current-user.d.mts.map +1 -0
- package/dist/actions/save-tracks-for-current-user.mjs +22 -0
- package/dist/actions/save-tracks-for-current-user.mjs.map +1 -0
- package/dist/actions/search-for-item.cjs +48 -0
- package/dist/actions/search-for-item.cjs.map +1 -0
- package/dist/actions/search-for-item.d.cts +97 -0
- package/dist/actions/search-for-item.d.cts.map +1 -0
- package/dist/actions/search-for-item.d.mts +97 -0
- package/dist/actions/search-for-item.d.mts.map +1 -0
- package/dist/actions/search-for-item.mjs +47 -0
- package/dist/actions/search-for-item.mjs.map +1 -0
- package/dist/actions/seek-to-position.cjs +19 -0
- package/dist/actions/seek-to-position.cjs.map +1 -0
- package/dist/actions/seek-to-position.d.cts +17 -0
- package/dist/actions/seek-to-position.d.cts.map +1 -0
- package/dist/actions/seek-to-position.d.mts +17 -0
- package/dist/actions/seek-to-position.d.mts.map +1 -0
- package/dist/actions/seek-to-position.mjs +16 -0
- package/dist/actions/seek-to-position.mjs.map +1 -0
- package/dist/actions/set-playback-volume.cjs +19 -0
- package/dist/actions/set-playback-volume.cjs.map +1 -0
- package/dist/actions/set-playback-volume.d.cts +17 -0
- package/dist/actions/set-playback-volume.d.cts.map +1 -0
- package/dist/actions/set-playback-volume.d.mts +17 -0
- package/dist/actions/set-playback-volume.d.mts.map +1 -0
- package/dist/actions/set-playback-volume.mjs +16 -0
- package/dist/actions/set-playback-volume.mjs.map +1 -0
- package/dist/actions/set-repeat-mode.cjs +23 -0
- package/dist/actions/set-repeat-mode.cjs.map +1 -0
- package/dist/actions/set-repeat-mode.d.cts +21 -0
- package/dist/actions/set-repeat-mode.d.cts.map +1 -0
- package/dist/actions/set-repeat-mode.d.mts +21 -0
- package/dist/actions/set-repeat-mode.d.mts.map +1 -0
- package/dist/actions/set-repeat-mode.mjs +20 -0
- package/dist/actions/set-repeat-mode.mjs.map +1 -0
- package/dist/actions/skip-to-next.cjs +19 -0
- package/dist/actions/skip-to-next.cjs.map +1 -0
- package/dist/actions/skip-to-next.d.cts +16 -0
- package/dist/actions/skip-to-next.d.cts.map +1 -0
- package/dist/actions/skip-to-next.d.mts +16 -0
- package/dist/actions/skip-to-next.d.mts.map +1 -0
- package/dist/actions/skip-to-next.mjs +16 -0
- package/dist/actions/skip-to-next.mjs.map +1 -0
- package/dist/actions/skip-to-previous.cjs +16 -0
- package/dist/actions/skip-to-previous.cjs.map +1 -0
- package/dist/actions/skip-to-previous.d.cts +15 -0
- package/dist/actions/skip-to-previous.d.cts.map +1 -0
- package/dist/actions/skip-to-previous.d.mts +15 -0
- package/dist/actions/skip-to-previous.d.mts.map +1 -0
- package/dist/actions/skip-to-previous.mjs +13 -0
- package/dist/actions/skip-to-previous.mjs.map +1 -0
- package/dist/actions/start-resume-playback.cjs +22 -0
- package/dist/actions/start-resume-playback.cjs.map +1 -0
- package/dist/actions/start-resume-playback.d.cts +23 -0
- package/dist/actions/start-resume-playback.d.cts.map +1 -0
- package/dist/actions/start-resume-playback.d.mts +23 -0
- package/dist/actions/start-resume-playback.d.mts.map +1 -0
- package/dist/actions/start-resume-playback.mjs +19 -0
- package/dist/actions/start-resume-playback.mjs.map +1 -0
- package/dist/actions/toggle-playback-shuffle.cjs +22 -0
- package/dist/actions/toggle-playback-shuffle.cjs.map +1 -0
- package/dist/actions/toggle-playback-shuffle.d.cts +18 -0
- package/dist/actions/toggle-playback-shuffle.d.cts.map +1 -0
- package/dist/actions/toggle-playback-shuffle.d.mts +18 -0
- package/dist/actions/toggle-playback-shuffle.d.mts.map +1 -0
- package/dist/actions/toggle-playback-shuffle.mjs +19 -0
- package/dist/actions/toggle-playback-shuffle.mjs.map +1 -0
- package/dist/actions/transfer-playback.cjs +22 -0
- package/dist/actions/transfer-playback.cjs.map +1 -0
- package/dist/actions/transfer-playback.d.cts +18 -0
- package/dist/actions/transfer-playback.d.cts.map +1 -0
- package/dist/actions/transfer-playback.d.mts +18 -0
- package/dist/actions/transfer-playback.d.mts.map +1 -0
- package/dist/actions/transfer-playback.mjs +19 -0
- package/dist/actions/transfer-playback.mjs.map +1 -0
- package/dist/actions/unfollow-artists-or-users.cjs +22 -0
- package/dist/actions/unfollow-artists-or-users.cjs.map +1 -0
- package/dist/actions/unfollow-artists-or-users.d.cts +21 -0
- package/dist/actions/unfollow-artists-or-users.d.cts.map +1 -0
- package/dist/actions/unfollow-artists-or-users.d.mts +21 -0
- package/dist/actions/unfollow-artists-or-users.d.mts.map +1 -0
- package/dist/actions/unfollow-artists-or-users.mjs +19 -0
- package/dist/actions/unfollow-artists-or-users.mjs.map +1 -0
- package/dist/actions/unfollow-playlist.cjs +19 -0
- package/dist/actions/unfollow-playlist.cjs.map +1 -0
- package/dist/actions/unfollow-playlist.d.cts +16 -0
- package/dist/actions/unfollow-playlist.d.cts.map +1 -0
- package/dist/actions/unfollow-playlist.d.mts +16 -0
- package/dist/actions/unfollow-playlist.d.mts.map +1 -0
- package/dist/actions/unfollow-playlist.mjs +16 -0
- package/dist/actions/unfollow-playlist.mjs.map +1 -0
- package/dist/actions/update-playlist-items.cjs +23 -0
- package/dist/actions/update-playlist-items.cjs.map +1 -0
- package/dist/actions/update-playlist-items.d.cts +25 -0
- package/dist/actions/update-playlist-items.d.cts.map +1 -0
- package/dist/actions/update-playlist-items.d.mts +25 -0
- package/dist/actions/update-playlist-items.d.mts.map +1 -0
- package/dist/actions/update-playlist-items.mjs +20 -0
- package/dist/actions/update-playlist-items.mjs.map +1 -0
- package/dist/app.cjs +9 -0
- package/dist/app.cjs.map +1 -0
- package/dist/app.d.cts +5 -0
- package/dist/app.d.cts.map +1 -0
- package/dist/app.d.mts +5 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +10 -0
- package/dist/app.mjs.map +1 -0
- package/dist/catalog.cjs +15 -0
- package/dist/catalog.cjs.map +1 -0
- package/dist/catalog.d.cts +14 -0
- package/dist/catalog.d.cts.map +1 -0
- package/dist/catalog.d.mts +14 -0
- package/dist/catalog.d.mts.map +1 -0
- package/dist/catalog.mjs +15 -0
- package/dist/catalog.mjs.map +1 -0
- package/dist/execute.cjs +18 -0
- package/dist/execute.cjs.map +1 -0
- package/dist/execute.mjs +18 -0
- package/dist/execute.mjs.map +1 -0
- package/dist/index.cjs +174 -0
- package/dist/index.d.cts +87 -0
- package/dist/index.d.mts +87 -4
- package/dist/index.mjs +88 -6
- package/package.json +31 -55
- package/LICENSE +0 -21
- package/dist/browse-BaBol4IR.mjs +0 -475
- package/dist/credential-sets/index.d.mts +0 -2
- package/dist/credential-sets/index.mjs +0 -4
- package/dist/operations/index.d.mts +0 -2
- package/dist/operations/index.mjs +0 -3
- package/dist/schemas/index.d.mts +0 -3322
- package/dist/schemas/index.mjs +0 -3
- package/dist/spotify-app.credential-set-DT2fivE7.d.mts +0 -34
- package/dist/spotify-app.credential-set-O5UKOpLR.mjs +0 -16
- package/dist/spotify.credential-set-CS3lCW-x.mjs +0 -44
- package/dist/upload-playlist-cover-image.operation-CnyIlv11.mjs +0 -4247
- package/dist/upload-playlist-cover-image.operation-Cqbmylzz.d.mts +0 -5246
|
@@ -1,4247 +0,0 @@
|
|
|
1
|
-
import { n as spotifyCredentialSet } from "./spotify.credential-set-CS3lCW-x.mjs";
|
|
2
|
-
import { A as spotifyRecentlyPlayedItemSchema, B as spotifyAudiobookSchema, C as spotifyPlaylistImageSchema, E as spotifyDeviceSchema, F as spotifySavedTrackItemSchema, H as spotifyChapterSchema, I as spotifyAlbumSchema, J as spotifyUserSchema, L as spotifyAlbumSummarySchema, M as spotifySavedAudiobookItemSchema, N as spotifySavedEpisodeItemSchema, O as spotifyPlaybackStateSchema, P as spotifySavedShowItemSchema, R as spotifyArtistSchema, S as spotifyTrackPageSchema, T as spotifyPlaylistSchema, U as spotifyEpisodeSchema, W as spotifyShowSchema, Y as createSpotifyCursorPageSchema, Z as spotifyBooleanListSchema, _ as spotifySavedEpisodePageSchema, at as spotifyMutationSuccessSchema, b as spotifySearchResultSchema, c as spotifyChapterPageSchema, d as spotifyPlaylistPageSchema, dt as spotifyUriSchema, f as spotifyRecentlyPlayedPageSchema, g as spotifySavedAudiobookPageSchema, h as spotifySavedAlbumPageSchema, i as spotifyAudioFeaturesSchema, it as spotifyMarketSchema, j as spotifySavedAlbumItemSchema, k as spotifyQueueSchema, l as spotifyEpisodePageSchema, lt as spotifySnapshotResponseSchema, m as spotifyRecommendationsSchema, n as spotifyArtistPageSchema, nt as spotifyIdSchema, o as spotifyCategoryPageSchema, q as spotifyTrackSchema, r as spotifyAudioAnalysisSchema, s as spotifyCategorySchema, t as spotifyAlbumPageSchema, u as spotifyPlaylistItemPageSchema, ut as spotifyTimestampSchema, v as spotifySavedShowPageSchema, w as spotifyPlaylistItemSchema, y as spotifySavedTrackPageSchema } from "./browse-BaBol4IR.mjs";
|
|
3
|
-
import { Operation } from "@keystrokehq/core";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/utils/errors.ts
|
|
7
|
-
var SpotifyApiError = class extends Error {
|
|
8
|
-
kind;
|
|
9
|
-
status;
|
|
10
|
-
code;
|
|
11
|
-
requestId;
|
|
12
|
-
retryAfterSeconds;
|
|
13
|
-
retryable;
|
|
14
|
-
details;
|
|
15
|
-
constructor(options) {
|
|
16
|
-
super(options.message);
|
|
17
|
-
this.name = "SpotifyApiError";
|
|
18
|
-
this.kind = options.kind;
|
|
19
|
-
this.status = options.status;
|
|
20
|
-
this.code = options.code;
|
|
21
|
-
this.requestId = options.requestId;
|
|
22
|
-
this.retryAfterSeconds = options.retryAfterSeconds;
|
|
23
|
-
this.retryable = options.retryable ?? isRetryableStatus(options.status);
|
|
24
|
-
this.details = options.details;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
function isRetryableStatus(status) {
|
|
28
|
-
if (status === void 0) return false;
|
|
29
|
-
return status === 429 || status >= 500;
|
|
30
|
-
}
|
|
31
|
-
function classifySpotifyApiError(input) {
|
|
32
|
-
const normalizedMessage = input.message.toLowerCase();
|
|
33
|
-
const normalizedCode = input.code?.toLowerCase();
|
|
34
|
-
if (input.status === 429) return new SpotifyApiError({
|
|
35
|
-
kind: "rate_limit",
|
|
36
|
-
message: input.message,
|
|
37
|
-
status: input.status,
|
|
38
|
-
code: input.code,
|
|
39
|
-
requestId: input.requestId,
|
|
40
|
-
retryAfterSeconds: input.retryAfterSeconds,
|
|
41
|
-
retryable: true,
|
|
42
|
-
details: input.details
|
|
43
|
-
});
|
|
44
|
-
if (input.status === 401 || normalizedCode === "invalid_token" || normalizedMessage.includes("invalid access token") || normalizedMessage.includes("authentication")) return new SpotifyApiError({
|
|
45
|
-
kind: "auth",
|
|
46
|
-
message: input.message,
|
|
47
|
-
status: input.status,
|
|
48
|
-
code: input.code,
|
|
49
|
-
requestId: input.requestId,
|
|
50
|
-
retryAfterSeconds: input.retryAfterSeconds,
|
|
51
|
-
retryable: false,
|
|
52
|
-
details: input.details
|
|
53
|
-
});
|
|
54
|
-
if (input.status === 403 && (normalizedCode === "premium_required" || normalizedMessage.includes("premium required"))) return new SpotifyApiError({
|
|
55
|
-
kind: "premium_required",
|
|
56
|
-
message: input.message,
|
|
57
|
-
status: input.status,
|
|
58
|
-
code: input.code ?? "PREMIUM_REQUIRED",
|
|
59
|
-
requestId: input.requestId,
|
|
60
|
-
retryAfterSeconds: input.retryAfterSeconds,
|
|
61
|
-
retryable: false,
|
|
62
|
-
details: input.details
|
|
63
|
-
});
|
|
64
|
-
if (input.status === 404 && (normalizedMessage.includes("deprecated") || normalizedMessage.includes("not available to your app") || normalizedMessage.includes("restricted"))) return new SpotifyApiError({
|
|
65
|
-
kind: "deprecated",
|
|
66
|
-
message: input.message,
|
|
67
|
-
status: input.status,
|
|
68
|
-
code: input.code,
|
|
69
|
-
requestId: input.requestId,
|
|
70
|
-
retryAfterSeconds: input.retryAfterSeconds,
|
|
71
|
-
retryable: false,
|
|
72
|
-
details: input.details
|
|
73
|
-
});
|
|
74
|
-
return new SpotifyApiError({
|
|
75
|
-
kind: "http",
|
|
76
|
-
message: input.message,
|
|
77
|
-
status: input.status,
|
|
78
|
-
code: input.code,
|
|
79
|
-
requestId: input.requestId,
|
|
80
|
-
retryAfterSeconds: input.retryAfterSeconds,
|
|
81
|
-
details: input.details
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/utils/client.ts
|
|
87
|
-
const DEFAULT_BASE_URL = "https://api.spotify.com/v1";
|
|
88
|
-
const DEFAULT_MAX_RETRIES = 2;
|
|
89
|
-
const topTracksResponseSchema = z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
90
|
-
const severalArtistsResponseSchema$2 = z.object({ artists: z.array(spotifyArtistSchema) });
|
|
91
|
-
const severalAlbumsResponseSchema$1 = z.object({ albums: z.array(spotifyAlbumSchema) });
|
|
92
|
-
const severalTracksResponseSchema$1 = z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
93
|
-
const severalShowsResponseSchema = z.object({ shows: z.array(spotifyShowSchema) });
|
|
94
|
-
const severalEpisodesResponseSchema = z.object({ episodes: z.array(spotifyEpisodeSchema) });
|
|
95
|
-
const severalAudiobooksResponseSchema = z.object({ audiobooks: z.array(spotifyAudiobookSchema) });
|
|
96
|
-
const severalChaptersResponseSchema = z.object({ chapters: z.array(spotifyChapterSchema) });
|
|
97
|
-
const nullablePlaybackStateSchema = spotifyPlaybackStateSchema.nullable();
|
|
98
|
-
function isRecord(value) {
|
|
99
|
-
return typeof value === "object" && value !== null;
|
|
100
|
-
}
|
|
101
|
-
function camelCaseKey(value) {
|
|
102
|
-
return value.replace(/_([a-z])/gu, (_, letter) => letter.toUpperCase());
|
|
103
|
-
}
|
|
104
|
-
function snakeCaseKey(value) {
|
|
105
|
-
return value.replace(/[A-Z]/gu, (letter) => `_${letter.toLowerCase()}`);
|
|
106
|
-
}
|
|
107
|
-
function camelizeSpotifyJson(value) {
|
|
108
|
-
if (Array.isArray(value)) return value.map(camelizeSpotifyJson);
|
|
109
|
-
if (!isRecord(value)) return value;
|
|
110
|
-
const result = {};
|
|
111
|
-
for (const [key, nestedValue] of Object.entries(value)) result[camelCaseKey(key)] = camelizeSpotifyJson(nestedValue);
|
|
112
|
-
return result;
|
|
113
|
-
}
|
|
114
|
-
function snakeizeSpotifyJson(value) {
|
|
115
|
-
if (Array.isArray(value)) return value.map(snakeizeSpotifyJson);
|
|
116
|
-
if (!isRecord(value)) return value;
|
|
117
|
-
const result = {};
|
|
118
|
-
for (const [key, nestedValue] of Object.entries(value)) result[snakeCaseKey(key)] = snakeizeSpotifyJson(nestedValue);
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
function appendQueryParams(url, query) {
|
|
122
|
-
if (!query) return;
|
|
123
|
-
for (const [key, value] of Object.entries(query)) {
|
|
124
|
-
if (value === void 0) continue;
|
|
125
|
-
if (Array.isArray(value)) {
|
|
126
|
-
if (value.length === 0) continue;
|
|
127
|
-
url.searchParams.set(key, value.map((entry) => String(entry)).filter((entry) => entry.length > 0).join(","));
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
url.searchParams.set(key, String(value));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function toUrl(baseUrl, path) {
|
|
134
|
-
return new URL(path.replace(/^\//u, ""), `${baseUrl.replace(/\/$/u, "")}/`);
|
|
135
|
-
}
|
|
136
|
-
function parseRetryAfter(headers) {
|
|
137
|
-
const raw = headers.get("retry-after");
|
|
138
|
-
if (!raw) return;
|
|
139
|
-
const seconds = Number(raw);
|
|
140
|
-
return Number.isFinite(seconds) ? seconds : void 0;
|
|
141
|
-
}
|
|
142
|
-
function getRequestId(headers) {
|
|
143
|
-
return headers.get("x-request-id") ?? headers.get("spotify-trace-id") ?? headers.get("x-spotify-request-id") ?? void 0;
|
|
144
|
-
}
|
|
145
|
-
function extractErrorMessage(body, statusText) {
|
|
146
|
-
if (!isRecord(body)) return { message: statusText || "Spotify API request failed" };
|
|
147
|
-
const apiError = body.error;
|
|
148
|
-
if (isRecord(apiError) && typeof apiError.message === "string") return {
|
|
149
|
-
message: apiError.message,
|
|
150
|
-
code: typeof apiError.code === "string" ? apiError.code : void 0
|
|
151
|
-
};
|
|
152
|
-
if (typeof body.error === "string") return {
|
|
153
|
-
message: typeof body.errorDescription === "string" ? body.errorDescription : body.error || statusText,
|
|
154
|
-
code: body.error
|
|
155
|
-
};
|
|
156
|
-
return { message: statusText || "Spotify API request failed" };
|
|
157
|
-
}
|
|
158
|
-
function extractPageToken(url) {
|
|
159
|
-
if (!url) return;
|
|
160
|
-
try {
|
|
161
|
-
const parsed = new URL(url);
|
|
162
|
-
return parsed.searchParams.get("offset") ?? parsed.searchParams.get("after") ?? parsed.searchParams.get("before") ?? url;
|
|
163
|
-
} catch {
|
|
164
|
-
return url;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function normalizeOffsetPage(value, itemKey, responseSchema) {
|
|
168
|
-
if (!isRecord(value)) return value;
|
|
169
|
-
const itemsValue = value[itemKey];
|
|
170
|
-
const parsedItems = responseSchema.parse(itemsValue);
|
|
171
|
-
return {
|
|
172
|
-
href: typeof value.href === "string" ? value.href : void 0,
|
|
173
|
-
items: parsedItems,
|
|
174
|
-
limit: typeof value.limit === "number" ? value.limit : 0,
|
|
175
|
-
nextPageToken: extractPageToken(typeof value.next === "string" ? value.next : void 0),
|
|
176
|
-
offset: typeof value.offset === "number" ? value.offset : 0,
|
|
177
|
-
previousPageToken: extractPageToken(typeof value.previous === "string" ? value.previous : void 0),
|
|
178
|
-
total: typeof value.total === "number" ? value.total : void 0
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function normalizeCursorPage(value, itemKey, responseSchema) {
|
|
182
|
-
if (!isRecord(value)) return value;
|
|
183
|
-
const itemsValue = value[itemKey];
|
|
184
|
-
const parsedItems = responseSchema.parse(itemsValue);
|
|
185
|
-
const cursors = isRecord(value.cursors) ? value.cursors : void 0;
|
|
186
|
-
return {
|
|
187
|
-
href: typeof value.href === "string" ? value.href : void 0,
|
|
188
|
-
items: parsedItems,
|
|
189
|
-
limit: typeof value.limit === "number" ? value.limit : 0,
|
|
190
|
-
nextPageToken: extractPageToken(typeof value.next === "string" ? value.next : void 0) ?? (typeof cursors?.after === "string" ? cursors.after : void 0),
|
|
191
|
-
previousPageToken: extractPageToken(typeof value.previous === "string" ? value.previous : void 0) ?? (typeof cursors?.before === "string" ? cursors.before : void 0),
|
|
192
|
-
total: typeof value.total === "number" ? value.total : void 0,
|
|
193
|
-
cursors: {
|
|
194
|
-
...typeof cursors?.after === "string" ? { after: cursors.after } : {},
|
|
195
|
-
...typeof cursors?.before === "string" ? { before: cursors.before } : {}
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
function normalizeEmptySuccess() {
|
|
200
|
-
return { success: true };
|
|
201
|
-
}
|
|
202
|
-
function normalizeEmptyBodyToNull(value) {
|
|
203
|
-
return value === "" ? null : value;
|
|
204
|
-
}
|
|
205
|
-
function toSnakeCaseBody(body) {
|
|
206
|
-
return JSON.stringify(snakeizeSpotifyJson(body));
|
|
207
|
-
}
|
|
208
|
-
function defaultSleep(ms) {
|
|
209
|
-
return new Promise((resolve) => {
|
|
210
|
-
setTimeout(resolve, ms);
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
function encodeId(value) {
|
|
214
|
-
return encodeURIComponent(value);
|
|
215
|
-
}
|
|
216
|
-
function createSpotifyClient(credentials, config = {}) {
|
|
217
|
-
const fetchImpl = config.fetch ?? fetch;
|
|
218
|
-
const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
219
|
-
const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
220
|
-
const sleep = config.sleep ?? defaultSleep;
|
|
221
|
-
async function request(options) {
|
|
222
|
-
const url = toUrl(baseUrl, options.path);
|
|
223
|
-
appendQueryParams(url, options.query);
|
|
224
|
-
const method = options.method ?? "GET";
|
|
225
|
-
const requestHeaders = new Headers({
|
|
226
|
-
Authorization: `Bearer ${credentials.SPOTIFY_ACCESS_TOKEN}`,
|
|
227
|
-
Accept: "application/json",
|
|
228
|
-
...options.headers
|
|
229
|
-
});
|
|
230
|
-
let requestBody;
|
|
231
|
-
if (options.body !== void 0) {
|
|
232
|
-
if (!requestHeaders.has("Content-Type")) requestHeaders.set("Content-Type", "application/json");
|
|
233
|
-
if (typeof options.body === "string") requestBody = options.body;
|
|
234
|
-
else requestBody = toSnakeCaseBody(options.body);
|
|
235
|
-
}
|
|
236
|
-
for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
|
|
237
|
-
const response = await fetchImpl(url, {
|
|
238
|
-
method,
|
|
239
|
-
headers: requestHeaders,
|
|
240
|
-
body: requestBody
|
|
241
|
-
});
|
|
242
|
-
const camelizedBody = camelizeSpotifyJson((response.headers.get("content-type") ?? "").includes("application/json") ? await response.json() : await response.text());
|
|
243
|
-
const retryAfterSeconds = parseRetryAfter(response.headers);
|
|
244
|
-
const requestId = getRequestId(response.headers);
|
|
245
|
-
if (!response.ok) {
|
|
246
|
-
const { message, code } = extractErrorMessage(camelizedBody, response.statusText);
|
|
247
|
-
const error = classifySpotifyApiError({
|
|
248
|
-
status: response.status,
|
|
249
|
-
message,
|
|
250
|
-
code,
|
|
251
|
-
requestId,
|
|
252
|
-
retryAfterSeconds
|
|
253
|
-
});
|
|
254
|
-
if (error.retryable && attempt < maxRetries) {
|
|
255
|
-
await sleep((retryAfterSeconds ?? attempt + 1) * 1e3);
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
throw error;
|
|
259
|
-
}
|
|
260
|
-
const mapped = options.mapResponse ? options.mapResponse(camelizedBody) : camelizedBody;
|
|
261
|
-
const parsed = options.responseSchema.safeParse(mapped);
|
|
262
|
-
if (!parsed.success) throw new SpotifyApiError({
|
|
263
|
-
kind: "validation",
|
|
264
|
-
message: parsed.error.issues.map((issue) => issue.message).join("; "),
|
|
265
|
-
requestId,
|
|
266
|
-
retryable: false
|
|
267
|
-
});
|
|
268
|
-
return parsed.data;
|
|
269
|
-
}
|
|
270
|
-
throw new SpotifyApiError({
|
|
271
|
-
kind: "rate_limit",
|
|
272
|
-
message: "Spotify API request exhausted retry budget",
|
|
273
|
-
retryable: true
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
function getOffsetPage(path, query, itemKey, itemListSchema, pageSchema) {
|
|
277
|
-
return request({
|
|
278
|
-
path,
|
|
279
|
-
query,
|
|
280
|
-
responseSchema: pageSchema,
|
|
281
|
-
mapResponse: (value) => normalizeOffsetPage(value, itemKey, itemListSchema)
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
function getCursorPage(path, query, itemKey, itemListSchema, pageSchema) {
|
|
285
|
-
return request({
|
|
286
|
-
path,
|
|
287
|
-
query,
|
|
288
|
-
responseSchema: pageSchema,
|
|
289
|
-
mapResponse: (value) => normalizeCursorPage(value, itemKey, itemListSchema)
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
return {
|
|
293
|
-
albums: {
|
|
294
|
-
getAlbum: (id, market) => request({
|
|
295
|
-
path: `/albums/${encodeId(id)}`,
|
|
296
|
-
query: { market },
|
|
297
|
-
responseSchema: spotifyAlbumSchema
|
|
298
|
-
}),
|
|
299
|
-
getAlbumTracks: (id, query) => getOffsetPage(`/albums/${encodeId(id)}/tracks`, query, "items", z.array(spotifyTrackSchema), spotifyTrackPageSchema),
|
|
300
|
-
getSeveralAlbums: (ids, market) => request({
|
|
301
|
-
path: "/albums",
|
|
302
|
-
query: {
|
|
303
|
-
ids,
|
|
304
|
-
market
|
|
305
|
-
},
|
|
306
|
-
responseSchema: severalAlbumsResponseSchema$1,
|
|
307
|
-
mapResponse: (value) => isRecord(value) ? value : { albums: [] }
|
|
308
|
-
}),
|
|
309
|
-
getNewReleases: (query) => request({
|
|
310
|
-
path: "/browse/new-releases",
|
|
311
|
-
query,
|
|
312
|
-
responseSchema: spotifyAlbumPageSchema,
|
|
313
|
-
mapResponse: (value) => {
|
|
314
|
-
if (!isRecord(value)) return value;
|
|
315
|
-
return normalizeOffsetPage(value.albums, "items", z.array(spotifyAlbumSummarySchema));
|
|
316
|
-
}
|
|
317
|
-
})
|
|
318
|
-
},
|
|
319
|
-
artists: {
|
|
320
|
-
getArtist: (id) => request({
|
|
321
|
-
path: `/artists/${encodeId(id)}`,
|
|
322
|
-
responseSchema: spotifyArtistSchema
|
|
323
|
-
}),
|
|
324
|
-
getArtistAlbums: (id, query) => getOffsetPage(`/artists/${encodeId(id)}/albums`, query, "items", z.array(spotifyAlbumSummarySchema), spotifyAlbumPageSchema),
|
|
325
|
-
getArtistTopTracks: (id, market) => request({
|
|
326
|
-
path: `/artists/${encodeId(id)}/top-tracks`,
|
|
327
|
-
query: { market },
|
|
328
|
-
responseSchema: topTracksResponseSchema,
|
|
329
|
-
mapResponse: (value) => isRecord(value) ? value : { tracks: [] }
|
|
330
|
-
}),
|
|
331
|
-
getArtistRelatedArtists: (id) => request({
|
|
332
|
-
path: `/artists/${encodeId(id)}/related-artists`,
|
|
333
|
-
responseSchema: severalArtistsResponseSchema$2,
|
|
334
|
-
mapResponse: (value) => isRecord(value) ? value : { artists: [] }
|
|
335
|
-
}),
|
|
336
|
-
getSeveralArtists: (ids) => request({
|
|
337
|
-
path: "/artists",
|
|
338
|
-
query: { ids },
|
|
339
|
-
responseSchema: severalArtistsResponseSchema$2,
|
|
340
|
-
mapResponse: (value) => isRecord(value) ? value : { artists: [] }
|
|
341
|
-
})
|
|
342
|
-
},
|
|
343
|
-
tracks: {
|
|
344
|
-
getTrack: (id, market) => request({
|
|
345
|
-
path: `/tracks/${encodeId(id)}`,
|
|
346
|
-
query: { market },
|
|
347
|
-
responseSchema: spotifyTrackSchema
|
|
348
|
-
}),
|
|
349
|
-
getSeveralTracks: (ids, market) => request({
|
|
350
|
-
path: "/tracks",
|
|
351
|
-
query: {
|
|
352
|
-
ids,
|
|
353
|
-
market
|
|
354
|
-
},
|
|
355
|
-
responseSchema: severalTracksResponseSchema$1,
|
|
356
|
-
mapResponse: (value) => isRecord(value) ? value : { tracks: [] }
|
|
357
|
-
})
|
|
358
|
-
},
|
|
359
|
-
audioFeatures: {
|
|
360
|
-
getAudioFeatures: (id) => request({
|
|
361
|
-
path: `/audio-features/${encodeId(id)}`,
|
|
362
|
-
responseSchema: spotifyAudioFeaturesSchema
|
|
363
|
-
}),
|
|
364
|
-
getSeveralAudioFeatures: (ids) => request({
|
|
365
|
-
path: "/audio-features",
|
|
366
|
-
query: { ids },
|
|
367
|
-
responseSchema: z.object({ audioFeatures: z.array(spotifyAudioFeaturesSchema.nullable()) })
|
|
368
|
-
})
|
|
369
|
-
},
|
|
370
|
-
audioAnalysis: { getAudioAnalysis: (id) => request({
|
|
371
|
-
path: `/audio-analysis/${encodeId(id)}`,
|
|
372
|
-
responseSchema: spotifyAudioAnalysisSchema
|
|
373
|
-
}) },
|
|
374
|
-
recommendations: { getRecommendations: (query) => request({
|
|
375
|
-
path: "/recommendations",
|
|
376
|
-
query,
|
|
377
|
-
responseSchema: spotifyRecommendationsSchema
|
|
378
|
-
}) },
|
|
379
|
-
shows: {
|
|
380
|
-
getShow: (id, market) => request({
|
|
381
|
-
path: `/shows/${encodeId(id)}`,
|
|
382
|
-
query: { market },
|
|
383
|
-
responseSchema: spotifyShowSchema
|
|
384
|
-
}),
|
|
385
|
-
getSeveralShows: (ids, market) => request({
|
|
386
|
-
path: "/shows",
|
|
387
|
-
query: {
|
|
388
|
-
ids,
|
|
389
|
-
market
|
|
390
|
-
},
|
|
391
|
-
responseSchema: severalShowsResponseSchema,
|
|
392
|
-
mapResponse: (value) => isRecord(value) ? value : { shows: [] }
|
|
393
|
-
}),
|
|
394
|
-
getShowEpisodes: (id, query) => getOffsetPage(`/shows/${encodeId(id)}/episodes`, query, "items", z.array(spotifyEpisodeSchema), spotifyEpisodePageSchema)
|
|
395
|
-
},
|
|
396
|
-
episodes: {
|
|
397
|
-
getEpisode: (id, market) => request({
|
|
398
|
-
path: `/episodes/${encodeId(id)}`,
|
|
399
|
-
query: { market },
|
|
400
|
-
responseSchema: spotifyEpisodeSchema
|
|
401
|
-
}),
|
|
402
|
-
getSeveralEpisodes: (ids, market) => request({
|
|
403
|
-
path: "/episodes",
|
|
404
|
-
query: {
|
|
405
|
-
ids,
|
|
406
|
-
market
|
|
407
|
-
},
|
|
408
|
-
responseSchema: severalEpisodesResponseSchema,
|
|
409
|
-
mapResponse: (value) => isRecord(value) ? value : { episodes: [] }
|
|
410
|
-
})
|
|
411
|
-
},
|
|
412
|
-
audiobooks: {
|
|
413
|
-
getAudiobook: (id, market) => request({
|
|
414
|
-
path: `/audiobooks/${encodeId(id)}`,
|
|
415
|
-
query: { market },
|
|
416
|
-
responseSchema: spotifyAudiobookSchema
|
|
417
|
-
}),
|
|
418
|
-
getSeveralAudiobooks: (ids, market) => request({
|
|
419
|
-
path: "/audiobooks",
|
|
420
|
-
query: {
|
|
421
|
-
ids,
|
|
422
|
-
market
|
|
423
|
-
},
|
|
424
|
-
responseSchema: severalAudiobooksResponseSchema,
|
|
425
|
-
mapResponse: (value) => isRecord(value) ? value : { audiobooks: [] }
|
|
426
|
-
}),
|
|
427
|
-
getAudiobookChapters: (id, query) => getOffsetPage(`/audiobooks/${encodeId(id)}/chapters`, query, "items", z.array(spotifyChapterSchema), spotifyChapterPageSchema)
|
|
428
|
-
},
|
|
429
|
-
chapters: {
|
|
430
|
-
getChapter: (id, market) => request({
|
|
431
|
-
path: `/chapters/${encodeId(id)}`,
|
|
432
|
-
query: { market },
|
|
433
|
-
responseSchema: spotifyChapterSchema
|
|
434
|
-
}),
|
|
435
|
-
getSeveralChapters: (ids, market) => request({
|
|
436
|
-
path: "/chapters",
|
|
437
|
-
query: {
|
|
438
|
-
ids,
|
|
439
|
-
market
|
|
440
|
-
},
|
|
441
|
-
responseSchema: severalChaptersResponseSchema,
|
|
442
|
-
mapResponse: (value) => isRecord(value) ? value : { chapters: [] }
|
|
443
|
-
})
|
|
444
|
-
},
|
|
445
|
-
discovery: {
|
|
446
|
-
search: (query) => request({
|
|
447
|
-
path: "/search",
|
|
448
|
-
query,
|
|
449
|
-
responseSchema: spotifySearchResultSchema
|
|
450
|
-
}),
|
|
451
|
-
getAvailableMarkets: () => request({
|
|
452
|
-
path: "/markets",
|
|
453
|
-
responseSchema: z.object({ markets: z.array(spotifyMarketSchema) })
|
|
454
|
-
}),
|
|
455
|
-
getAvailableGenreSeeds: () => request({
|
|
456
|
-
path: "/recommendations/available-genre-seeds",
|
|
457
|
-
responseSchema: z.object({ genres: z.array(z.string().min(1)) })
|
|
458
|
-
}),
|
|
459
|
-
getBrowseCategories: (query) => request({
|
|
460
|
-
path: "/browse/categories",
|
|
461
|
-
query,
|
|
462
|
-
responseSchema: spotifyCategoryPageSchema,
|
|
463
|
-
mapResponse: (value) => {
|
|
464
|
-
if (!isRecord(value)) return value;
|
|
465
|
-
return normalizeOffsetPage(value.categories, "items", z.array(spotifyCategorySchema));
|
|
466
|
-
}
|
|
467
|
-
}),
|
|
468
|
-
getBrowseCategory: (id, query) => request({
|
|
469
|
-
path: `/browse/categories/${encodeId(id)}`,
|
|
470
|
-
query,
|
|
471
|
-
responseSchema: spotifyCategorySchema
|
|
472
|
-
}),
|
|
473
|
-
getCategoryPlaylists: (id, query) => request({
|
|
474
|
-
path: `/browse/categories/${encodeId(id)}/playlists`,
|
|
475
|
-
query,
|
|
476
|
-
responseSchema: spotifyPlaylistPageSchema,
|
|
477
|
-
mapResponse: (value) => {
|
|
478
|
-
if (!isRecord(value)) return value;
|
|
479
|
-
return normalizeOffsetPage(value.playlists, "items", z.array(spotifyPlaylistSchema));
|
|
480
|
-
}
|
|
481
|
-
}),
|
|
482
|
-
getFeaturedPlaylists: (query) => request({
|
|
483
|
-
path: "/browse/featured-playlists",
|
|
484
|
-
query,
|
|
485
|
-
responseSchema: spotifyPlaylistPageSchema,
|
|
486
|
-
mapResponse: (value) => {
|
|
487
|
-
if (!isRecord(value)) return value;
|
|
488
|
-
return normalizeOffsetPage(value.playlists, "items", z.array(spotifyPlaylistSchema));
|
|
489
|
-
}
|
|
490
|
-
})
|
|
491
|
-
},
|
|
492
|
-
playlists: {
|
|
493
|
-
createPlaylist: (body) => request({
|
|
494
|
-
method: "POST",
|
|
495
|
-
path: "/me/playlists",
|
|
496
|
-
body,
|
|
497
|
-
responseSchema: spotifyPlaylistSchema
|
|
498
|
-
}),
|
|
499
|
-
getPlaylist: (id, query) => request({
|
|
500
|
-
path: `/playlists/${encodeId(id)}`,
|
|
501
|
-
query,
|
|
502
|
-
responseSchema: spotifyPlaylistSchema
|
|
503
|
-
}),
|
|
504
|
-
updatePlaylistDetails: (id, body) => request({
|
|
505
|
-
method: "PUT",
|
|
506
|
-
path: `/playlists/${encodeId(id)}`,
|
|
507
|
-
body,
|
|
508
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
509
|
-
mapResponse: normalizeEmptySuccess
|
|
510
|
-
}),
|
|
511
|
-
getPlaylistItems: (id, query) => getOffsetPage(`/playlists/${encodeId(id)}/tracks`, query, "items", z.array(spotifyPlaylistItemSchema), spotifyPlaylistItemPageSchema),
|
|
512
|
-
getPlaylistCoverImage: (id) => request({
|
|
513
|
-
path: `/playlists/${encodeId(id)}/images`,
|
|
514
|
-
responseSchema: z.object({ images: z.array(spotifyPlaylistImageSchema) }),
|
|
515
|
-
mapResponse: (value) => ({ images: value })
|
|
516
|
-
}),
|
|
517
|
-
addItemsToPlaylist: (id, body) => request({
|
|
518
|
-
method: "POST",
|
|
519
|
-
path: `/playlists/${encodeId(id)}/tracks`,
|
|
520
|
-
body,
|
|
521
|
-
responseSchema: spotifySnapshotResponseSchema
|
|
522
|
-
}),
|
|
523
|
-
reorderPlaylistItems: (id, body) => request({
|
|
524
|
-
method: "PUT",
|
|
525
|
-
path: `/playlists/${encodeId(id)}/tracks`,
|
|
526
|
-
body,
|
|
527
|
-
responseSchema: spotifySnapshotResponseSchema
|
|
528
|
-
}),
|
|
529
|
-
replacePlaylistItems: (id, body) => request({
|
|
530
|
-
method: "PUT",
|
|
531
|
-
path: `/playlists/${encodeId(id)}/tracks`,
|
|
532
|
-
body,
|
|
533
|
-
responseSchema: spotifySnapshotResponseSchema
|
|
534
|
-
}),
|
|
535
|
-
removeItemsFromPlaylist: (id, body) => request({
|
|
536
|
-
method: "DELETE",
|
|
537
|
-
path: `/playlists/${encodeId(id)}/tracks`,
|
|
538
|
-
body,
|
|
539
|
-
responseSchema: spotifySnapshotResponseSchema
|
|
540
|
-
}),
|
|
541
|
-
listMyPlaylists: (query) => getOffsetPage("/me/playlists", query, "items", z.array(spotifyPlaylistSchema), spotifyPlaylistPageSchema),
|
|
542
|
-
listUserPlaylists: (userId, query) => getOffsetPage(`/users/${encodeId(userId)}/playlists`, query, "items", z.array(spotifyPlaylistSchema), spotifyPlaylistPageSchema),
|
|
543
|
-
followPlaylist: (id, body) => request({
|
|
544
|
-
method: "PUT",
|
|
545
|
-
path: `/playlists/${encodeId(id)}/followers`,
|
|
546
|
-
body,
|
|
547
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
548
|
-
mapResponse: normalizeEmptySuccess
|
|
549
|
-
}),
|
|
550
|
-
unfollowPlaylist: (id) => request({
|
|
551
|
-
method: "DELETE",
|
|
552
|
-
path: `/playlists/${encodeId(id)}/followers`,
|
|
553
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
554
|
-
mapResponse: normalizeEmptySuccess
|
|
555
|
-
}),
|
|
556
|
-
checkUsersFollowPlaylist: (id, ids) => request({
|
|
557
|
-
path: `/playlists/${encodeId(id)}/followers/contains`,
|
|
558
|
-
query: { ids },
|
|
559
|
-
responseSchema: spotifyBooleanListSchema
|
|
560
|
-
}),
|
|
561
|
-
uploadPlaylistCoverImage: (id, imageBase64) => request({
|
|
562
|
-
method: "PUT",
|
|
563
|
-
path: `/playlists/${encodeId(id)}/images`,
|
|
564
|
-
body: imageBase64,
|
|
565
|
-
headers: { "Content-Type": "image/jpeg" },
|
|
566
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
567
|
-
mapResponse: normalizeEmptySuccess
|
|
568
|
-
})
|
|
569
|
-
},
|
|
570
|
-
users: {
|
|
571
|
-
getMe: () => request({
|
|
572
|
-
path: "/me",
|
|
573
|
-
responseSchema: spotifyUserSchema
|
|
574
|
-
}),
|
|
575
|
-
getUser: (userId) => request({
|
|
576
|
-
path: `/users/${encodeId(userId)}`,
|
|
577
|
-
responseSchema: spotifyUserSchema
|
|
578
|
-
}),
|
|
579
|
-
getMyTopArtists: (query) => getOffsetPage("/me/top/artists", query, "items", z.array(spotifyArtistSchema), spotifyArtistPageSchema),
|
|
580
|
-
getMyTopTracks: (query) => getOffsetPage("/me/top/tracks", query, "items", z.array(spotifyTrackSchema), spotifyTrackPageSchema)
|
|
581
|
-
},
|
|
582
|
-
follow: {
|
|
583
|
-
getFollowedArtists: (query) => request({
|
|
584
|
-
path: "/me/following",
|
|
585
|
-
query: {
|
|
586
|
-
...query,
|
|
587
|
-
type: "artist"
|
|
588
|
-
},
|
|
589
|
-
responseSchema: createSpotifyCursorPageSchema(spotifyArtistSchema),
|
|
590
|
-
mapResponse: (value) => {
|
|
591
|
-
if (!isRecord(value)) return value;
|
|
592
|
-
return normalizeCursorPage(value.artists, "items", z.array(spotifyArtistSchema));
|
|
593
|
-
}
|
|
594
|
-
}),
|
|
595
|
-
followArtistsOrUsers: (type, ids) => request({
|
|
596
|
-
method: "PUT",
|
|
597
|
-
path: "/me/following",
|
|
598
|
-
query: {
|
|
599
|
-
type,
|
|
600
|
-
ids
|
|
601
|
-
},
|
|
602
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
603
|
-
mapResponse: normalizeEmptySuccess
|
|
604
|
-
}),
|
|
605
|
-
unfollowArtistsOrUsers: (type, ids) => request({
|
|
606
|
-
method: "DELETE",
|
|
607
|
-
path: "/me/following",
|
|
608
|
-
query: {
|
|
609
|
-
type,
|
|
610
|
-
ids
|
|
611
|
-
},
|
|
612
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
613
|
-
mapResponse: normalizeEmptySuccess
|
|
614
|
-
}),
|
|
615
|
-
checkFollowingArtistsOrUsers: (type, ids) => request({
|
|
616
|
-
path: "/me/following/contains",
|
|
617
|
-
query: {
|
|
618
|
-
type,
|
|
619
|
-
ids
|
|
620
|
-
},
|
|
621
|
-
responseSchema: spotifyBooleanListSchema
|
|
622
|
-
})
|
|
623
|
-
},
|
|
624
|
-
player: {
|
|
625
|
-
getPlaybackState: (market) => request({
|
|
626
|
-
path: "/me/player",
|
|
627
|
-
query: { market },
|
|
628
|
-
responseSchema: nullablePlaybackStateSchema,
|
|
629
|
-
mapResponse: normalizeEmptyBodyToNull
|
|
630
|
-
}),
|
|
631
|
-
transferPlayback: (body) => request({
|
|
632
|
-
method: "PUT",
|
|
633
|
-
path: "/me/player",
|
|
634
|
-
body,
|
|
635
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
636
|
-
mapResponse: normalizeEmptySuccess
|
|
637
|
-
}),
|
|
638
|
-
getAvailableDevices: () => request({
|
|
639
|
-
path: "/me/player/devices",
|
|
640
|
-
responseSchema: z.object({ devices: z.array(spotifyDeviceSchema) })
|
|
641
|
-
}),
|
|
642
|
-
getCurrentlyPlaying: (query) => request({
|
|
643
|
-
path: "/me/player/currently-playing",
|
|
644
|
-
query,
|
|
645
|
-
responseSchema: nullablePlaybackStateSchema,
|
|
646
|
-
mapResponse: normalizeEmptyBodyToNull
|
|
647
|
-
}),
|
|
648
|
-
startOrResumePlayback: (body, deviceId) => request({
|
|
649
|
-
method: "PUT",
|
|
650
|
-
path: "/me/player/play",
|
|
651
|
-
query: { device_id: deviceId },
|
|
652
|
-
body,
|
|
653
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
654
|
-
mapResponse: normalizeEmptySuccess
|
|
655
|
-
}),
|
|
656
|
-
pausePlayback: (deviceId) => request({
|
|
657
|
-
method: "PUT",
|
|
658
|
-
path: "/me/player/pause",
|
|
659
|
-
query: { device_id: deviceId },
|
|
660
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
661
|
-
mapResponse: normalizeEmptySuccess
|
|
662
|
-
}),
|
|
663
|
-
skipToNext: (deviceId) => request({
|
|
664
|
-
method: "POST",
|
|
665
|
-
path: "/me/player/next",
|
|
666
|
-
query: { device_id: deviceId },
|
|
667
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
668
|
-
mapResponse: normalizeEmptySuccess
|
|
669
|
-
}),
|
|
670
|
-
skipToPrevious: (deviceId) => request({
|
|
671
|
-
method: "POST",
|
|
672
|
-
path: "/me/player/previous",
|
|
673
|
-
query: { device_id: deviceId },
|
|
674
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
675
|
-
mapResponse: normalizeEmptySuccess
|
|
676
|
-
}),
|
|
677
|
-
seekToPosition: (positionMs, deviceId) => request({
|
|
678
|
-
method: "PUT",
|
|
679
|
-
path: "/me/player/seek",
|
|
680
|
-
query: {
|
|
681
|
-
position_ms: positionMs,
|
|
682
|
-
device_id: deviceId
|
|
683
|
-
},
|
|
684
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
685
|
-
mapResponse: normalizeEmptySuccess
|
|
686
|
-
}),
|
|
687
|
-
setRepeatMode: (state, deviceId) => request({
|
|
688
|
-
method: "PUT",
|
|
689
|
-
path: "/me/player/repeat",
|
|
690
|
-
query: {
|
|
691
|
-
state,
|
|
692
|
-
device_id: deviceId
|
|
693
|
-
},
|
|
694
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
695
|
-
mapResponse: normalizeEmptySuccess
|
|
696
|
-
}),
|
|
697
|
-
setPlaybackVolume: (volumePercent, deviceId) => request({
|
|
698
|
-
method: "PUT",
|
|
699
|
-
path: "/me/player/volume",
|
|
700
|
-
query: {
|
|
701
|
-
volume_percent: volumePercent,
|
|
702
|
-
device_id: deviceId
|
|
703
|
-
},
|
|
704
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
705
|
-
mapResponse: normalizeEmptySuccess
|
|
706
|
-
}),
|
|
707
|
-
setShuffleMode: (state, deviceId) => request({
|
|
708
|
-
method: "PUT",
|
|
709
|
-
path: "/me/player/shuffle",
|
|
710
|
-
query: {
|
|
711
|
-
state,
|
|
712
|
-
device_id: deviceId
|
|
713
|
-
},
|
|
714
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
715
|
-
mapResponse: normalizeEmptySuccess
|
|
716
|
-
}),
|
|
717
|
-
getRecentlyPlayed: (query) => getCursorPage("/me/player/recently-played", query, "items", z.array(spotifyRecentlyPlayedItemSchema), spotifyRecentlyPlayedPageSchema),
|
|
718
|
-
addToQueue: (uri, deviceId) => request({
|
|
719
|
-
method: "POST",
|
|
720
|
-
path: "/me/player/queue",
|
|
721
|
-
query: {
|
|
722
|
-
uri,
|
|
723
|
-
device_id: deviceId
|
|
724
|
-
},
|
|
725
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
726
|
-
mapResponse: normalizeEmptySuccess
|
|
727
|
-
}),
|
|
728
|
-
getQueue: () => request({
|
|
729
|
-
path: "/me/player/queue",
|
|
730
|
-
responseSchema: spotifyQueueSchema
|
|
731
|
-
})
|
|
732
|
-
},
|
|
733
|
-
library: {
|
|
734
|
-
listSavedAlbums: (query) => getOffsetPage("/me/albums", query, "items", z.array(spotifySavedAlbumItemSchema), spotifySavedAlbumPageSchema),
|
|
735
|
-
saveAlbums: (ids) => request({
|
|
736
|
-
method: "PUT",
|
|
737
|
-
path: "/me/albums",
|
|
738
|
-
query: { ids },
|
|
739
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
740
|
-
mapResponse: normalizeEmptySuccess
|
|
741
|
-
}),
|
|
742
|
-
removeSavedAlbums: (ids) => request({
|
|
743
|
-
method: "DELETE",
|
|
744
|
-
path: "/me/albums",
|
|
745
|
-
query: { ids },
|
|
746
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
747
|
-
mapResponse: normalizeEmptySuccess
|
|
748
|
-
}),
|
|
749
|
-
checkSavedAlbums: (ids) => request({
|
|
750
|
-
path: "/me/albums/contains",
|
|
751
|
-
query: { ids },
|
|
752
|
-
responseSchema: spotifyBooleanListSchema
|
|
753
|
-
}),
|
|
754
|
-
listSavedTracks: (query) => getOffsetPage("/me/tracks", query, "items", z.array(spotifySavedTrackItemSchema), spotifySavedTrackPageSchema),
|
|
755
|
-
saveTracks: (ids) => request({
|
|
756
|
-
method: "PUT",
|
|
757
|
-
path: "/me/tracks",
|
|
758
|
-
query: { ids },
|
|
759
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
760
|
-
mapResponse: normalizeEmptySuccess
|
|
761
|
-
}),
|
|
762
|
-
removeSavedTracks: (ids) => request({
|
|
763
|
-
method: "DELETE",
|
|
764
|
-
path: "/me/tracks",
|
|
765
|
-
query: { ids },
|
|
766
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
767
|
-
mapResponse: normalizeEmptySuccess
|
|
768
|
-
}),
|
|
769
|
-
checkSavedTracks: (ids) => request({
|
|
770
|
-
path: "/me/tracks/contains",
|
|
771
|
-
query: { ids },
|
|
772
|
-
responseSchema: spotifyBooleanListSchema
|
|
773
|
-
}),
|
|
774
|
-
listSavedShows: (query) => getOffsetPage("/me/shows", query, "items", z.array(spotifySavedShowItemSchema), spotifySavedShowPageSchema),
|
|
775
|
-
saveShows: (ids) => request({
|
|
776
|
-
method: "PUT",
|
|
777
|
-
path: "/me/shows",
|
|
778
|
-
query: { ids },
|
|
779
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
780
|
-
mapResponse: normalizeEmptySuccess
|
|
781
|
-
}),
|
|
782
|
-
removeSavedShows: (ids) => request({
|
|
783
|
-
method: "DELETE",
|
|
784
|
-
path: "/me/shows",
|
|
785
|
-
query: { ids },
|
|
786
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
787
|
-
mapResponse: normalizeEmptySuccess
|
|
788
|
-
}),
|
|
789
|
-
checkSavedShows: (ids) => request({
|
|
790
|
-
path: "/me/shows/contains",
|
|
791
|
-
query: { ids },
|
|
792
|
-
responseSchema: spotifyBooleanListSchema
|
|
793
|
-
}),
|
|
794
|
-
listSavedEpisodes: (query) => getOffsetPage("/me/episodes", query, "items", z.array(spotifySavedEpisodeItemSchema), spotifySavedEpisodePageSchema),
|
|
795
|
-
saveEpisodes: (ids) => request({
|
|
796
|
-
method: "PUT",
|
|
797
|
-
path: "/me/episodes",
|
|
798
|
-
query: { ids },
|
|
799
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
800
|
-
mapResponse: normalizeEmptySuccess
|
|
801
|
-
}),
|
|
802
|
-
removeSavedEpisodes: (ids) => request({
|
|
803
|
-
method: "DELETE",
|
|
804
|
-
path: "/me/episodes",
|
|
805
|
-
query: { ids },
|
|
806
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
807
|
-
mapResponse: normalizeEmptySuccess
|
|
808
|
-
}),
|
|
809
|
-
checkSavedEpisodes: (ids) => request({
|
|
810
|
-
path: "/me/episodes/contains",
|
|
811
|
-
query: { ids },
|
|
812
|
-
responseSchema: spotifyBooleanListSchema
|
|
813
|
-
}),
|
|
814
|
-
listSavedAudiobooks: (query) => getOffsetPage("/me/audiobooks", query, "items", z.array(spotifySavedAudiobookItemSchema), spotifySavedAudiobookPageSchema),
|
|
815
|
-
saveAudiobooks: (ids) => request({
|
|
816
|
-
method: "PUT",
|
|
817
|
-
path: "/me/audiobooks",
|
|
818
|
-
query: { ids },
|
|
819
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
820
|
-
mapResponse: normalizeEmptySuccess
|
|
821
|
-
}),
|
|
822
|
-
removeSavedAudiobooks: (ids) => request({
|
|
823
|
-
method: "DELETE",
|
|
824
|
-
path: "/me/audiobooks",
|
|
825
|
-
query: { ids },
|
|
826
|
-
responseSchema: spotifyMutationSuccessSchema,
|
|
827
|
-
mapResponse: normalizeEmptySuccess
|
|
828
|
-
}),
|
|
829
|
-
checkSavedAudiobooks: (ids) => request({
|
|
830
|
-
path: "/me/audiobooks/contains",
|
|
831
|
-
query: { ids },
|
|
832
|
-
responseSchema: spotifyBooleanListSchema
|
|
833
|
-
})
|
|
834
|
-
}
|
|
835
|
-
};
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
//#endregion
|
|
839
|
-
//#region src/operations/add-items-to-playlist.operation.ts
|
|
840
|
-
const playlistPaginationInputSchema$13 = z.object({
|
|
841
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
842
|
-
offset: z.number().int().nonnegative().optional()
|
|
843
|
-
});
|
|
844
|
-
const playlistIdInputSchema$13 = z.object({ playlistId: spotifyIdSchema });
|
|
845
|
-
const playlistAdditionalTypeSchema$13 = z.enum(["track", "episode"]);
|
|
846
|
-
z.object({
|
|
847
|
-
name: z.string().trim().min(1),
|
|
848
|
-
public: z.boolean().optional(),
|
|
849
|
-
collaborative: z.boolean().optional(),
|
|
850
|
-
description: z.string().optional()
|
|
851
|
-
});
|
|
852
|
-
const getPlaylistInputSchema$13 = playlistIdInputSchema$13.extend({
|
|
853
|
-
market: spotifyMarketSchema.optional(),
|
|
854
|
-
fields: z.string().trim().min(1).optional(),
|
|
855
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$13).min(1).optional()
|
|
856
|
-
});
|
|
857
|
-
playlistIdInputSchema$13.extend({
|
|
858
|
-
name: z.string().trim().min(1).optional(),
|
|
859
|
-
public: z.boolean().optional(),
|
|
860
|
-
collaborative: z.boolean().optional(),
|
|
861
|
-
description: z.string().optional()
|
|
862
|
-
});
|
|
863
|
-
getPlaylistInputSchema$13.extend({
|
|
864
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
865
|
-
offset: z.number().int().nonnegative().optional()
|
|
866
|
-
});
|
|
867
|
-
const addItemsToPlaylistInputSchema = playlistIdInputSchema$13.extend({
|
|
868
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
869
|
-
position: z.number().int().nonnegative().optional()
|
|
870
|
-
});
|
|
871
|
-
playlistIdInputSchema$13.extend({
|
|
872
|
-
mode: z.literal("reorder"),
|
|
873
|
-
rangeStart: z.number().int().nonnegative(),
|
|
874
|
-
insertBefore: z.number().int().nonnegative(),
|
|
875
|
-
rangeLength: z.number().int().positive().optional(),
|
|
876
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
877
|
-
});
|
|
878
|
-
playlistIdInputSchema$13.extend({
|
|
879
|
-
mode: z.literal("replace"),
|
|
880
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
881
|
-
});
|
|
882
|
-
const playlistTrackRemovalSchema$13 = z.object({
|
|
883
|
-
uri: spotifyUriSchema,
|
|
884
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
885
|
-
});
|
|
886
|
-
playlistIdInputSchema$13.extend({
|
|
887
|
-
tracks: z.array(playlistTrackRemovalSchema$13).min(1).max(100),
|
|
888
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
889
|
-
});
|
|
890
|
-
playlistPaginationInputSchema$13.extend({ userId: spotifyIdSchema });
|
|
891
|
-
playlistIdInputSchema$13.extend({ public: z.boolean().optional() });
|
|
892
|
-
playlistIdInputSchema$13.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
893
|
-
playlistIdInputSchema$13.extend({ imageBase64: z.string().trim().min(1) });
|
|
894
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
895
|
-
const addItemsToPlaylistOperation = new Operation({
|
|
896
|
-
credentialSets: [spotifyCredentialSet],
|
|
897
|
-
id: "spotify.add-items-to-playlist",
|
|
898
|
-
name: "Add Items To Playlist",
|
|
899
|
-
description: "Add tracks or episodes to a Spotify playlist.",
|
|
900
|
-
input: addItemsToPlaylistInputSchema,
|
|
901
|
-
output: spotifySnapshotResponseSchema,
|
|
902
|
-
needsApproval: true,
|
|
903
|
-
run: async (input, context) => {
|
|
904
|
-
const credentials = context.credentials.spotify;
|
|
905
|
-
return createSpotifyClient(credentials).playlists.addItemsToPlaylist(input.playlistId, {
|
|
906
|
-
uris: input.uris,
|
|
907
|
-
position: input.position
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
});
|
|
911
|
-
|
|
912
|
-
//#endregion
|
|
913
|
-
//#region src/operations/add-to-queue.operation.ts
|
|
914
|
-
z.object({});
|
|
915
|
-
const playbackTypesSchema$14 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
916
|
-
const deviceIdSchema$14 = spotifyIdSchema.optional();
|
|
917
|
-
z.object({
|
|
918
|
-
market: spotifyMarketSchema.optional(),
|
|
919
|
-
additionalTypes: playbackTypesSchema$14
|
|
920
|
-
});
|
|
921
|
-
z.object({
|
|
922
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
923
|
-
play: z.boolean().optional()
|
|
924
|
-
});
|
|
925
|
-
const playbackOffsetSchema$14 = z.object({
|
|
926
|
-
position: z.number().int().nonnegative().optional(),
|
|
927
|
-
uri: spotifyUriSchema.optional()
|
|
928
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
929
|
-
z.object({
|
|
930
|
-
deviceId: deviceIdSchema$14,
|
|
931
|
-
contextUri: spotifyUriSchema.optional(),
|
|
932
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
933
|
-
offset: playbackOffsetSchema$14.optional(),
|
|
934
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
935
|
-
});
|
|
936
|
-
const withOptionalDeviceIdSchema$14 = z.object({ deviceId: deviceIdSchema$14 });
|
|
937
|
-
withOptionalDeviceIdSchema$14.extend({ positionMs: z.number().int().nonnegative() });
|
|
938
|
-
withOptionalDeviceIdSchema$14.extend({ state: z.enum([
|
|
939
|
-
"track",
|
|
940
|
-
"context",
|
|
941
|
-
"off"
|
|
942
|
-
]) });
|
|
943
|
-
withOptionalDeviceIdSchema$14.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
944
|
-
withOptionalDeviceIdSchema$14.extend({ state: z.boolean() });
|
|
945
|
-
z.object({
|
|
946
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
947
|
-
after: z.number().int().nonnegative().optional(),
|
|
948
|
-
before: z.number().int().nonnegative().optional()
|
|
949
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
950
|
-
const addToQueueInputSchema = withOptionalDeviceIdSchema$14.extend({ uri: spotifyUriSchema });
|
|
951
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
952
|
-
const addToQueueOperation = new Operation({
|
|
953
|
-
credentialSets: [spotifyCredentialSet],
|
|
954
|
-
id: "spotify.add-to-queue",
|
|
955
|
-
name: "Add To Queue",
|
|
956
|
-
description: "Add a track or episode to the Spotify playback queue.",
|
|
957
|
-
input: addToQueueInputSchema,
|
|
958
|
-
output: spotifyMutationSuccessSchema,
|
|
959
|
-
needsApproval: true,
|
|
960
|
-
run: async (input, context) => {
|
|
961
|
-
const credentials = context.credentials.spotify;
|
|
962
|
-
return createSpotifyClient(credentials).player.addToQueue(input.uri, input.deviceId);
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
|
|
966
|
-
//#endregion
|
|
967
|
-
//#region src/operations/check-saved-albums.operation.ts
|
|
968
|
-
z.object({
|
|
969
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
970
|
-
offset: z.number().int().nonnegative().optional()
|
|
971
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
972
|
-
const savedItemIdsInputSchema$14 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
973
|
-
const checkSavedAlbumsOperation = new Operation({
|
|
974
|
-
credentialSets: [spotifyCredentialSet],
|
|
975
|
-
id: "spotify.check-saved-albums",
|
|
976
|
-
name: "Check Saved Albums",
|
|
977
|
-
description: "Check whether albums are saved in the connected Spotify account library.",
|
|
978
|
-
input: savedItemIdsInputSchema$14,
|
|
979
|
-
output: spotifyBooleanListSchema,
|
|
980
|
-
run: async (input, context) => {
|
|
981
|
-
const credentials = context.credentials.spotify;
|
|
982
|
-
return createSpotifyClient(credentials).library.checkSavedAlbums(input.ids);
|
|
983
|
-
}
|
|
984
|
-
});
|
|
985
|
-
|
|
986
|
-
//#endregion
|
|
987
|
-
//#region src/operations/check-saved-audiobooks.operation.ts
|
|
988
|
-
z.object({
|
|
989
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
990
|
-
offset: z.number().int().nonnegative().optional()
|
|
991
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
992
|
-
const savedItemIdsInputSchema$13 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
993
|
-
const checkSavedAudiobooksOperation = new Operation({
|
|
994
|
-
credentialSets: [spotifyCredentialSet],
|
|
995
|
-
id: "spotify.check-saved-audiobooks",
|
|
996
|
-
name: "Check Saved Audiobooks",
|
|
997
|
-
description: "Check whether audiobooks are saved in the connected Spotify account library.",
|
|
998
|
-
input: savedItemIdsInputSchema$13,
|
|
999
|
-
output: spotifyBooleanListSchema,
|
|
1000
|
-
run: async (input, context) => {
|
|
1001
|
-
const credentials = context.credentials.spotify;
|
|
1002
|
-
return createSpotifyClient(credentials).library.checkSavedAudiobooks(input.ids);
|
|
1003
|
-
}
|
|
1004
|
-
});
|
|
1005
|
-
|
|
1006
|
-
//#endregion
|
|
1007
|
-
//#region src/operations/check-saved-episodes.operation.ts
|
|
1008
|
-
z.object({
|
|
1009
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1010
|
-
offset: z.number().int().nonnegative().optional()
|
|
1011
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
1012
|
-
const savedItemIdsInputSchema$12 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
1013
|
-
const checkSavedEpisodesOperation = new Operation({
|
|
1014
|
-
credentialSets: [spotifyCredentialSet],
|
|
1015
|
-
id: "spotify.check-saved-episodes",
|
|
1016
|
-
name: "Check Saved Episodes",
|
|
1017
|
-
description: "Check whether episodes are saved in the connected Spotify account library.",
|
|
1018
|
-
input: savedItemIdsInputSchema$12,
|
|
1019
|
-
output: spotifyBooleanListSchema,
|
|
1020
|
-
run: async (input, context) => {
|
|
1021
|
-
const credentials = context.credentials.spotify;
|
|
1022
|
-
return createSpotifyClient(credentials).library.checkSavedEpisodes(input.ids);
|
|
1023
|
-
}
|
|
1024
|
-
});
|
|
1025
|
-
|
|
1026
|
-
//#endregion
|
|
1027
|
-
//#region src/operations/check-saved-shows.operation.ts
|
|
1028
|
-
z.object({
|
|
1029
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1030
|
-
offset: z.number().int().nonnegative().optional()
|
|
1031
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
1032
|
-
const savedItemIdsInputSchema$11 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
1033
|
-
const checkSavedShowsOperation = new Operation({
|
|
1034
|
-
credentialSets: [spotifyCredentialSet],
|
|
1035
|
-
id: "spotify.check-saved-shows",
|
|
1036
|
-
name: "Check Saved Shows",
|
|
1037
|
-
description: "Check whether shows are saved in the connected Spotify account library.",
|
|
1038
|
-
input: savedItemIdsInputSchema$11,
|
|
1039
|
-
output: spotifyBooleanListSchema,
|
|
1040
|
-
run: async (input, context) => {
|
|
1041
|
-
const credentials = context.credentials.spotify;
|
|
1042
|
-
return createSpotifyClient(credentials).library.checkSavedShows(input.ids);
|
|
1043
|
-
}
|
|
1044
|
-
});
|
|
1045
|
-
|
|
1046
|
-
//#endregion
|
|
1047
|
-
//#region src/operations/check-saved-tracks.operation.ts
|
|
1048
|
-
z.object({
|
|
1049
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1050
|
-
offset: z.number().int().nonnegative().optional()
|
|
1051
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
1052
|
-
const savedItemIdsInputSchema$10 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
1053
|
-
const checkSavedTracksOperation = new Operation({
|
|
1054
|
-
credentialSets: [spotifyCredentialSet],
|
|
1055
|
-
id: "spotify.check-saved-tracks",
|
|
1056
|
-
name: "Check Saved Tracks",
|
|
1057
|
-
description: "Check whether tracks are saved in the connected Spotify account library.",
|
|
1058
|
-
input: savedItemIdsInputSchema$10,
|
|
1059
|
-
output: spotifyBooleanListSchema,
|
|
1060
|
-
run: async (input, context) => {
|
|
1061
|
-
const credentials = context.credentials.spotify;
|
|
1062
|
-
return createSpotifyClient(credentials).library.checkSavedTracks(input.ids);
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
|
|
1066
|
-
//#endregion
|
|
1067
|
-
//#region src/operations/check-spotify-following-artists-or-users.operation.ts
|
|
1068
|
-
const followTypeSchema$3 = z.enum(["artist", "user"]);
|
|
1069
|
-
const followIdsSchema$3 = z.array(spotifyIdSchema).min(1).max(50);
|
|
1070
|
-
createSpotifyCursorPageSchema(spotifyArtistSchema);
|
|
1071
|
-
z.object({
|
|
1072
|
-
after: z.string().min(1).optional(),
|
|
1073
|
-
limit: z.number().int().min(1).max(50).optional()
|
|
1074
|
-
});
|
|
1075
|
-
const followMutationInputSchema$2 = z.object({
|
|
1076
|
-
type: followTypeSchema$3,
|
|
1077
|
-
ids: followIdsSchema$3
|
|
1078
|
-
});
|
|
1079
|
-
const checkFollowingArtistsOrUsersOperation = new Operation({
|
|
1080
|
-
credentialSets: [spotifyCredentialSet],
|
|
1081
|
-
id: "spotify.check-spotify-following-artists-or-users",
|
|
1082
|
-
name: "Check Following Spotify Artists Or Users",
|
|
1083
|
-
description: "Check whether the current Spotify user follows the given artists or users.",
|
|
1084
|
-
input: followMutationInputSchema$2,
|
|
1085
|
-
output: spotifyBooleanListSchema,
|
|
1086
|
-
run: async (input, context) => {
|
|
1087
|
-
const credentials = context.credentials.spotify;
|
|
1088
|
-
return createSpotifyClient(credentials).follow.checkFollowingArtistsOrUsers(input.type, input.ids);
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
|
|
1092
|
-
//#endregion
|
|
1093
|
-
//#region src/operations/check-users-follow-playlist.operation.ts
|
|
1094
|
-
const playlistPaginationInputSchema$12 = z.object({
|
|
1095
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1096
|
-
offset: z.number().int().nonnegative().optional()
|
|
1097
|
-
});
|
|
1098
|
-
const playlistIdInputSchema$12 = z.object({ playlistId: spotifyIdSchema });
|
|
1099
|
-
const playlistAdditionalTypeSchema$12 = z.enum(["track", "episode"]);
|
|
1100
|
-
z.object({
|
|
1101
|
-
name: z.string().trim().min(1),
|
|
1102
|
-
public: z.boolean().optional(),
|
|
1103
|
-
collaborative: z.boolean().optional(),
|
|
1104
|
-
description: z.string().optional()
|
|
1105
|
-
});
|
|
1106
|
-
const getPlaylistInputSchema$12 = playlistIdInputSchema$12.extend({
|
|
1107
|
-
market: spotifyMarketSchema.optional(),
|
|
1108
|
-
fields: z.string().trim().min(1).optional(),
|
|
1109
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$12).min(1).optional()
|
|
1110
|
-
});
|
|
1111
|
-
playlistIdInputSchema$12.extend({
|
|
1112
|
-
name: z.string().trim().min(1).optional(),
|
|
1113
|
-
public: z.boolean().optional(),
|
|
1114
|
-
collaborative: z.boolean().optional(),
|
|
1115
|
-
description: z.string().optional()
|
|
1116
|
-
});
|
|
1117
|
-
getPlaylistInputSchema$12.extend({
|
|
1118
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
1119
|
-
offset: z.number().int().nonnegative().optional()
|
|
1120
|
-
});
|
|
1121
|
-
playlistIdInputSchema$12.extend({
|
|
1122
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
1123
|
-
position: z.number().int().nonnegative().optional()
|
|
1124
|
-
});
|
|
1125
|
-
playlistIdInputSchema$12.extend({
|
|
1126
|
-
mode: z.literal("reorder"),
|
|
1127
|
-
rangeStart: z.number().int().nonnegative(),
|
|
1128
|
-
insertBefore: z.number().int().nonnegative(),
|
|
1129
|
-
rangeLength: z.number().int().positive().optional(),
|
|
1130
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1131
|
-
});
|
|
1132
|
-
playlistIdInputSchema$12.extend({
|
|
1133
|
-
mode: z.literal("replace"),
|
|
1134
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
1135
|
-
});
|
|
1136
|
-
const playlistTrackRemovalSchema$12 = z.object({
|
|
1137
|
-
uri: spotifyUriSchema,
|
|
1138
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
1139
|
-
});
|
|
1140
|
-
playlistIdInputSchema$12.extend({
|
|
1141
|
-
tracks: z.array(playlistTrackRemovalSchema$12).min(1).max(100),
|
|
1142
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1143
|
-
});
|
|
1144
|
-
playlistPaginationInputSchema$12.extend({ userId: spotifyIdSchema });
|
|
1145
|
-
playlistIdInputSchema$12.extend({ public: z.boolean().optional() });
|
|
1146
|
-
const checkUsersFollowPlaylistInputSchema = playlistIdInputSchema$12.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
1147
|
-
playlistIdInputSchema$12.extend({ imageBase64: z.string().trim().min(1) });
|
|
1148
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
1149
|
-
const checkUsersFollowPlaylistOperation = new Operation({
|
|
1150
|
-
credentialSets: [spotifyCredentialSet],
|
|
1151
|
-
id: "spotify.check-users-follow-playlist",
|
|
1152
|
-
name: "Check Users Follow Playlist",
|
|
1153
|
-
description: "Check whether specific Spotify users follow a playlist.",
|
|
1154
|
-
input: checkUsersFollowPlaylistInputSchema,
|
|
1155
|
-
output: spotifyBooleanListSchema,
|
|
1156
|
-
run: async (input, context) => {
|
|
1157
|
-
const credentials = context.credentials.spotify;
|
|
1158
|
-
return createSpotifyClient(credentials).playlists.checkUsersFollowPlaylist(input.playlistId, input.userIds);
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
|
|
1162
|
-
//#endregion
|
|
1163
|
-
//#region src/operations/create-playlist.operation.ts
|
|
1164
|
-
const playlistPaginationInputSchema$11 = z.object({
|
|
1165
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1166
|
-
offset: z.number().int().nonnegative().optional()
|
|
1167
|
-
});
|
|
1168
|
-
const playlistIdInputSchema$11 = z.object({ playlistId: spotifyIdSchema });
|
|
1169
|
-
const playlistAdditionalTypeSchema$11 = z.enum(["track", "episode"]);
|
|
1170
|
-
const createPlaylistInputSchema = z.object({
|
|
1171
|
-
name: z.string().trim().min(1),
|
|
1172
|
-
public: z.boolean().optional(),
|
|
1173
|
-
collaborative: z.boolean().optional(),
|
|
1174
|
-
description: z.string().optional()
|
|
1175
|
-
});
|
|
1176
|
-
const getPlaylistInputSchema$11 = playlistIdInputSchema$11.extend({
|
|
1177
|
-
market: spotifyMarketSchema.optional(),
|
|
1178
|
-
fields: z.string().trim().min(1).optional(),
|
|
1179
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$11).min(1).optional()
|
|
1180
|
-
});
|
|
1181
|
-
playlistIdInputSchema$11.extend({
|
|
1182
|
-
name: z.string().trim().min(1).optional(),
|
|
1183
|
-
public: z.boolean().optional(),
|
|
1184
|
-
collaborative: z.boolean().optional(),
|
|
1185
|
-
description: z.string().optional()
|
|
1186
|
-
});
|
|
1187
|
-
getPlaylistInputSchema$11.extend({
|
|
1188
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
1189
|
-
offset: z.number().int().nonnegative().optional()
|
|
1190
|
-
});
|
|
1191
|
-
playlistIdInputSchema$11.extend({
|
|
1192
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
1193
|
-
position: z.number().int().nonnegative().optional()
|
|
1194
|
-
});
|
|
1195
|
-
playlistIdInputSchema$11.extend({
|
|
1196
|
-
mode: z.literal("reorder"),
|
|
1197
|
-
rangeStart: z.number().int().nonnegative(),
|
|
1198
|
-
insertBefore: z.number().int().nonnegative(),
|
|
1199
|
-
rangeLength: z.number().int().positive().optional(),
|
|
1200
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1201
|
-
});
|
|
1202
|
-
playlistIdInputSchema$11.extend({
|
|
1203
|
-
mode: z.literal("replace"),
|
|
1204
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
1205
|
-
});
|
|
1206
|
-
const playlistTrackRemovalSchema$11 = z.object({
|
|
1207
|
-
uri: spotifyUriSchema,
|
|
1208
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
1209
|
-
});
|
|
1210
|
-
playlistIdInputSchema$11.extend({
|
|
1211
|
-
tracks: z.array(playlistTrackRemovalSchema$11).min(1).max(100),
|
|
1212
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1213
|
-
});
|
|
1214
|
-
playlistPaginationInputSchema$11.extend({ userId: spotifyIdSchema });
|
|
1215
|
-
playlistIdInputSchema$11.extend({ public: z.boolean().optional() });
|
|
1216
|
-
playlistIdInputSchema$11.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
1217
|
-
playlistIdInputSchema$11.extend({ imageBase64: z.string().trim().min(1) });
|
|
1218
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
1219
|
-
const createPlaylistOperation = new Operation({
|
|
1220
|
-
credentialSets: [spotifyCredentialSet],
|
|
1221
|
-
id: "spotify.create-playlist",
|
|
1222
|
-
name: "Create Playlist",
|
|
1223
|
-
description: "Create a Spotify playlist for the connected account.",
|
|
1224
|
-
input: createPlaylistInputSchema,
|
|
1225
|
-
output: spotifyPlaylistSchema,
|
|
1226
|
-
needsApproval: true,
|
|
1227
|
-
run: async (input, context) => {
|
|
1228
|
-
const credentials = context.credentials.spotify;
|
|
1229
|
-
return createSpotifyClient(credentials).playlists.createPlaylist(input);
|
|
1230
|
-
}
|
|
1231
|
-
});
|
|
1232
|
-
|
|
1233
|
-
//#endregion
|
|
1234
|
-
//#region src/operations/follow-playlist.operation.ts
|
|
1235
|
-
const playlistPaginationInputSchema$10 = z.object({
|
|
1236
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1237
|
-
offset: z.number().int().nonnegative().optional()
|
|
1238
|
-
});
|
|
1239
|
-
const playlistIdInputSchema$10 = z.object({ playlistId: spotifyIdSchema });
|
|
1240
|
-
const playlistAdditionalTypeSchema$10 = z.enum(["track", "episode"]);
|
|
1241
|
-
z.object({
|
|
1242
|
-
name: z.string().trim().min(1),
|
|
1243
|
-
public: z.boolean().optional(),
|
|
1244
|
-
collaborative: z.boolean().optional(),
|
|
1245
|
-
description: z.string().optional()
|
|
1246
|
-
});
|
|
1247
|
-
const getPlaylistInputSchema$10 = playlistIdInputSchema$10.extend({
|
|
1248
|
-
market: spotifyMarketSchema.optional(),
|
|
1249
|
-
fields: z.string().trim().min(1).optional(),
|
|
1250
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$10).min(1).optional()
|
|
1251
|
-
});
|
|
1252
|
-
playlistIdInputSchema$10.extend({
|
|
1253
|
-
name: z.string().trim().min(1).optional(),
|
|
1254
|
-
public: z.boolean().optional(),
|
|
1255
|
-
collaborative: z.boolean().optional(),
|
|
1256
|
-
description: z.string().optional()
|
|
1257
|
-
});
|
|
1258
|
-
getPlaylistInputSchema$10.extend({
|
|
1259
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
1260
|
-
offset: z.number().int().nonnegative().optional()
|
|
1261
|
-
});
|
|
1262
|
-
playlistIdInputSchema$10.extend({
|
|
1263
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
1264
|
-
position: z.number().int().nonnegative().optional()
|
|
1265
|
-
});
|
|
1266
|
-
playlistIdInputSchema$10.extend({
|
|
1267
|
-
mode: z.literal("reorder"),
|
|
1268
|
-
rangeStart: z.number().int().nonnegative(),
|
|
1269
|
-
insertBefore: z.number().int().nonnegative(),
|
|
1270
|
-
rangeLength: z.number().int().positive().optional(),
|
|
1271
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1272
|
-
});
|
|
1273
|
-
playlistIdInputSchema$10.extend({
|
|
1274
|
-
mode: z.literal("replace"),
|
|
1275
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
1276
|
-
});
|
|
1277
|
-
const playlistTrackRemovalSchema$10 = z.object({
|
|
1278
|
-
uri: spotifyUriSchema,
|
|
1279
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
1280
|
-
});
|
|
1281
|
-
playlistIdInputSchema$10.extend({
|
|
1282
|
-
tracks: z.array(playlistTrackRemovalSchema$10).min(1).max(100),
|
|
1283
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1284
|
-
});
|
|
1285
|
-
playlistPaginationInputSchema$10.extend({ userId: spotifyIdSchema });
|
|
1286
|
-
const followPlaylistInputSchema = playlistIdInputSchema$10.extend({ public: z.boolean().optional() });
|
|
1287
|
-
playlistIdInputSchema$10.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
1288
|
-
playlistIdInputSchema$10.extend({ imageBase64: z.string().trim().min(1) });
|
|
1289
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
1290
|
-
const followPlaylistOperation = new Operation({
|
|
1291
|
-
credentialSets: [spotifyCredentialSet],
|
|
1292
|
-
id: "spotify.follow-playlist",
|
|
1293
|
-
name: "Follow Playlist",
|
|
1294
|
-
description: "Follow a Spotify playlist for the connected account.",
|
|
1295
|
-
input: followPlaylistInputSchema,
|
|
1296
|
-
output: spotifyMutationSuccessSchema,
|
|
1297
|
-
needsApproval: true,
|
|
1298
|
-
run: async (input, context) => {
|
|
1299
|
-
const credentials = context.credentials.spotify;
|
|
1300
|
-
return createSpotifyClient(credentials).playlists.followPlaylist(input.playlistId, { public: input.public });
|
|
1301
|
-
}
|
|
1302
|
-
});
|
|
1303
|
-
|
|
1304
|
-
//#endregion
|
|
1305
|
-
//#region src/operations/follow-spotify-artists-or-users.operation.ts
|
|
1306
|
-
const followTypeSchema$2 = z.enum(["artist", "user"]);
|
|
1307
|
-
const followIdsSchema$2 = z.array(spotifyIdSchema).min(1).max(50);
|
|
1308
|
-
createSpotifyCursorPageSchema(spotifyArtistSchema);
|
|
1309
|
-
z.object({
|
|
1310
|
-
after: z.string().min(1).optional(),
|
|
1311
|
-
limit: z.number().int().min(1).max(50).optional()
|
|
1312
|
-
});
|
|
1313
|
-
const followMutationInputSchema$1 = z.object({
|
|
1314
|
-
type: followTypeSchema$2,
|
|
1315
|
-
ids: followIdsSchema$2
|
|
1316
|
-
});
|
|
1317
|
-
const followArtistsOrUsersOperation = new Operation({
|
|
1318
|
-
credentialSets: [spotifyCredentialSet],
|
|
1319
|
-
id: "spotify.follow-spotify-artists-or-users",
|
|
1320
|
-
name: "Follow Spotify Artists Or Users",
|
|
1321
|
-
description: "Follow Spotify artists or users for the current account.",
|
|
1322
|
-
needsApproval: true,
|
|
1323
|
-
input: followMutationInputSchema$1,
|
|
1324
|
-
output: spotifyMutationSuccessSchema,
|
|
1325
|
-
run: async (input, context) => {
|
|
1326
|
-
const credentials = context.credentials.spotify;
|
|
1327
|
-
return createSpotifyClient(credentials).follow.followArtistsOrUsers(input.type, input.ids);
|
|
1328
|
-
}
|
|
1329
|
-
});
|
|
1330
|
-
|
|
1331
|
-
//#endregion
|
|
1332
|
-
//#region src/operations/get-available-devices.operation.ts
|
|
1333
|
-
const emptyInputSchema$2 = z.object({});
|
|
1334
|
-
const playbackTypesSchema$13 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
1335
|
-
const deviceIdSchema$13 = spotifyIdSchema.optional();
|
|
1336
|
-
z.object({
|
|
1337
|
-
market: spotifyMarketSchema.optional(),
|
|
1338
|
-
additionalTypes: playbackTypesSchema$13
|
|
1339
|
-
});
|
|
1340
|
-
z.object({
|
|
1341
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
1342
|
-
play: z.boolean().optional()
|
|
1343
|
-
});
|
|
1344
|
-
const playbackOffsetSchema$13 = z.object({
|
|
1345
|
-
position: z.number().int().nonnegative().optional(),
|
|
1346
|
-
uri: spotifyUriSchema.optional()
|
|
1347
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
1348
|
-
z.object({
|
|
1349
|
-
deviceId: deviceIdSchema$13,
|
|
1350
|
-
contextUri: spotifyUriSchema.optional(),
|
|
1351
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
1352
|
-
offset: playbackOffsetSchema$13.optional(),
|
|
1353
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
1354
|
-
});
|
|
1355
|
-
const withOptionalDeviceIdSchema$13 = z.object({ deviceId: deviceIdSchema$13 });
|
|
1356
|
-
withOptionalDeviceIdSchema$13.extend({ positionMs: z.number().int().nonnegative() });
|
|
1357
|
-
withOptionalDeviceIdSchema$13.extend({ state: z.enum([
|
|
1358
|
-
"track",
|
|
1359
|
-
"context",
|
|
1360
|
-
"off"
|
|
1361
|
-
]) });
|
|
1362
|
-
withOptionalDeviceIdSchema$13.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
1363
|
-
withOptionalDeviceIdSchema$13.extend({ state: z.boolean() });
|
|
1364
|
-
z.object({
|
|
1365
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1366
|
-
after: z.number().int().nonnegative().optional(),
|
|
1367
|
-
before: z.number().int().nonnegative().optional()
|
|
1368
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
1369
|
-
withOptionalDeviceIdSchema$13.extend({ uri: spotifyUriSchema });
|
|
1370
|
-
const availableDevicesResponseSchema = z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
1371
|
-
const getAvailableDevicesOperation = new Operation({
|
|
1372
|
-
credentialSets: [spotifyCredentialSet],
|
|
1373
|
-
id: "spotify.get-available-devices",
|
|
1374
|
-
name: "Get Available Devices",
|
|
1375
|
-
description: "List Spotify devices available for playback.",
|
|
1376
|
-
input: emptyInputSchema$2,
|
|
1377
|
-
output: availableDevicesResponseSchema,
|
|
1378
|
-
run: async (_input, context) => {
|
|
1379
|
-
const credentials = context.credentials.spotify;
|
|
1380
|
-
return createSpotifyClient(credentials).player.getAvailableDevices();
|
|
1381
|
-
}
|
|
1382
|
-
});
|
|
1383
|
-
|
|
1384
|
-
//#endregion
|
|
1385
|
-
//#region src/operations/get-currently-playing.operation.ts
|
|
1386
|
-
z.object({});
|
|
1387
|
-
const playbackTypesSchema$12 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
1388
|
-
const deviceIdSchema$12 = spotifyIdSchema.optional();
|
|
1389
|
-
const currentlyPlayingInputSchema = z.object({
|
|
1390
|
-
market: spotifyMarketSchema.optional(),
|
|
1391
|
-
additionalTypes: playbackTypesSchema$12
|
|
1392
|
-
});
|
|
1393
|
-
z.object({
|
|
1394
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
1395
|
-
play: z.boolean().optional()
|
|
1396
|
-
});
|
|
1397
|
-
const playbackOffsetSchema$12 = z.object({
|
|
1398
|
-
position: z.number().int().nonnegative().optional(),
|
|
1399
|
-
uri: spotifyUriSchema.optional()
|
|
1400
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
1401
|
-
z.object({
|
|
1402
|
-
deviceId: deviceIdSchema$12,
|
|
1403
|
-
contextUri: spotifyUriSchema.optional(),
|
|
1404
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
1405
|
-
offset: playbackOffsetSchema$12.optional(),
|
|
1406
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
1407
|
-
});
|
|
1408
|
-
const withOptionalDeviceIdSchema$12 = z.object({ deviceId: deviceIdSchema$12 });
|
|
1409
|
-
withOptionalDeviceIdSchema$12.extend({ positionMs: z.number().int().nonnegative() });
|
|
1410
|
-
withOptionalDeviceIdSchema$12.extend({ state: z.enum([
|
|
1411
|
-
"track",
|
|
1412
|
-
"context",
|
|
1413
|
-
"off"
|
|
1414
|
-
]) });
|
|
1415
|
-
withOptionalDeviceIdSchema$12.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
1416
|
-
withOptionalDeviceIdSchema$12.extend({ state: z.boolean() });
|
|
1417
|
-
z.object({
|
|
1418
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1419
|
-
after: z.number().int().nonnegative().optional(),
|
|
1420
|
-
before: z.number().int().nonnegative().optional()
|
|
1421
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
1422
|
-
withOptionalDeviceIdSchema$12.extend({ uri: spotifyUriSchema });
|
|
1423
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
1424
|
-
const getCurrentlyPlayingOperation = new Operation({
|
|
1425
|
-
credentialSets: [spotifyCredentialSet],
|
|
1426
|
-
id: "spotify.get-currently-playing",
|
|
1427
|
-
name: "Get Currently Playing",
|
|
1428
|
-
description: "Fetch the currently playing Spotify track or episode, if any.",
|
|
1429
|
-
input: currentlyPlayingInputSchema,
|
|
1430
|
-
output: spotifyPlaybackStateSchema.nullable(),
|
|
1431
|
-
run: async (input, context) => {
|
|
1432
|
-
const credentials = context.credentials.spotify;
|
|
1433
|
-
return createSpotifyClient(credentials).player.getCurrentlyPlaying({
|
|
1434
|
-
market: input.market,
|
|
1435
|
-
additional_types: input.additionalTypes
|
|
1436
|
-
});
|
|
1437
|
-
}
|
|
1438
|
-
});
|
|
1439
|
-
|
|
1440
|
-
//#endregion
|
|
1441
|
-
//#region src/operations/get-playback-state.operation.ts
|
|
1442
|
-
z.object({});
|
|
1443
|
-
const playbackTypesSchema$11 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
1444
|
-
const deviceIdSchema$11 = spotifyIdSchema.optional();
|
|
1445
|
-
z.object({
|
|
1446
|
-
market: spotifyMarketSchema.optional(),
|
|
1447
|
-
additionalTypes: playbackTypesSchema$11
|
|
1448
|
-
});
|
|
1449
|
-
z.object({
|
|
1450
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
1451
|
-
play: z.boolean().optional()
|
|
1452
|
-
});
|
|
1453
|
-
const playbackOffsetSchema$11 = z.object({
|
|
1454
|
-
position: z.number().int().nonnegative().optional(),
|
|
1455
|
-
uri: spotifyUriSchema.optional()
|
|
1456
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
1457
|
-
z.object({
|
|
1458
|
-
deviceId: deviceIdSchema$11,
|
|
1459
|
-
contextUri: spotifyUriSchema.optional(),
|
|
1460
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
1461
|
-
offset: playbackOffsetSchema$11.optional(),
|
|
1462
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
1463
|
-
});
|
|
1464
|
-
const withOptionalDeviceIdSchema$11 = z.object({ deviceId: deviceIdSchema$11 });
|
|
1465
|
-
withOptionalDeviceIdSchema$11.extend({ positionMs: z.number().int().nonnegative() });
|
|
1466
|
-
withOptionalDeviceIdSchema$11.extend({ state: z.enum([
|
|
1467
|
-
"track",
|
|
1468
|
-
"context",
|
|
1469
|
-
"off"
|
|
1470
|
-
]) });
|
|
1471
|
-
withOptionalDeviceIdSchema$11.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
1472
|
-
withOptionalDeviceIdSchema$11.extend({ state: z.boolean() });
|
|
1473
|
-
z.object({
|
|
1474
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1475
|
-
after: z.number().int().nonnegative().optional(),
|
|
1476
|
-
before: z.number().int().nonnegative().optional()
|
|
1477
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
1478
|
-
withOptionalDeviceIdSchema$11.extend({ uri: spotifyUriSchema });
|
|
1479
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
1480
|
-
const getPlaybackStateOperation = new Operation({
|
|
1481
|
-
credentialSets: [spotifyCredentialSet],
|
|
1482
|
-
id: "spotify.get-playback-state",
|
|
1483
|
-
name: "Get Playback State",
|
|
1484
|
-
description: "Fetch the current Spotify playback state for the connected account.",
|
|
1485
|
-
input: z.object({ market: spotifyMarketSchema.optional() }),
|
|
1486
|
-
output: spotifyPlaybackStateSchema.nullable(),
|
|
1487
|
-
run: async (input, context) => {
|
|
1488
|
-
const credentials = context.credentials.spotify;
|
|
1489
|
-
return createSpotifyClient(credentials).player.getPlaybackState(input.market);
|
|
1490
|
-
}
|
|
1491
|
-
});
|
|
1492
|
-
|
|
1493
|
-
//#endregion
|
|
1494
|
-
//#region src/operations/get-playlist.operation.ts
|
|
1495
|
-
const playlistPaginationInputSchema$9 = z.object({
|
|
1496
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1497
|
-
offset: z.number().int().nonnegative().optional()
|
|
1498
|
-
});
|
|
1499
|
-
const playlistIdInputSchema$9 = z.object({ playlistId: spotifyIdSchema });
|
|
1500
|
-
const playlistAdditionalTypeSchema$9 = z.enum(["track", "episode"]);
|
|
1501
|
-
z.object({
|
|
1502
|
-
name: z.string().trim().min(1),
|
|
1503
|
-
public: z.boolean().optional(),
|
|
1504
|
-
collaborative: z.boolean().optional(),
|
|
1505
|
-
description: z.string().optional()
|
|
1506
|
-
});
|
|
1507
|
-
const getPlaylistInputSchema$9 = playlistIdInputSchema$9.extend({
|
|
1508
|
-
market: spotifyMarketSchema.optional(),
|
|
1509
|
-
fields: z.string().trim().min(1).optional(),
|
|
1510
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$9).min(1).optional()
|
|
1511
|
-
});
|
|
1512
|
-
playlistIdInputSchema$9.extend({
|
|
1513
|
-
name: z.string().trim().min(1).optional(),
|
|
1514
|
-
public: z.boolean().optional(),
|
|
1515
|
-
collaborative: z.boolean().optional(),
|
|
1516
|
-
description: z.string().optional()
|
|
1517
|
-
});
|
|
1518
|
-
getPlaylistInputSchema$9.extend({
|
|
1519
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
1520
|
-
offset: z.number().int().nonnegative().optional()
|
|
1521
|
-
});
|
|
1522
|
-
playlistIdInputSchema$9.extend({
|
|
1523
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
1524
|
-
position: z.number().int().nonnegative().optional()
|
|
1525
|
-
});
|
|
1526
|
-
playlistIdInputSchema$9.extend({
|
|
1527
|
-
mode: z.literal("reorder"),
|
|
1528
|
-
rangeStart: z.number().int().nonnegative(),
|
|
1529
|
-
insertBefore: z.number().int().nonnegative(),
|
|
1530
|
-
rangeLength: z.number().int().positive().optional(),
|
|
1531
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1532
|
-
});
|
|
1533
|
-
playlistIdInputSchema$9.extend({
|
|
1534
|
-
mode: z.literal("replace"),
|
|
1535
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
1536
|
-
});
|
|
1537
|
-
const playlistTrackRemovalSchema$9 = z.object({
|
|
1538
|
-
uri: spotifyUriSchema,
|
|
1539
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
1540
|
-
});
|
|
1541
|
-
playlistIdInputSchema$9.extend({
|
|
1542
|
-
tracks: z.array(playlistTrackRemovalSchema$9).min(1).max(100),
|
|
1543
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1544
|
-
});
|
|
1545
|
-
playlistPaginationInputSchema$9.extend({ userId: spotifyIdSchema });
|
|
1546
|
-
playlistIdInputSchema$9.extend({ public: z.boolean().optional() });
|
|
1547
|
-
playlistIdInputSchema$9.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
1548
|
-
playlistIdInputSchema$9.extend({ imageBase64: z.string().trim().min(1) });
|
|
1549
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
1550
|
-
const getPlaylistOperation = new Operation({
|
|
1551
|
-
credentialSets: [spotifyCredentialSet],
|
|
1552
|
-
id: "spotify.get-playlist",
|
|
1553
|
-
name: "Get Playlist",
|
|
1554
|
-
description: "Fetch a Spotify playlist by ID.",
|
|
1555
|
-
input: getPlaylistInputSchema$9,
|
|
1556
|
-
output: spotifyPlaylistSchema,
|
|
1557
|
-
run: async (input, context) => {
|
|
1558
|
-
const credentials = context.credentials.spotify;
|
|
1559
|
-
return createSpotifyClient(credentials).playlists.getPlaylist(input.playlistId, {
|
|
1560
|
-
market: input.market,
|
|
1561
|
-
fields: input.fields,
|
|
1562
|
-
additional_types: input.additionalTypes
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
});
|
|
1566
|
-
|
|
1567
|
-
//#endregion
|
|
1568
|
-
//#region src/operations/get-playlist-cover-image.operation.ts
|
|
1569
|
-
const playlistPaginationInputSchema$8 = z.object({
|
|
1570
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1571
|
-
offset: z.number().int().nonnegative().optional()
|
|
1572
|
-
});
|
|
1573
|
-
const playlistIdInputSchema$8 = z.object({ playlistId: spotifyIdSchema });
|
|
1574
|
-
const playlistAdditionalTypeSchema$8 = z.enum(["track", "episode"]);
|
|
1575
|
-
z.object({
|
|
1576
|
-
name: z.string().trim().min(1),
|
|
1577
|
-
public: z.boolean().optional(),
|
|
1578
|
-
collaborative: z.boolean().optional(),
|
|
1579
|
-
description: z.string().optional()
|
|
1580
|
-
});
|
|
1581
|
-
const getPlaylistInputSchema$8 = playlistIdInputSchema$8.extend({
|
|
1582
|
-
market: spotifyMarketSchema.optional(),
|
|
1583
|
-
fields: z.string().trim().min(1).optional(),
|
|
1584
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$8).min(1).optional()
|
|
1585
|
-
});
|
|
1586
|
-
playlistIdInputSchema$8.extend({
|
|
1587
|
-
name: z.string().trim().min(1).optional(),
|
|
1588
|
-
public: z.boolean().optional(),
|
|
1589
|
-
collaborative: z.boolean().optional(),
|
|
1590
|
-
description: z.string().optional()
|
|
1591
|
-
});
|
|
1592
|
-
getPlaylistInputSchema$8.extend({
|
|
1593
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
1594
|
-
offset: z.number().int().nonnegative().optional()
|
|
1595
|
-
});
|
|
1596
|
-
playlistIdInputSchema$8.extend({
|
|
1597
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
1598
|
-
position: z.number().int().nonnegative().optional()
|
|
1599
|
-
});
|
|
1600
|
-
playlistIdInputSchema$8.extend({
|
|
1601
|
-
mode: z.literal("reorder"),
|
|
1602
|
-
rangeStart: z.number().int().nonnegative(),
|
|
1603
|
-
insertBefore: z.number().int().nonnegative(),
|
|
1604
|
-
rangeLength: z.number().int().positive().optional(),
|
|
1605
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1606
|
-
});
|
|
1607
|
-
playlistIdInputSchema$8.extend({
|
|
1608
|
-
mode: z.literal("replace"),
|
|
1609
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
1610
|
-
});
|
|
1611
|
-
const playlistTrackRemovalSchema$8 = z.object({
|
|
1612
|
-
uri: spotifyUriSchema,
|
|
1613
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
1614
|
-
});
|
|
1615
|
-
playlistIdInputSchema$8.extend({
|
|
1616
|
-
tracks: z.array(playlistTrackRemovalSchema$8).min(1).max(100),
|
|
1617
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1618
|
-
});
|
|
1619
|
-
playlistPaginationInputSchema$8.extend({ userId: spotifyIdSchema });
|
|
1620
|
-
playlistIdInputSchema$8.extend({ public: z.boolean().optional() });
|
|
1621
|
-
playlistIdInputSchema$8.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
1622
|
-
playlistIdInputSchema$8.extend({ imageBase64: z.string().trim().min(1) });
|
|
1623
|
-
const playlistCoverImageResponseSchema = z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
1624
|
-
const getPlaylistCoverImageOperation = new Operation({
|
|
1625
|
-
credentialSets: [spotifyCredentialSet],
|
|
1626
|
-
id: "spotify.get-playlist-cover-image",
|
|
1627
|
-
name: "Get Playlist Cover Image",
|
|
1628
|
-
description: "Fetch cover images for a Spotify playlist.",
|
|
1629
|
-
input: playlistIdInputSchema$8,
|
|
1630
|
-
output: playlistCoverImageResponseSchema,
|
|
1631
|
-
run: async (input, context) => {
|
|
1632
|
-
const credentials = context.credentials.spotify;
|
|
1633
|
-
return createSpotifyClient(credentials).playlists.getPlaylistCoverImage(input.playlistId);
|
|
1634
|
-
}
|
|
1635
|
-
});
|
|
1636
|
-
|
|
1637
|
-
//#endregion
|
|
1638
|
-
//#region src/operations/get-playlist-items.operation.ts
|
|
1639
|
-
const playlistPaginationInputSchema$7 = z.object({
|
|
1640
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1641
|
-
offset: z.number().int().nonnegative().optional()
|
|
1642
|
-
});
|
|
1643
|
-
const playlistIdInputSchema$7 = z.object({ playlistId: spotifyIdSchema });
|
|
1644
|
-
const playlistAdditionalTypeSchema$7 = z.enum(["track", "episode"]);
|
|
1645
|
-
z.object({
|
|
1646
|
-
name: z.string().trim().min(1),
|
|
1647
|
-
public: z.boolean().optional(),
|
|
1648
|
-
collaborative: z.boolean().optional(),
|
|
1649
|
-
description: z.string().optional()
|
|
1650
|
-
});
|
|
1651
|
-
const getPlaylistInputSchema$7 = playlistIdInputSchema$7.extend({
|
|
1652
|
-
market: spotifyMarketSchema.optional(),
|
|
1653
|
-
fields: z.string().trim().min(1).optional(),
|
|
1654
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$7).min(1).optional()
|
|
1655
|
-
});
|
|
1656
|
-
playlistIdInputSchema$7.extend({
|
|
1657
|
-
name: z.string().trim().min(1).optional(),
|
|
1658
|
-
public: z.boolean().optional(),
|
|
1659
|
-
collaborative: z.boolean().optional(),
|
|
1660
|
-
description: z.string().optional()
|
|
1661
|
-
});
|
|
1662
|
-
const getPlaylistItemsInputSchema = getPlaylistInputSchema$7.extend({
|
|
1663
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
1664
|
-
offset: z.number().int().nonnegative().optional()
|
|
1665
|
-
});
|
|
1666
|
-
playlistIdInputSchema$7.extend({
|
|
1667
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
1668
|
-
position: z.number().int().nonnegative().optional()
|
|
1669
|
-
});
|
|
1670
|
-
playlistIdInputSchema$7.extend({
|
|
1671
|
-
mode: z.literal("reorder"),
|
|
1672
|
-
rangeStart: z.number().int().nonnegative(),
|
|
1673
|
-
insertBefore: z.number().int().nonnegative(),
|
|
1674
|
-
rangeLength: z.number().int().positive().optional(),
|
|
1675
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1676
|
-
});
|
|
1677
|
-
playlistIdInputSchema$7.extend({
|
|
1678
|
-
mode: z.literal("replace"),
|
|
1679
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
1680
|
-
});
|
|
1681
|
-
const playlistTrackRemovalSchema$7 = z.object({
|
|
1682
|
-
uri: spotifyUriSchema,
|
|
1683
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
1684
|
-
});
|
|
1685
|
-
playlistIdInputSchema$7.extend({
|
|
1686
|
-
tracks: z.array(playlistTrackRemovalSchema$7).min(1).max(100),
|
|
1687
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
1688
|
-
});
|
|
1689
|
-
playlistPaginationInputSchema$7.extend({ userId: spotifyIdSchema });
|
|
1690
|
-
playlistIdInputSchema$7.extend({ public: z.boolean().optional() });
|
|
1691
|
-
playlistIdInputSchema$7.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
1692
|
-
playlistIdInputSchema$7.extend({ imageBase64: z.string().trim().min(1) });
|
|
1693
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
1694
|
-
const getPlaylistItemsOperation = new Operation({
|
|
1695
|
-
credentialSets: [spotifyCredentialSet],
|
|
1696
|
-
id: "spotify.get-playlist-items",
|
|
1697
|
-
name: "Get Playlist Items",
|
|
1698
|
-
description: "List tracks and episodes in a Spotify playlist.",
|
|
1699
|
-
input: getPlaylistItemsInputSchema,
|
|
1700
|
-
output: spotifyPlaylistItemPageSchema,
|
|
1701
|
-
run: async (input, context) => {
|
|
1702
|
-
const credentials = context.credentials.spotify;
|
|
1703
|
-
return createSpotifyClient(credentials).playlists.getPlaylistItems(input.playlistId, {
|
|
1704
|
-
market: input.market,
|
|
1705
|
-
fields: input.fields,
|
|
1706
|
-
limit: input.limit,
|
|
1707
|
-
offset: input.offset,
|
|
1708
|
-
additional_types: input.additionalTypes
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
});
|
|
1712
|
-
|
|
1713
|
-
//#endregion
|
|
1714
|
-
//#region src/operations/get-queue.operation.ts
|
|
1715
|
-
const emptyInputSchema$1 = z.object({});
|
|
1716
|
-
const playbackTypesSchema$10 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
1717
|
-
const deviceIdSchema$10 = spotifyIdSchema.optional();
|
|
1718
|
-
z.object({
|
|
1719
|
-
market: spotifyMarketSchema.optional(),
|
|
1720
|
-
additionalTypes: playbackTypesSchema$10
|
|
1721
|
-
});
|
|
1722
|
-
z.object({
|
|
1723
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
1724
|
-
play: z.boolean().optional()
|
|
1725
|
-
});
|
|
1726
|
-
const playbackOffsetSchema$10 = z.object({
|
|
1727
|
-
position: z.number().int().nonnegative().optional(),
|
|
1728
|
-
uri: spotifyUriSchema.optional()
|
|
1729
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
1730
|
-
z.object({
|
|
1731
|
-
deviceId: deviceIdSchema$10,
|
|
1732
|
-
contextUri: spotifyUriSchema.optional(),
|
|
1733
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
1734
|
-
offset: playbackOffsetSchema$10.optional(),
|
|
1735
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
1736
|
-
});
|
|
1737
|
-
const withOptionalDeviceIdSchema$10 = z.object({ deviceId: deviceIdSchema$10 });
|
|
1738
|
-
withOptionalDeviceIdSchema$10.extend({ positionMs: z.number().int().nonnegative() });
|
|
1739
|
-
withOptionalDeviceIdSchema$10.extend({ state: z.enum([
|
|
1740
|
-
"track",
|
|
1741
|
-
"context",
|
|
1742
|
-
"off"
|
|
1743
|
-
]) });
|
|
1744
|
-
withOptionalDeviceIdSchema$10.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
1745
|
-
withOptionalDeviceIdSchema$10.extend({ state: z.boolean() });
|
|
1746
|
-
z.object({
|
|
1747
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1748
|
-
after: z.number().int().nonnegative().optional(),
|
|
1749
|
-
before: z.number().int().nonnegative().optional()
|
|
1750
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
1751
|
-
withOptionalDeviceIdSchema$10.extend({ uri: spotifyUriSchema });
|
|
1752
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
1753
|
-
const getQueueOperation = new Operation({
|
|
1754
|
-
credentialSets: [spotifyCredentialSet],
|
|
1755
|
-
id: "spotify.get-queue",
|
|
1756
|
-
name: "Get Queue",
|
|
1757
|
-
description: "Fetch the current Spotify playback queue.",
|
|
1758
|
-
input: emptyInputSchema$1,
|
|
1759
|
-
output: spotifyQueueSchema,
|
|
1760
|
-
run: async (_input, context) => {
|
|
1761
|
-
const credentials = context.credentials.spotify;
|
|
1762
|
-
return createSpotifyClient(credentials).player.getQueue();
|
|
1763
|
-
}
|
|
1764
|
-
});
|
|
1765
|
-
|
|
1766
|
-
//#endregion
|
|
1767
|
-
//#region src/operations/get-recently-played.operation.ts
|
|
1768
|
-
z.object({});
|
|
1769
|
-
const playbackTypesSchema$9 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
1770
|
-
const deviceIdSchema$9 = spotifyIdSchema.optional();
|
|
1771
|
-
z.object({
|
|
1772
|
-
market: spotifyMarketSchema.optional(),
|
|
1773
|
-
additionalTypes: playbackTypesSchema$9
|
|
1774
|
-
});
|
|
1775
|
-
z.object({
|
|
1776
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
1777
|
-
play: z.boolean().optional()
|
|
1778
|
-
});
|
|
1779
|
-
const playbackOffsetSchema$9 = z.object({
|
|
1780
|
-
position: z.number().int().nonnegative().optional(),
|
|
1781
|
-
uri: spotifyUriSchema.optional()
|
|
1782
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
1783
|
-
z.object({
|
|
1784
|
-
deviceId: deviceIdSchema$9,
|
|
1785
|
-
contextUri: spotifyUriSchema.optional(),
|
|
1786
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
1787
|
-
offset: playbackOffsetSchema$9.optional(),
|
|
1788
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
1789
|
-
});
|
|
1790
|
-
const withOptionalDeviceIdSchema$9 = z.object({ deviceId: deviceIdSchema$9 });
|
|
1791
|
-
withOptionalDeviceIdSchema$9.extend({ positionMs: z.number().int().nonnegative() });
|
|
1792
|
-
withOptionalDeviceIdSchema$9.extend({ state: z.enum([
|
|
1793
|
-
"track",
|
|
1794
|
-
"context",
|
|
1795
|
-
"off"
|
|
1796
|
-
]) });
|
|
1797
|
-
withOptionalDeviceIdSchema$9.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
1798
|
-
withOptionalDeviceIdSchema$9.extend({ state: z.boolean() });
|
|
1799
|
-
const getRecentlyPlayedInputSchema = z.object({
|
|
1800
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1801
|
-
after: z.number().int().nonnegative().optional(),
|
|
1802
|
-
before: z.number().int().nonnegative().optional()
|
|
1803
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
1804
|
-
withOptionalDeviceIdSchema$9.extend({ uri: spotifyUriSchema });
|
|
1805
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
1806
|
-
const getRecentlyPlayedOperation = new Operation({
|
|
1807
|
-
credentialSets: [spotifyCredentialSet],
|
|
1808
|
-
id: "spotify.get-recently-played",
|
|
1809
|
-
name: "Get Recently Played",
|
|
1810
|
-
description: "List recently played Spotify tracks for the connected account.",
|
|
1811
|
-
input: getRecentlyPlayedInputSchema,
|
|
1812
|
-
output: spotifyRecentlyPlayedPageSchema,
|
|
1813
|
-
run: async (input, context) => {
|
|
1814
|
-
const credentials = context.credentials.spotify;
|
|
1815
|
-
return createSpotifyClient(credentials).player.getRecentlyPlayed(input);
|
|
1816
|
-
}
|
|
1817
|
-
});
|
|
1818
|
-
|
|
1819
|
-
//#endregion
|
|
1820
|
-
//#region src/operations/get-spotify-album.operation.ts
|
|
1821
|
-
z.array(spotifyIdSchema).min(1).max(20);
|
|
1822
|
-
z.object({
|
|
1823
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1824
|
-
offset: z.number().int().nonnegative().optional()
|
|
1825
|
-
});
|
|
1826
|
-
z.object({ albums: z.array(spotifyAlbumSchema) });
|
|
1827
|
-
const getAlbumOperation = new Operation({
|
|
1828
|
-
credentialSets: [spotifyCredentialSet],
|
|
1829
|
-
id: "spotify.get-spotify-album",
|
|
1830
|
-
name: "Get Spotify Album",
|
|
1831
|
-
description: "Fetch a Spotify album by its ID.",
|
|
1832
|
-
input: z.object({
|
|
1833
|
-
id: spotifyIdSchema,
|
|
1834
|
-
market: spotifyMarketSchema.optional()
|
|
1835
|
-
}),
|
|
1836
|
-
output: spotifyAlbumSchema,
|
|
1837
|
-
run: async (input, context) => {
|
|
1838
|
-
const credentials = context.credentials.spotify;
|
|
1839
|
-
return createSpotifyClient(credentials).albums.getAlbum(input.id, input.market);
|
|
1840
|
-
}
|
|
1841
|
-
});
|
|
1842
|
-
|
|
1843
|
-
//#endregion
|
|
1844
|
-
//#region src/operations/get-spotify-album-tracks.operation.ts
|
|
1845
|
-
z.array(spotifyIdSchema).min(1).max(20);
|
|
1846
|
-
const pagingSchema$2 = z.object({
|
|
1847
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1848
|
-
offset: z.number().int().nonnegative().optional()
|
|
1849
|
-
});
|
|
1850
|
-
z.object({ albums: z.array(spotifyAlbumSchema) });
|
|
1851
|
-
const getAlbumTracksOperation = new Operation({
|
|
1852
|
-
credentialSets: [spotifyCredentialSet],
|
|
1853
|
-
id: "spotify.get-spotify-album-tracks",
|
|
1854
|
-
name: "Get Spotify Album Tracks",
|
|
1855
|
-
description: "List tracks for a Spotify album.",
|
|
1856
|
-
input: pagingSchema$2.extend({
|
|
1857
|
-
id: spotifyIdSchema,
|
|
1858
|
-
market: spotifyMarketSchema.optional()
|
|
1859
|
-
}),
|
|
1860
|
-
output: spotifyTrackPageSchema,
|
|
1861
|
-
run: async (input, context) => {
|
|
1862
|
-
const credentials = context.credentials.spotify;
|
|
1863
|
-
return createSpotifyClient(credentials).albums.getAlbumTracks(input.id, {
|
|
1864
|
-
market: input.market,
|
|
1865
|
-
limit: input.limit,
|
|
1866
|
-
offset: input.offset
|
|
1867
|
-
});
|
|
1868
|
-
}
|
|
1869
|
-
});
|
|
1870
|
-
|
|
1871
|
-
//#endregion
|
|
1872
|
-
//#region src/operations/get-spotify-artist.operation.ts
|
|
1873
|
-
z.array(spotifyIdSchema).min(1).max(50);
|
|
1874
|
-
z.enum([
|
|
1875
|
-
"album",
|
|
1876
|
-
"single",
|
|
1877
|
-
"appears_on",
|
|
1878
|
-
"compilation"
|
|
1879
|
-
]);
|
|
1880
|
-
z.object({
|
|
1881
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1882
|
-
offset: z.number().int().nonnegative().optional()
|
|
1883
|
-
});
|
|
1884
|
-
z.object({ artists: z.array(spotifyArtistSchema) });
|
|
1885
|
-
z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
1886
|
-
const getArtistOperation = new Operation({
|
|
1887
|
-
credentialSets: [spotifyCredentialSet],
|
|
1888
|
-
id: "spotify.get-spotify-artist",
|
|
1889
|
-
name: "Get Spotify Artist",
|
|
1890
|
-
description: "Fetch a Spotify artist by its ID.",
|
|
1891
|
-
input: z.object({ id: spotifyIdSchema }),
|
|
1892
|
-
output: spotifyArtistSchema,
|
|
1893
|
-
run: async (input, context) => {
|
|
1894
|
-
const credentials = context.credentials.spotify;
|
|
1895
|
-
return createSpotifyClient(credentials).artists.getArtist(input.id);
|
|
1896
|
-
}
|
|
1897
|
-
});
|
|
1898
|
-
|
|
1899
|
-
//#endregion
|
|
1900
|
-
//#region src/operations/get-spotify-artist-albums.operation.ts
|
|
1901
|
-
z.array(spotifyIdSchema).min(1).max(50);
|
|
1902
|
-
const artistAlbumGroupSchema = z.enum([
|
|
1903
|
-
"album",
|
|
1904
|
-
"single",
|
|
1905
|
-
"appears_on",
|
|
1906
|
-
"compilation"
|
|
1907
|
-
]);
|
|
1908
|
-
const pagingSchema$1 = z.object({
|
|
1909
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1910
|
-
offset: z.number().int().nonnegative().optional()
|
|
1911
|
-
});
|
|
1912
|
-
z.object({ artists: z.array(spotifyArtistSchema) });
|
|
1913
|
-
z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
1914
|
-
const getArtistAlbumsOperation = new Operation({
|
|
1915
|
-
credentialSets: [spotifyCredentialSet],
|
|
1916
|
-
id: "spotify.get-spotify-artist-albums",
|
|
1917
|
-
name: "Get Spotify Artist Albums",
|
|
1918
|
-
description: "List albums released by a Spotify artist.",
|
|
1919
|
-
input: pagingSchema$1.extend({
|
|
1920
|
-
id: spotifyIdSchema,
|
|
1921
|
-
includeGroups: z.array(artistAlbumGroupSchema).min(1).optional(),
|
|
1922
|
-
market: spotifyMarketSchema.optional()
|
|
1923
|
-
}),
|
|
1924
|
-
output: spotifyAlbumPageSchema,
|
|
1925
|
-
run: async (input, context) => {
|
|
1926
|
-
const credentials = context.credentials.spotify;
|
|
1927
|
-
return createSpotifyClient(credentials).artists.getArtistAlbums(input.id, {
|
|
1928
|
-
include_groups: input.includeGroups,
|
|
1929
|
-
market: input.market,
|
|
1930
|
-
limit: input.limit,
|
|
1931
|
-
offset: input.offset
|
|
1932
|
-
});
|
|
1933
|
-
}
|
|
1934
|
-
});
|
|
1935
|
-
|
|
1936
|
-
//#endregion
|
|
1937
|
-
//#region src/operations/get-spotify-artist-related-artists.operation.ts
|
|
1938
|
-
z.array(spotifyIdSchema).min(1).max(50);
|
|
1939
|
-
z.enum([
|
|
1940
|
-
"album",
|
|
1941
|
-
"single",
|
|
1942
|
-
"appears_on",
|
|
1943
|
-
"compilation"
|
|
1944
|
-
]);
|
|
1945
|
-
z.object({
|
|
1946
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1947
|
-
offset: z.number().int().nonnegative().optional()
|
|
1948
|
-
});
|
|
1949
|
-
const severalArtistsResponseSchema$1 = z.object({ artists: z.array(spotifyArtistSchema) });
|
|
1950
|
-
z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
1951
|
-
const getArtistRelatedArtistsOperation = new Operation({
|
|
1952
|
-
credentialSets: [spotifyCredentialSet],
|
|
1953
|
-
id: "spotify.get-spotify-artist-related-artists",
|
|
1954
|
-
name: "Get Spotify Artist Related Artists",
|
|
1955
|
-
description: "Fetch artists related to a Spotify artist. Deprecated upstream by Spotify.",
|
|
1956
|
-
input: z.object({ id: spotifyIdSchema }),
|
|
1957
|
-
output: severalArtistsResponseSchema$1,
|
|
1958
|
-
run: async (input, context) => {
|
|
1959
|
-
const credentials = context.credentials.spotify;
|
|
1960
|
-
return createSpotifyClient(credentials).artists.getArtistRelatedArtists(input.id);
|
|
1961
|
-
}
|
|
1962
|
-
});
|
|
1963
|
-
|
|
1964
|
-
//#endregion
|
|
1965
|
-
//#region src/operations/get-spotify-artist-top-tracks.operation.ts
|
|
1966
|
-
z.array(spotifyIdSchema).min(1).max(50);
|
|
1967
|
-
z.enum([
|
|
1968
|
-
"album",
|
|
1969
|
-
"single",
|
|
1970
|
-
"appears_on",
|
|
1971
|
-
"compilation"
|
|
1972
|
-
]);
|
|
1973
|
-
z.object({
|
|
1974
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
1975
|
-
offset: z.number().int().nonnegative().optional()
|
|
1976
|
-
});
|
|
1977
|
-
z.object({ artists: z.array(spotifyArtistSchema) });
|
|
1978
|
-
const artistTopTracksResponseSchema = z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
1979
|
-
const getArtistTopTracksOperation = new Operation({
|
|
1980
|
-
credentialSets: [spotifyCredentialSet],
|
|
1981
|
-
id: "spotify.get-spotify-artist-top-tracks",
|
|
1982
|
-
name: "Get Spotify Artist Top Tracks",
|
|
1983
|
-
description: "Fetch the top tracks for a Spotify artist in a market.",
|
|
1984
|
-
input: z.object({
|
|
1985
|
-
id: spotifyIdSchema,
|
|
1986
|
-
market: spotifyMarketSchema
|
|
1987
|
-
}),
|
|
1988
|
-
output: artistTopTracksResponseSchema,
|
|
1989
|
-
run: async (input, context) => {
|
|
1990
|
-
const credentials = context.credentials.spotify;
|
|
1991
|
-
return createSpotifyClient(credentials).artists.getArtistTopTracks(input.id, input.market);
|
|
1992
|
-
}
|
|
1993
|
-
});
|
|
1994
|
-
|
|
1995
|
-
//#endregion
|
|
1996
|
-
//#region src/operations/get-spotify-audio-analysis.operation.ts
|
|
1997
|
-
const getAudioAnalysisOperation = new Operation({
|
|
1998
|
-
credentialSets: [spotifyCredentialSet],
|
|
1999
|
-
id: "spotify.get-spotify-audio-analysis",
|
|
2000
|
-
name: "Get Spotify Audio Analysis",
|
|
2001
|
-
description: "Fetch the detailed Spotify audio analysis for a track.",
|
|
2002
|
-
input: z.object({ id: spotifyIdSchema }),
|
|
2003
|
-
output: spotifyAudioAnalysisSchema,
|
|
2004
|
-
run: async (input, context) => {
|
|
2005
|
-
const credentials = context.credentials.spotify;
|
|
2006
|
-
return createSpotifyClient(credentials).audioAnalysis.getAudioAnalysis(input.id);
|
|
2007
|
-
}
|
|
2008
|
-
});
|
|
2009
|
-
|
|
2010
|
-
//#endregion
|
|
2011
|
-
//#region src/operations/get-spotify-audio-features.operation.ts
|
|
2012
|
-
z.array(spotifyIdSchema).min(1).max(100);
|
|
2013
|
-
z.object({ audioFeatures: z.array(spotifyAudioFeaturesSchema.nullable()) });
|
|
2014
|
-
const getAudioFeaturesOperation = new Operation({
|
|
2015
|
-
credentialSets: [spotifyCredentialSet],
|
|
2016
|
-
id: "spotify.get-spotify-audio-features",
|
|
2017
|
-
name: "Get Spotify Audio Features",
|
|
2018
|
-
description: "Fetch Spotify audio features for a track.",
|
|
2019
|
-
input: z.object({ id: spotifyIdSchema }),
|
|
2020
|
-
output: spotifyAudioFeaturesSchema,
|
|
2021
|
-
run: async (input, context) => {
|
|
2022
|
-
const credentials = context.credentials.spotify;
|
|
2023
|
-
return createSpotifyClient(credentials).audioFeatures.getAudioFeatures(input.id);
|
|
2024
|
-
}
|
|
2025
|
-
});
|
|
2026
|
-
|
|
2027
|
-
//#endregion
|
|
2028
|
-
//#region src/operations/get-spotify-audiobook.operation.ts
|
|
2029
|
-
const audiobookIdsSchema$2 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2030
|
-
const audiobookLookupInputSchema = z.object({
|
|
2031
|
-
id: spotifyIdSchema,
|
|
2032
|
-
market: spotifyMarketSchema.optional()
|
|
2033
|
-
});
|
|
2034
|
-
z.object({
|
|
2035
|
-
ids: audiobookIdsSchema$2,
|
|
2036
|
-
market: spotifyMarketSchema.optional()
|
|
2037
|
-
});
|
|
2038
|
-
z.object({ audiobooks: z.array(spotifyAudiobookSchema) });
|
|
2039
|
-
z.object({
|
|
2040
|
-
id: spotifyIdSchema,
|
|
2041
|
-
market: spotifyMarketSchema.optional(),
|
|
2042
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2043
|
-
offset: z.number().int().nonnegative().optional()
|
|
2044
|
-
});
|
|
2045
|
-
const getAudiobookOperation = new Operation({
|
|
2046
|
-
credentialSets: [spotifyCredentialSet],
|
|
2047
|
-
id: "spotify.get-spotify-audiobook",
|
|
2048
|
-
name: "Get Spotify Audiobook",
|
|
2049
|
-
description: "Fetch a single Spotify audiobook by ID.",
|
|
2050
|
-
input: audiobookLookupInputSchema,
|
|
2051
|
-
output: spotifyAudiobookSchema,
|
|
2052
|
-
run: async (input, context) => {
|
|
2053
|
-
const credentials = context.credentials.spotify;
|
|
2054
|
-
return createSpotifyClient(credentials).audiobooks.getAudiobook(input.id, input.market);
|
|
2055
|
-
}
|
|
2056
|
-
});
|
|
2057
|
-
|
|
2058
|
-
//#endregion
|
|
2059
|
-
//#region src/operations/get-spotify-audiobook-chapters.operation.ts
|
|
2060
|
-
const audiobookIdsSchema$1 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2061
|
-
z.object({
|
|
2062
|
-
id: spotifyIdSchema,
|
|
2063
|
-
market: spotifyMarketSchema.optional()
|
|
2064
|
-
});
|
|
2065
|
-
z.object({
|
|
2066
|
-
ids: audiobookIdsSchema$1,
|
|
2067
|
-
market: spotifyMarketSchema.optional()
|
|
2068
|
-
});
|
|
2069
|
-
z.object({ audiobooks: z.array(spotifyAudiobookSchema) });
|
|
2070
|
-
const audiobookChaptersInputSchema = z.object({
|
|
2071
|
-
id: spotifyIdSchema,
|
|
2072
|
-
market: spotifyMarketSchema.optional(),
|
|
2073
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2074
|
-
offset: z.number().int().nonnegative().optional()
|
|
2075
|
-
});
|
|
2076
|
-
const getAudiobookChaptersOperation = new Operation({
|
|
2077
|
-
credentialSets: [spotifyCredentialSet],
|
|
2078
|
-
id: "spotify.get-spotify-audiobook-chapters",
|
|
2079
|
-
name: "Get Spotify Audiobook Chapters",
|
|
2080
|
-
description: "List chapters for a Spotify audiobook.",
|
|
2081
|
-
input: audiobookChaptersInputSchema,
|
|
2082
|
-
output: spotifyChapterPageSchema,
|
|
2083
|
-
run: async (input, context) => {
|
|
2084
|
-
const credentials = context.credentials.spotify;
|
|
2085
|
-
return createSpotifyClient(credentials).audiobooks.getAudiobookChapters(input.id, {
|
|
2086
|
-
market: input.market,
|
|
2087
|
-
limit: input.limit,
|
|
2088
|
-
offset: input.offset
|
|
2089
|
-
});
|
|
2090
|
-
}
|
|
2091
|
-
});
|
|
2092
|
-
|
|
2093
|
-
//#endregion
|
|
2094
|
-
//#region src/operations/get-spotify-available-genre-seeds.operation.ts
|
|
2095
|
-
const availableGenreSeedsResponseSchema = z.object({ genres: z.array(z.string().min(1)) });
|
|
2096
|
-
const getAvailableGenreSeedsOperation = new Operation({
|
|
2097
|
-
credentialSets: [spotifyCredentialSet],
|
|
2098
|
-
id: "spotify.get-spotify-available-genre-seeds",
|
|
2099
|
-
name: "Get Spotify Available Genre Seeds",
|
|
2100
|
-
description: "List Spotify recommendation genre seeds. This endpoint is deprecated upstream by Spotify.",
|
|
2101
|
-
input: z.object({}),
|
|
2102
|
-
output: availableGenreSeedsResponseSchema,
|
|
2103
|
-
run: async (_input, context) => {
|
|
2104
|
-
const credentials = context.credentials.spotify;
|
|
2105
|
-
return createSpotifyClient(credentials).discovery.getAvailableGenreSeeds();
|
|
2106
|
-
}
|
|
2107
|
-
});
|
|
2108
|
-
|
|
2109
|
-
//#endregion
|
|
2110
|
-
//#region src/operations/get-spotify-available-markets.operation.ts
|
|
2111
|
-
const availableMarketsResponseSchema = z.object({ markets: z.array(spotifyMarketSchema) });
|
|
2112
|
-
const getAvailableMarketsOperation = new Operation({
|
|
2113
|
-
credentialSets: [spotifyCredentialSet],
|
|
2114
|
-
id: "spotify.get-spotify-available-markets",
|
|
2115
|
-
name: "Get Spotify Available Markets",
|
|
2116
|
-
description: "List the markets currently supported by Spotify.",
|
|
2117
|
-
input: z.object({}),
|
|
2118
|
-
output: availableMarketsResponseSchema,
|
|
2119
|
-
run: async (_input, context) => {
|
|
2120
|
-
const credentials = context.credentials.spotify;
|
|
2121
|
-
return createSpotifyClient(credentials).discovery.getAvailableMarkets();
|
|
2122
|
-
}
|
|
2123
|
-
});
|
|
2124
|
-
|
|
2125
|
-
//#endregion
|
|
2126
|
-
//#region src/operations/get-spotify-browse-categories.operation.ts
|
|
2127
|
-
z.string().min(1);
|
|
2128
|
-
const categoryPagingSchema$1 = z.object({
|
|
2129
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2130
|
-
offset: z.number().int().nonnegative().optional()
|
|
2131
|
-
});
|
|
2132
|
-
const getBrowseCategoriesOperation = new Operation({
|
|
2133
|
-
credentialSets: [spotifyCredentialSet],
|
|
2134
|
-
id: "spotify.get-spotify-browse-categories",
|
|
2135
|
-
name: "Get Spotify Browse Categories",
|
|
2136
|
-
description: "List Spotify browse categories.",
|
|
2137
|
-
input: categoryPagingSchema$1.extend({
|
|
2138
|
-
country: spotifyMarketSchema.optional(),
|
|
2139
|
-
locale: z.string().min(1).optional()
|
|
2140
|
-
}),
|
|
2141
|
-
output: spotifyCategoryPageSchema,
|
|
2142
|
-
run: async (input, context) => {
|
|
2143
|
-
const credentials = context.credentials.spotify;
|
|
2144
|
-
return createSpotifyClient(credentials).discovery.getBrowseCategories({
|
|
2145
|
-
country: input.country,
|
|
2146
|
-
locale: input.locale,
|
|
2147
|
-
limit: input.limit,
|
|
2148
|
-
offset: input.offset
|
|
2149
|
-
});
|
|
2150
|
-
}
|
|
2151
|
-
});
|
|
2152
|
-
|
|
2153
|
-
//#endregion
|
|
2154
|
-
//#region src/operations/get-spotify-browse-category.operation.ts
|
|
2155
|
-
const browseCategoryIdSchema$1 = z.string().min(1);
|
|
2156
|
-
z.object({
|
|
2157
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2158
|
-
offset: z.number().int().nonnegative().optional()
|
|
2159
|
-
});
|
|
2160
|
-
const getBrowseCategoryOperation = new Operation({
|
|
2161
|
-
credentialSets: [spotifyCredentialSet],
|
|
2162
|
-
id: "spotify.get-spotify-browse-category",
|
|
2163
|
-
name: "Get Spotify Browse Category",
|
|
2164
|
-
description: "Fetch a single Spotify browse category.",
|
|
2165
|
-
input: z.object({
|
|
2166
|
-
id: browseCategoryIdSchema$1,
|
|
2167
|
-
country: spotifyMarketSchema.optional(),
|
|
2168
|
-
locale: z.string().min(1).optional()
|
|
2169
|
-
}),
|
|
2170
|
-
output: spotifyCategorySchema,
|
|
2171
|
-
run: async (input, context) => {
|
|
2172
|
-
const credentials = context.credentials.spotify;
|
|
2173
|
-
return createSpotifyClient(credentials).discovery.getBrowseCategory(input.id, {
|
|
2174
|
-
country: input.country,
|
|
2175
|
-
locale: input.locale
|
|
2176
|
-
});
|
|
2177
|
-
}
|
|
2178
|
-
});
|
|
2179
|
-
|
|
2180
|
-
//#endregion
|
|
2181
|
-
//#region src/operations/get-spotify-category-playlists.operation.ts
|
|
2182
|
-
const browseCategoryIdSchema = z.string().min(1);
|
|
2183
|
-
const categoryPagingSchema = z.object({
|
|
2184
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2185
|
-
offset: z.number().int().nonnegative().optional()
|
|
2186
|
-
});
|
|
2187
|
-
const getCategoryPlaylistsOperation = new Operation({
|
|
2188
|
-
credentialSets: [spotifyCredentialSet],
|
|
2189
|
-
id: "spotify.get-spotify-category-playlists",
|
|
2190
|
-
name: "Get Spotify Category Playlists",
|
|
2191
|
-
description: "List playlists for a Spotify browse category. This endpoint is deprecated upstream by Spotify.",
|
|
2192
|
-
input: categoryPagingSchema.extend({
|
|
2193
|
-
id: browseCategoryIdSchema,
|
|
2194
|
-
country: spotifyMarketSchema.optional()
|
|
2195
|
-
}),
|
|
2196
|
-
output: spotifyPlaylistPageSchema,
|
|
2197
|
-
run: async (input, context) => {
|
|
2198
|
-
const credentials = context.credentials.spotify;
|
|
2199
|
-
return createSpotifyClient(credentials).discovery.getCategoryPlaylists(input.id, {
|
|
2200
|
-
country: input.country,
|
|
2201
|
-
limit: input.limit,
|
|
2202
|
-
offset: input.offset
|
|
2203
|
-
});
|
|
2204
|
-
}
|
|
2205
|
-
});
|
|
2206
|
-
|
|
2207
|
-
//#endregion
|
|
2208
|
-
//#region src/operations/get-spotify-chapter.operation.ts
|
|
2209
|
-
const chapterIdsSchema$1 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2210
|
-
const chapterLookupInputSchema = z.object({
|
|
2211
|
-
id: spotifyIdSchema,
|
|
2212
|
-
market: spotifyMarketSchema.optional()
|
|
2213
|
-
});
|
|
2214
|
-
z.object({
|
|
2215
|
-
ids: chapterIdsSchema$1,
|
|
2216
|
-
market: spotifyMarketSchema.optional()
|
|
2217
|
-
});
|
|
2218
|
-
z.object({ chapters: z.array(spotifyChapterSchema) });
|
|
2219
|
-
const getChapterOperation = new Operation({
|
|
2220
|
-
credentialSets: [spotifyCredentialSet],
|
|
2221
|
-
id: "spotify.get-spotify-chapter",
|
|
2222
|
-
name: "Get Spotify Chapter",
|
|
2223
|
-
description: "Fetch a single Spotify chapter by ID.",
|
|
2224
|
-
input: chapterLookupInputSchema,
|
|
2225
|
-
output: spotifyChapterSchema,
|
|
2226
|
-
run: async (input, context) => {
|
|
2227
|
-
const credentials = context.credentials.spotify;
|
|
2228
|
-
return createSpotifyClient(credentials).chapters.getChapter(input.id, input.market);
|
|
2229
|
-
}
|
|
2230
|
-
});
|
|
2231
|
-
|
|
2232
|
-
//#endregion
|
|
2233
|
-
//#region src/operations/get-spotify-episode.operation.ts
|
|
2234
|
-
const severalEpisodeIdsSchema$1 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2235
|
-
const episodeLookupInputSchema = z.object({
|
|
2236
|
-
id: spotifyIdSchema,
|
|
2237
|
-
market: spotifyMarketSchema.optional()
|
|
2238
|
-
});
|
|
2239
|
-
z.object({
|
|
2240
|
-
ids: severalEpisodeIdsSchema$1,
|
|
2241
|
-
market: spotifyMarketSchema.optional()
|
|
2242
|
-
});
|
|
2243
|
-
z.object({ episodes: z.array(spotifyEpisodeSchema) });
|
|
2244
|
-
const getEpisodeOperation = new Operation({
|
|
2245
|
-
credentialSets: [spotifyCredentialSet],
|
|
2246
|
-
id: "spotify.get-spotify-episode",
|
|
2247
|
-
name: "Get Spotify Episode",
|
|
2248
|
-
description: "Fetch a single Spotify episode by ID.",
|
|
2249
|
-
input: episodeLookupInputSchema,
|
|
2250
|
-
output: spotifyEpisodeSchema,
|
|
2251
|
-
run: async (input, context) => {
|
|
2252
|
-
const credentials = context.credentials.spotify;
|
|
2253
|
-
return createSpotifyClient(credentials).episodes.getEpisode(input.id, input.market);
|
|
2254
|
-
}
|
|
2255
|
-
});
|
|
2256
|
-
|
|
2257
|
-
//#endregion
|
|
2258
|
-
//#region src/operations/get-spotify-featured-playlists.operation.ts
|
|
2259
|
-
const getFeaturedPlaylistsOperation = new Operation({
|
|
2260
|
-
credentialSets: [spotifyCredentialSet],
|
|
2261
|
-
id: "spotify.get-spotify-featured-playlists",
|
|
2262
|
-
name: "Get Spotify Featured Playlists",
|
|
2263
|
-
description: "List featured Spotify playlists for a market. This endpoint is deprecated upstream by Spotify.",
|
|
2264
|
-
input: z.object({
|
|
2265
|
-
country: spotifyMarketSchema.optional(),
|
|
2266
|
-
locale: z.string().min(1).optional(),
|
|
2267
|
-
timestamp: spotifyTimestampSchema.optional(),
|
|
2268
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2269
|
-
offset: z.number().int().nonnegative().optional()
|
|
2270
|
-
}),
|
|
2271
|
-
output: spotifyPlaylistPageSchema,
|
|
2272
|
-
run: async (input, context) => {
|
|
2273
|
-
const credentials = context.credentials.spotify;
|
|
2274
|
-
return createSpotifyClient(credentials).discovery.getFeaturedPlaylists({
|
|
2275
|
-
country: input.country,
|
|
2276
|
-
locale: input.locale,
|
|
2277
|
-
timestamp: input.timestamp,
|
|
2278
|
-
limit: input.limit,
|
|
2279
|
-
offset: input.offset
|
|
2280
|
-
});
|
|
2281
|
-
}
|
|
2282
|
-
});
|
|
2283
|
-
|
|
2284
|
-
//#endregion
|
|
2285
|
-
//#region src/operations/get-spotify-followed-artists.operation.ts
|
|
2286
|
-
const followTypeSchema$1 = z.enum(["artist", "user"]);
|
|
2287
|
-
const followIdsSchema$1 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2288
|
-
const followedArtistsPageSchema = createSpotifyCursorPageSchema(spotifyArtistSchema);
|
|
2289
|
-
const followedArtistsInputSchema = z.object({
|
|
2290
|
-
after: z.string().min(1).optional(),
|
|
2291
|
-
limit: z.number().int().min(1).max(50).optional()
|
|
2292
|
-
});
|
|
2293
|
-
z.object({
|
|
2294
|
-
type: followTypeSchema$1,
|
|
2295
|
-
ids: followIdsSchema$1
|
|
2296
|
-
});
|
|
2297
|
-
const getFollowedArtistsOperation = new Operation({
|
|
2298
|
-
credentialSets: [spotifyCredentialSet],
|
|
2299
|
-
id: "spotify.get-spotify-followed-artists",
|
|
2300
|
-
name: "Get Followed Spotify Artists",
|
|
2301
|
-
description: "List the artists followed by the current Spotify user.",
|
|
2302
|
-
input: followedArtistsInputSchema,
|
|
2303
|
-
output: followedArtistsPageSchema,
|
|
2304
|
-
run: async (input, context) => {
|
|
2305
|
-
const credentials = context.credentials.spotify;
|
|
2306
|
-
return createSpotifyClient(credentials).follow.getFollowedArtists({
|
|
2307
|
-
after: input.after,
|
|
2308
|
-
limit: input.limit
|
|
2309
|
-
});
|
|
2310
|
-
}
|
|
2311
|
-
});
|
|
2312
|
-
|
|
2313
|
-
//#endregion
|
|
2314
|
-
//#region src/operations/get-spotify-me.operation.ts
|
|
2315
|
-
const emptyInputSchema = z.object({});
|
|
2316
|
-
const topItemTimeRangeSchema$2 = z.enum([
|
|
2317
|
-
"short_term",
|
|
2318
|
-
"medium_term",
|
|
2319
|
-
"long_term"
|
|
2320
|
-
]);
|
|
2321
|
-
z.object({
|
|
2322
|
-
timeRange: topItemTimeRangeSchema$2.optional(),
|
|
2323
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2324
|
-
offset: z.number().int().nonnegative().optional()
|
|
2325
|
-
});
|
|
2326
|
-
const getMeOperation = new Operation({
|
|
2327
|
-
credentialSets: [spotifyCredentialSet],
|
|
2328
|
-
id: "spotify.get-spotify-me",
|
|
2329
|
-
name: "Get Spotify Me",
|
|
2330
|
-
description: "Fetch the current Spotify user profile.",
|
|
2331
|
-
input: emptyInputSchema,
|
|
2332
|
-
output: spotifyUserSchema,
|
|
2333
|
-
run: async (_input, context) => {
|
|
2334
|
-
const credentials = context.credentials.spotify;
|
|
2335
|
-
return createSpotifyClient(credentials).users.getMe();
|
|
2336
|
-
}
|
|
2337
|
-
});
|
|
2338
|
-
|
|
2339
|
-
//#endregion
|
|
2340
|
-
//#region src/operations/get-spotify-my-top-artists.operation.ts
|
|
2341
|
-
z.object({});
|
|
2342
|
-
const topItemTimeRangeSchema$1 = z.enum([
|
|
2343
|
-
"short_term",
|
|
2344
|
-
"medium_term",
|
|
2345
|
-
"long_term"
|
|
2346
|
-
]);
|
|
2347
|
-
const topItemsInputSchema$1 = z.object({
|
|
2348
|
-
timeRange: topItemTimeRangeSchema$1.optional(),
|
|
2349
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2350
|
-
offset: z.number().int().nonnegative().optional()
|
|
2351
|
-
});
|
|
2352
|
-
const getMyTopArtistsOperation = new Operation({
|
|
2353
|
-
credentialSets: [spotifyCredentialSet],
|
|
2354
|
-
id: "spotify.get-spotify-my-top-artists",
|
|
2355
|
-
name: "Get My Top Spotify Artists",
|
|
2356
|
-
description: "List the current user's top Spotify artists.",
|
|
2357
|
-
input: topItemsInputSchema$1,
|
|
2358
|
-
output: spotifyArtistPageSchema,
|
|
2359
|
-
run: async (input, context) => {
|
|
2360
|
-
const credentials = context.credentials.spotify;
|
|
2361
|
-
return createSpotifyClient(credentials).users.getMyTopArtists({
|
|
2362
|
-
time_range: input.timeRange,
|
|
2363
|
-
limit: input.limit,
|
|
2364
|
-
offset: input.offset
|
|
2365
|
-
});
|
|
2366
|
-
}
|
|
2367
|
-
});
|
|
2368
|
-
|
|
2369
|
-
//#endregion
|
|
2370
|
-
//#region src/operations/get-spotify-my-top-tracks.operation.ts
|
|
2371
|
-
z.object({});
|
|
2372
|
-
const topItemTimeRangeSchema = z.enum([
|
|
2373
|
-
"short_term",
|
|
2374
|
-
"medium_term",
|
|
2375
|
-
"long_term"
|
|
2376
|
-
]);
|
|
2377
|
-
const topItemsInputSchema = z.object({
|
|
2378
|
-
timeRange: topItemTimeRangeSchema.optional(),
|
|
2379
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2380
|
-
offset: z.number().int().nonnegative().optional()
|
|
2381
|
-
});
|
|
2382
|
-
const getMyTopTracksOperation = new Operation({
|
|
2383
|
-
credentialSets: [spotifyCredentialSet],
|
|
2384
|
-
id: "spotify.get-spotify-my-top-tracks",
|
|
2385
|
-
name: "Get My Top Spotify Tracks",
|
|
2386
|
-
description: "List the current user's top Spotify tracks.",
|
|
2387
|
-
input: topItemsInputSchema,
|
|
2388
|
-
output: spotifyTrackPageSchema,
|
|
2389
|
-
run: async (input, context) => {
|
|
2390
|
-
const credentials = context.credentials.spotify;
|
|
2391
|
-
return createSpotifyClient(credentials).users.getMyTopTracks({
|
|
2392
|
-
time_range: input.timeRange,
|
|
2393
|
-
limit: input.limit,
|
|
2394
|
-
offset: input.offset
|
|
2395
|
-
});
|
|
2396
|
-
}
|
|
2397
|
-
});
|
|
2398
|
-
|
|
2399
|
-
//#endregion
|
|
2400
|
-
//#region src/operations/get-spotify-new-releases.operation.ts
|
|
2401
|
-
z.array(spotifyIdSchema).min(1).max(20);
|
|
2402
|
-
const pagingSchema = z.object({
|
|
2403
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2404
|
-
offset: z.number().int().nonnegative().optional()
|
|
2405
|
-
});
|
|
2406
|
-
z.object({ albums: z.array(spotifyAlbumSchema) });
|
|
2407
|
-
const getNewReleasesOperation = new Operation({
|
|
2408
|
-
credentialSets: [spotifyCredentialSet],
|
|
2409
|
-
id: "spotify.get-spotify-new-releases",
|
|
2410
|
-
name: "Get Spotify New Releases",
|
|
2411
|
-
description: "List Spotify new-release albums for a market.",
|
|
2412
|
-
input: pagingSchema.extend({ country: spotifyMarketSchema.optional() }),
|
|
2413
|
-
output: spotifyAlbumPageSchema,
|
|
2414
|
-
run: async (input, context) => {
|
|
2415
|
-
const credentials = context.credentials.spotify;
|
|
2416
|
-
return createSpotifyClient(credentials).albums.getNewReleases({
|
|
2417
|
-
country: input.country,
|
|
2418
|
-
limit: input.limit,
|
|
2419
|
-
offset: input.offset
|
|
2420
|
-
});
|
|
2421
|
-
}
|
|
2422
|
-
});
|
|
2423
|
-
|
|
2424
|
-
//#endregion
|
|
2425
|
-
//#region src/operations/get-spotify-recommendations.operation.ts
|
|
2426
|
-
const recommendationNumberSchema = z.number().min(0).max(1);
|
|
2427
|
-
const recommendationKeySchema = z.number().int().min(0).max(11);
|
|
2428
|
-
const recommendationModeSchema = z.number().int().min(0).max(1);
|
|
2429
|
-
const recommendationPopularitySchema = z.number().int().min(0).max(100);
|
|
2430
|
-
const recommendationTempoSchema = z.number().nonnegative();
|
|
2431
|
-
const recommendationDurationSchema = z.number().int().nonnegative();
|
|
2432
|
-
const recommendationTimeSignatureSchema = z.number().int().positive();
|
|
2433
|
-
const recommendationSeedIdListSchema = z.array(spotifyIdSchema).max(5).optional();
|
|
2434
|
-
const recommendationSeedGenreListSchema = z.array(z.string().min(1)).max(5).optional();
|
|
2435
|
-
const recommendationInputSchema = z.object({
|
|
2436
|
-
seedArtists: recommendationSeedIdListSchema,
|
|
2437
|
-
seedGenres: recommendationSeedGenreListSchema,
|
|
2438
|
-
seedTracks: recommendationSeedIdListSchema,
|
|
2439
|
-
market: spotifyMarketSchema.optional(),
|
|
2440
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
2441
|
-
minAcousticness: recommendationNumberSchema.optional(),
|
|
2442
|
-
maxAcousticness: recommendationNumberSchema.optional(),
|
|
2443
|
-
targetAcousticness: recommendationNumberSchema.optional(),
|
|
2444
|
-
minDanceability: recommendationNumberSchema.optional(),
|
|
2445
|
-
maxDanceability: recommendationNumberSchema.optional(),
|
|
2446
|
-
targetDanceability: recommendationNumberSchema.optional(),
|
|
2447
|
-
minDurationMs: recommendationDurationSchema.optional(),
|
|
2448
|
-
maxDurationMs: recommendationDurationSchema.optional(),
|
|
2449
|
-
targetDurationMs: recommendationDurationSchema.optional(),
|
|
2450
|
-
minEnergy: recommendationNumberSchema.optional(),
|
|
2451
|
-
maxEnergy: recommendationNumberSchema.optional(),
|
|
2452
|
-
targetEnergy: recommendationNumberSchema.optional(),
|
|
2453
|
-
minInstrumentalness: recommendationNumberSchema.optional(),
|
|
2454
|
-
maxInstrumentalness: recommendationNumberSchema.optional(),
|
|
2455
|
-
targetInstrumentalness: recommendationNumberSchema.optional(),
|
|
2456
|
-
minKey: recommendationKeySchema.optional(),
|
|
2457
|
-
maxKey: recommendationKeySchema.optional(),
|
|
2458
|
-
targetKey: recommendationKeySchema.optional(),
|
|
2459
|
-
minLiveness: recommendationNumberSchema.optional(),
|
|
2460
|
-
maxLiveness: recommendationNumberSchema.optional(),
|
|
2461
|
-
targetLiveness: recommendationNumberSchema.optional(),
|
|
2462
|
-
minLoudness: z.number().optional(),
|
|
2463
|
-
maxLoudness: z.number().optional(),
|
|
2464
|
-
targetLoudness: z.number().optional(),
|
|
2465
|
-
minMode: recommendationModeSchema.optional(),
|
|
2466
|
-
maxMode: recommendationModeSchema.optional(),
|
|
2467
|
-
targetMode: recommendationModeSchema.optional(),
|
|
2468
|
-
minPopularity: recommendationPopularitySchema.optional(),
|
|
2469
|
-
maxPopularity: recommendationPopularitySchema.optional(),
|
|
2470
|
-
targetPopularity: recommendationPopularitySchema.optional(),
|
|
2471
|
-
minSpeechiness: recommendationNumberSchema.optional(),
|
|
2472
|
-
maxSpeechiness: recommendationNumberSchema.optional(),
|
|
2473
|
-
targetSpeechiness: recommendationNumberSchema.optional(),
|
|
2474
|
-
minTempo: recommendationTempoSchema.optional(),
|
|
2475
|
-
maxTempo: recommendationTempoSchema.optional(),
|
|
2476
|
-
targetTempo: recommendationTempoSchema.optional(),
|
|
2477
|
-
minTimeSignature: recommendationTimeSignatureSchema.optional(),
|
|
2478
|
-
maxTimeSignature: recommendationTimeSignatureSchema.optional(),
|
|
2479
|
-
targetTimeSignature: recommendationTimeSignatureSchema.optional(),
|
|
2480
|
-
minValence: recommendationNumberSchema.optional(),
|
|
2481
|
-
maxValence: recommendationNumberSchema.optional(),
|
|
2482
|
-
targetValence: recommendationNumberSchema.optional()
|
|
2483
|
-
}).superRefine((input, ctx) => {
|
|
2484
|
-
const seedCount = (input.seedArtists?.length ?? 0) + (input.seedGenres?.length ?? 0) + (input.seedTracks?.length ?? 0);
|
|
2485
|
-
if (seedCount === 0) ctx.addIssue({
|
|
2486
|
-
code: z.ZodIssueCode.custom,
|
|
2487
|
-
message: "At least one recommendation seed is required.",
|
|
2488
|
-
path: ["seedArtists"]
|
|
2489
|
-
});
|
|
2490
|
-
if (seedCount > 5) ctx.addIssue({
|
|
2491
|
-
code: z.ZodIssueCode.custom,
|
|
2492
|
-
message: "Spotify recommendations support at most 5 combined seeds.",
|
|
2493
|
-
path: ["seedArtists"]
|
|
2494
|
-
});
|
|
2495
|
-
});
|
|
2496
|
-
const getRecommendationsOperation = new Operation({
|
|
2497
|
-
credentialSets: [spotifyCredentialSet],
|
|
2498
|
-
id: "spotify.get-spotify-recommendations",
|
|
2499
|
-
name: "Get Spotify Recommendations",
|
|
2500
|
-
description: "Generate Spotify track recommendations from seeds and tunable audio targets.",
|
|
2501
|
-
input: recommendationInputSchema,
|
|
2502
|
-
output: spotifyRecommendationsSchema,
|
|
2503
|
-
run: async (input, context) => {
|
|
2504
|
-
const credentials = context.credentials.spotify;
|
|
2505
|
-
return createSpotifyClient(credentials).recommendations.getRecommendations({
|
|
2506
|
-
seed_artists: input.seedArtists,
|
|
2507
|
-
seed_genres: input.seedGenres,
|
|
2508
|
-
seed_tracks: input.seedTracks,
|
|
2509
|
-
market: input.market,
|
|
2510
|
-
limit: input.limit,
|
|
2511
|
-
min_acousticness: input.minAcousticness,
|
|
2512
|
-
max_acousticness: input.maxAcousticness,
|
|
2513
|
-
target_acousticness: input.targetAcousticness,
|
|
2514
|
-
min_danceability: input.minDanceability,
|
|
2515
|
-
max_danceability: input.maxDanceability,
|
|
2516
|
-
target_danceability: input.targetDanceability,
|
|
2517
|
-
min_duration_ms: input.minDurationMs,
|
|
2518
|
-
max_duration_ms: input.maxDurationMs,
|
|
2519
|
-
target_duration_ms: input.targetDurationMs,
|
|
2520
|
-
min_energy: input.minEnergy,
|
|
2521
|
-
max_energy: input.maxEnergy,
|
|
2522
|
-
target_energy: input.targetEnergy,
|
|
2523
|
-
min_instrumentalness: input.minInstrumentalness,
|
|
2524
|
-
max_instrumentalness: input.maxInstrumentalness,
|
|
2525
|
-
target_instrumentalness: input.targetInstrumentalness,
|
|
2526
|
-
min_key: input.minKey,
|
|
2527
|
-
max_key: input.maxKey,
|
|
2528
|
-
target_key: input.targetKey,
|
|
2529
|
-
min_liveness: input.minLiveness,
|
|
2530
|
-
max_liveness: input.maxLiveness,
|
|
2531
|
-
target_liveness: input.targetLiveness,
|
|
2532
|
-
min_loudness: input.minLoudness,
|
|
2533
|
-
max_loudness: input.maxLoudness,
|
|
2534
|
-
target_loudness: input.targetLoudness,
|
|
2535
|
-
min_mode: input.minMode,
|
|
2536
|
-
max_mode: input.maxMode,
|
|
2537
|
-
target_mode: input.targetMode,
|
|
2538
|
-
min_popularity: input.minPopularity,
|
|
2539
|
-
max_popularity: input.maxPopularity,
|
|
2540
|
-
target_popularity: input.targetPopularity,
|
|
2541
|
-
min_speechiness: input.minSpeechiness,
|
|
2542
|
-
max_speechiness: input.maxSpeechiness,
|
|
2543
|
-
target_speechiness: input.targetSpeechiness,
|
|
2544
|
-
min_tempo: input.minTempo,
|
|
2545
|
-
max_tempo: input.maxTempo,
|
|
2546
|
-
target_tempo: input.targetTempo,
|
|
2547
|
-
min_time_signature: input.minTimeSignature,
|
|
2548
|
-
max_time_signature: input.maxTimeSignature,
|
|
2549
|
-
target_time_signature: input.targetTimeSignature,
|
|
2550
|
-
min_valence: input.minValence,
|
|
2551
|
-
max_valence: input.maxValence,
|
|
2552
|
-
target_valence: input.targetValence
|
|
2553
|
-
});
|
|
2554
|
-
}
|
|
2555
|
-
});
|
|
2556
|
-
|
|
2557
|
-
//#endregion
|
|
2558
|
-
//#region src/operations/get-spotify-several-albums.operation.ts
|
|
2559
|
-
const albumIdListSchema = z.array(spotifyIdSchema).min(1).max(20);
|
|
2560
|
-
z.object({
|
|
2561
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2562
|
-
offset: z.number().int().nonnegative().optional()
|
|
2563
|
-
});
|
|
2564
|
-
const severalAlbumsResponseSchema = z.object({ albums: z.array(spotifyAlbumSchema) });
|
|
2565
|
-
const getSeveralAlbumsOperation = new Operation({
|
|
2566
|
-
credentialSets: [spotifyCredentialSet],
|
|
2567
|
-
id: "spotify.get-spotify-several-albums",
|
|
2568
|
-
name: "Get Several Spotify Albums",
|
|
2569
|
-
description: "Fetch multiple Spotify albums in one request.",
|
|
2570
|
-
input: z.object({
|
|
2571
|
-
ids: albumIdListSchema,
|
|
2572
|
-
market: spotifyMarketSchema.optional()
|
|
2573
|
-
}),
|
|
2574
|
-
output: severalAlbumsResponseSchema,
|
|
2575
|
-
run: async (input, context) => {
|
|
2576
|
-
const credentials = context.credentials.spotify;
|
|
2577
|
-
return createSpotifyClient(credentials).albums.getSeveralAlbums(input.ids, input.market);
|
|
2578
|
-
}
|
|
2579
|
-
});
|
|
2580
|
-
|
|
2581
|
-
//#endregion
|
|
2582
|
-
//#region src/operations/get-spotify-several-artists.operation.ts
|
|
2583
|
-
const artistIdListSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
2584
|
-
z.enum([
|
|
2585
|
-
"album",
|
|
2586
|
-
"single",
|
|
2587
|
-
"appears_on",
|
|
2588
|
-
"compilation"
|
|
2589
|
-
]);
|
|
2590
|
-
z.object({
|
|
2591
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2592
|
-
offset: z.number().int().nonnegative().optional()
|
|
2593
|
-
});
|
|
2594
|
-
const severalArtistsResponseSchema = z.object({ artists: z.array(spotifyArtistSchema) });
|
|
2595
|
-
z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
2596
|
-
const getSeveralArtistsOperation = new Operation({
|
|
2597
|
-
credentialSets: [spotifyCredentialSet],
|
|
2598
|
-
id: "spotify.get-spotify-several-artists",
|
|
2599
|
-
name: "Get Several Spotify Artists",
|
|
2600
|
-
description: "Fetch multiple Spotify artists in one request.",
|
|
2601
|
-
input: z.object({ ids: artistIdListSchema }),
|
|
2602
|
-
output: severalArtistsResponseSchema,
|
|
2603
|
-
run: async (input, context) => {
|
|
2604
|
-
const credentials = context.credentials.spotify;
|
|
2605
|
-
return createSpotifyClient(credentials).artists.getSeveralArtists(input.ids);
|
|
2606
|
-
}
|
|
2607
|
-
});
|
|
2608
|
-
|
|
2609
|
-
//#endregion
|
|
2610
|
-
//#region src/operations/get-spotify-several-audio-features.operation.ts
|
|
2611
|
-
const trackIdListSchema$1 = z.array(spotifyIdSchema).min(1).max(100);
|
|
2612
|
-
const severalAudioFeaturesResponseSchema = z.object({ audioFeatures: z.array(spotifyAudioFeaturesSchema.nullable()) });
|
|
2613
|
-
const getSeveralAudioFeaturesOperation = new Operation({
|
|
2614
|
-
credentialSets: [spotifyCredentialSet],
|
|
2615
|
-
id: "spotify.get-spotify-several-audio-features",
|
|
2616
|
-
name: "Get Several Spotify Audio Features",
|
|
2617
|
-
description: "Fetch Spotify audio features for multiple tracks.",
|
|
2618
|
-
input: z.object({ ids: trackIdListSchema$1 }),
|
|
2619
|
-
output: severalAudioFeaturesResponseSchema,
|
|
2620
|
-
run: async (input, context) => {
|
|
2621
|
-
const credentials = context.credentials.spotify;
|
|
2622
|
-
return createSpotifyClient(credentials).audioFeatures.getSeveralAudioFeatures(input.ids);
|
|
2623
|
-
}
|
|
2624
|
-
});
|
|
2625
|
-
|
|
2626
|
-
//#endregion
|
|
2627
|
-
//#region src/operations/get-spotify-several-audiobooks.operation.ts
|
|
2628
|
-
const audiobookIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
2629
|
-
z.object({
|
|
2630
|
-
id: spotifyIdSchema,
|
|
2631
|
-
market: spotifyMarketSchema.optional()
|
|
2632
|
-
});
|
|
2633
|
-
const severalAudiobooksInputSchema = z.object({
|
|
2634
|
-
ids: audiobookIdsSchema,
|
|
2635
|
-
market: spotifyMarketSchema.optional()
|
|
2636
|
-
});
|
|
2637
|
-
const severalAudiobooksOutputSchema = z.object({ audiobooks: z.array(spotifyAudiobookSchema) });
|
|
2638
|
-
z.object({
|
|
2639
|
-
id: spotifyIdSchema,
|
|
2640
|
-
market: spotifyMarketSchema.optional(),
|
|
2641
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2642
|
-
offset: z.number().int().nonnegative().optional()
|
|
2643
|
-
});
|
|
2644
|
-
const getSeveralAudiobooksOperation = new Operation({
|
|
2645
|
-
credentialSets: [spotifyCredentialSet],
|
|
2646
|
-
id: "spotify.get-spotify-several-audiobooks",
|
|
2647
|
-
name: "Get Several Spotify Audiobooks",
|
|
2648
|
-
description: "Fetch multiple Spotify audiobooks in a single request.",
|
|
2649
|
-
input: severalAudiobooksInputSchema,
|
|
2650
|
-
output: severalAudiobooksOutputSchema,
|
|
2651
|
-
run: async (input, context) => {
|
|
2652
|
-
const credentials = context.credentials.spotify;
|
|
2653
|
-
return createSpotifyClient(credentials).audiobooks.getSeveralAudiobooks(input.ids, input.market);
|
|
2654
|
-
}
|
|
2655
|
-
});
|
|
2656
|
-
|
|
2657
|
-
//#endregion
|
|
2658
|
-
//#region src/operations/get-spotify-several-chapters.operation.ts
|
|
2659
|
-
const chapterIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
2660
|
-
z.object({
|
|
2661
|
-
id: spotifyIdSchema,
|
|
2662
|
-
market: spotifyMarketSchema.optional()
|
|
2663
|
-
});
|
|
2664
|
-
const severalChaptersInputSchema = z.object({
|
|
2665
|
-
ids: chapterIdsSchema,
|
|
2666
|
-
market: spotifyMarketSchema.optional()
|
|
2667
|
-
});
|
|
2668
|
-
const severalChaptersOutputSchema = z.object({ chapters: z.array(spotifyChapterSchema) });
|
|
2669
|
-
const getSeveralChaptersOperation = new Operation({
|
|
2670
|
-
credentialSets: [spotifyCredentialSet],
|
|
2671
|
-
id: "spotify.get-spotify-several-chapters",
|
|
2672
|
-
name: "Get Several Spotify Chapters",
|
|
2673
|
-
description: "Fetch multiple Spotify chapters in a single request.",
|
|
2674
|
-
input: severalChaptersInputSchema,
|
|
2675
|
-
output: severalChaptersOutputSchema,
|
|
2676
|
-
run: async (input, context) => {
|
|
2677
|
-
const credentials = context.credentials.spotify;
|
|
2678
|
-
return createSpotifyClient(credentials).chapters.getSeveralChapters(input.ids, input.market);
|
|
2679
|
-
}
|
|
2680
|
-
});
|
|
2681
|
-
|
|
2682
|
-
//#endregion
|
|
2683
|
-
//#region src/operations/get-spotify-several-episodes.operation.ts
|
|
2684
|
-
const severalEpisodeIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
2685
|
-
z.object({
|
|
2686
|
-
id: spotifyIdSchema,
|
|
2687
|
-
market: spotifyMarketSchema.optional()
|
|
2688
|
-
});
|
|
2689
|
-
const severalEpisodesInputSchema = z.object({
|
|
2690
|
-
ids: severalEpisodeIdsSchema,
|
|
2691
|
-
market: spotifyMarketSchema.optional()
|
|
2692
|
-
});
|
|
2693
|
-
const severalEpisodesOutputSchema = z.object({ episodes: z.array(spotifyEpisodeSchema) });
|
|
2694
|
-
const getSeveralEpisodesOperation = new Operation({
|
|
2695
|
-
credentialSets: [spotifyCredentialSet],
|
|
2696
|
-
id: "spotify.get-spotify-several-episodes",
|
|
2697
|
-
name: "Get Several Spotify Episodes",
|
|
2698
|
-
description: "Fetch multiple Spotify episodes in a single request.",
|
|
2699
|
-
input: severalEpisodesInputSchema,
|
|
2700
|
-
output: severalEpisodesOutputSchema,
|
|
2701
|
-
run: async (input, context) => {
|
|
2702
|
-
const credentials = context.credentials.spotify;
|
|
2703
|
-
return createSpotifyClient(credentials).episodes.getSeveralEpisodes(input.ids, input.market);
|
|
2704
|
-
}
|
|
2705
|
-
});
|
|
2706
|
-
|
|
2707
|
-
//#endregion
|
|
2708
|
-
//#region src/operations/get-spotify-several-shows.operation.ts
|
|
2709
|
-
const spotifyManyIdsSchema$2 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2710
|
-
z.object({
|
|
2711
|
-
id: spotifyIdSchema,
|
|
2712
|
-
market: spotifyMarketSchema.optional()
|
|
2713
|
-
});
|
|
2714
|
-
const severalShowsInputSchema = z.object({
|
|
2715
|
-
ids: spotifyManyIdsSchema$2,
|
|
2716
|
-
market: spotifyMarketSchema.optional()
|
|
2717
|
-
});
|
|
2718
|
-
const severalShowsOutputSchema = z.object({ shows: z.array(spotifyShowSchema) });
|
|
2719
|
-
z.object({
|
|
2720
|
-
id: spotifyIdSchema,
|
|
2721
|
-
market: spotifyMarketSchema.optional(),
|
|
2722
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2723
|
-
offset: z.number().int().nonnegative().optional()
|
|
2724
|
-
});
|
|
2725
|
-
const getSeveralShowsOperation = new Operation({
|
|
2726
|
-
credentialSets: [spotifyCredentialSet],
|
|
2727
|
-
id: "spotify.get-spotify-several-shows",
|
|
2728
|
-
name: "Get Several Spotify Shows",
|
|
2729
|
-
description: "Fetch multiple Spotify shows in a single request.",
|
|
2730
|
-
input: severalShowsInputSchema,
|
|
2731
|
-
output: severalShowsOutputSchema,
|
|
2732
|
-
run: async (input, context) => {
|
|
2733
|
-
const credentials = context.credentials.spotify;
|
|
2734
|
-
return createSpotifyClient(credentials).shows.getSeveralShows(input.ids, input.market);
|
|
2735
|
-
}
|
|
2736
|
-
});
|
|
2737
|
-
|
|
2738
|
-
//#endregion
|
|
2739
|
-
//#region src/operations/get-spotify-several-tracks.operation.ts
|
|
2740
|
-
const trackIdListSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
2741
|
-
const severalTracksResponseSchema = z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
2742
|
-
const getSeveralTracksOperation = new Operation({
|
|
2743
|
-
credentialSets: [spotifyCredentialSet],
|
|
2744
|
-
id: "spotify.get-spotify-several-tracks",
|
|
2745
|
-
name: "Get Several Spotify Tracks",
|
|
2746
|
-
description: "Fetch multiple Spotify tracks in one request.",
|
|
2747
|
-
input: z.object({
|
|
2748
|
-
ids: trackIdListSchema,
|
|
2749
|
-
market: spotifyMarketSchema.optional()
|
|
2750
|
-
}),
|
|
2751
|
-
output: severalTracksResponseSchema,
|
|
2752
|
-
run: async (input, context) => {
|
|
2753
|
-
const credentials = context.credentials.spotify;
|
|
2754
|
-
return createSpotifyClient(credentials).tracks.getSeveralTracks(input.ids, input.market);
|
|
2755
|
-
}
|
|
2756
|
-
});
|
|
2757
|
-
|
|
2758
|
-
//#endregion
|
|
2759
|
-
//#region src/operations/get-spotify-show.operation.ts
|
|
2760
|
-
const spotifyManyIdsSchema$1 = z.array(spotifyIdSchema).min(1).max(50);
|
|
2761
|
-
const showLookupInputSchema = z.object({
|
|
2762
|
-
id: spotifyIdSchema,
|
|
2763
|
-
market: spotifyMarketSchema.optional()
|
|
2764
|
-
});
|
|
2765
|
-
z.object({
|
|
2766
|
-
ids: spotifyManyIdsSchema$1,
|
|
2767
|
-
market: spotifyMarketSchema.optional()
|
|
2768
|
-
});
|
|
2769
|
-
z.object({ shows: z.array(spotifyShowSchema) });
|
|
2770
|
-
z.object({
|
|
2771
|
-
id: spotifyIdSchema,
|
|
2772
|
-
market: spotifyMarketSchema.optional(),
|
|
2773
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2774
|
-
offset: z.number().int().nonnegative().optional()
|
|
2775
|
-
});
|
|
2776
|
-
const getShowOperation = new Operation({
|
|
2777
|
-
credentialSets: [spotifyCredentialSet],
|
|
2778
|
-
id: "spotify.get-spotify-show",
|
|
2779
|
-
name: "Get Spotify Show",
|
|
2780
|
-
description: "Fetch a single Spotify show by ID.",
|
|
2781
|
-
input: showLookupInputSchema,
|
|
2782
|
-
output: spotifyShowSchema,
|
|
2783
|
-
run: async (input, context) => {
|
|
2784
|
-
const credentials = context.credentials.spotify;
|
|
2785
|
-
return createSpotifyClient(credentials).shows.getShow(input.id, input.market);
|
|
2786
|
-
}
|
|
2787
|
-
});
|
|
2788
|
-
|
|
2789
|
-
//#endregion
|
|
2790
|
-
//#region src/operations/get-spotify-show-episodes.operation.ts
|
|
2791
|
-
const spotifyManyIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
2792
|
-
z.object({
|
|
2793
|
-
id: spotifyIdSchema,
|
|
2794
|
-
market: spotifyMarketSchema.optional()
|
|
2795
|
-
});
|
|
2796
|
-
z.object({
|
|
2797
|
-
ids: spotifyManyIdsSchema,
|
|
2798
|
-
market: spotifyMarketSchema.optional()
|
|
2799
|
-
});
|
|
2800
|
-
z.object({ shows: z.array(spotifyShowSchema) });
|
|
2801
|
-
const showEpisodesInputSchema = z.object({
|
|
2802
|
-
id: spotifyIdSchema,
|
|
2803
|
-
market: spotifyMarketSchema.optional(),
|
|
2804
|
-
limit: z.number().int().min(1).max(50).optional(),
|
|
2805
|
-
offset: z.number().int().nonnegative().optional()
|
|
2806
|
-
});
|
|
2807
|
-
const getShowEpisodesOperation = new Operation({
|
|
2808
|
-
credentialSets: [spotifyCredentialSet],
|
|
2809
|
-
id: "spotify.get-spotify-show-episodes",
|
|
2810
|
-
name: "Get Spotify Show Episodes",
|
|
2811
|
-
description: "List episodes for a Spotify show.",
|
|
2812
|
-
input: showEpisodesInputSchema,
|
|
2813
|
-
output: spotifyEpisodePageSchema,
|
|
2814
|
-
run: async (input, context) => {
|
|
2815
|
-
const credentials = context.credentials.spotify;
|
|
2816
|
-
return createSpotifyClient(credentials).shows.getShowEpisodes(input.id, {
|
|
2817
|
-
market: input.market,
|
|
2818
|
-
limit: input.limit,
|
|
2819
|
-
offset: input.offset
|
|
2820
|
-
});
|
|
2821
|
-
}
|
|
2822
|
-
});
|
|
2823
|
-
|
|
2824
|
-
//#endregion
|
|
2825
|
-
//#region src/operations/get-spotify-track.operation.ts
|
|
2826
|
-
z.array(spotifyIdSchema).min(1).max(50);
|
|
2827
|
-
z.object({ tracks: z.array(spotifyTrackSchema) });
|
|
2828
|
-
const getTrackOperation = new Operation({
|
|
2829
|
-
credentialSets: [spotifyCredentialSet],
|
|
2830
|
-
id: "spotify.get-spotify-track",
|
|
2831
|
-
name: "Get Spotify Track",
|
|
2832
|
-
description: "Fetch a Spotify track by its ID.",
|
|
2833
|
-
input: z.object({
|
|
2834
|
-
id: spotifyIdSchema,
|
|
2835
|
-
market: spotifyMarketSchema.optional()
|
|
2836
|
-
}),
|
|
2837
|
-
output: spotifyTrackSchema,
|
|
2838
|
-
run: async (input, context) => {
|
|
2839
|
-
const credentials = context.credentials.spotify;
|
|
2840
|
-
return createSpotifyClient(credentials).tracks.getTrack(input.id, input.market);
|
|
2841
|
-
}
|
|
2842
|
-
});
|
|
2843
|
-
|
|
2844
|
-
//#endregion
|
|
2845
|
-
//#region src/operations/get-spotify-user.operation.ts
|
|
2846
|
-
const userLookupInputSchema = z.object({ id: spotifyIdSchema });
|
|
2847
|
-
const getUserOperation = new Operation({
|
|
2848
|
-
credentialSets: [spotifyCredentialSet],
|
|
2849
|
-
id: "spotify.get-spotify-user",
|
|
2850
|
-
name: "Get Spotify User",
|
|
2851
|
-
description: "Fetch a Spotify user profile by user ID.",
|
|
2852
|
-
input: userLookupInputSchema,
|
|
2853
|
-
output: spotifyUserSchema,
|
|
2854
|
-
run: async (input, context) => {
|
|
2855
|
-
const credentials = context.credentials.spotify;
|
|
2856
|
-
return createSpotifyClient(credentials).users.getUser(input.id);
|
|
2857
|
-
}
|
|
2858
|
-
});
|
|
2859
|
-
|
|
2860
|
-
//#endregion
|
|
2861
|
-
//#region src/operations/list-my-playlists.operation.ts
|
|
2862
|
-
const playlistPaginationInputSchema$6 = z.object({
|
|
2863
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2864
|
-
offset: z.number().int().nonnegative().optional()
|
|
2865
|
-
});
|
|
2866
|
-
const playlistIdInputSchema$6 = z.object({ playlistId: spotifyIdSchema });
|
|
2867
|
-
const playlistAdditionalTypeSchema$6 = z.enum(["track", "episode"]);
|
|
2868
|
-
z.object({
|
|
2869
|
-
name: z.string().trim().min(1),
|
|
2870
|
-
public: z.boolean().optional(),
|
|
2871
|
-
collaborative: z.boolean().optional(),
|
|
2872
|
-
description: z.string().optional()
|
|
2873
|
-
});
|
|
2874
|
-
const getPlaylistInputSchema$6 = playlistIdInputSchema$6.extend({
|
|
2875
|
-
market: spotifyMarketSchema.optional(),
|
|
2876
|
-
fields: z.string().trim().min(1).optional(),
|
|
2877
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$6).min(1).optional()
|
|
2878
|
-
});
|
|
2879
|
-
playlistIdInputSchema$6.extend({
|
|
2880
|
-
name: z.string().trim().min(1).optional(),
|
|
2881
|
-
public: z.boolean().optional(),
|
|
2882
|
-
collaborative: z.boolean().optional(),
|
|
2883
|
-
description: z.string().optional()
|
|
2884
|
-
});
|
|
2885
|
-
getPlaylistInputSchema$6.extend({
|
|
2886
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
2887
|
-
offset: z.number().int().nonnegative().optional()
|
|
2888
|
-
});
|
|
2889
|
-
playlistIdInputSchema$6.extend({
|
|
2890
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
2891
|
-
position: z.number().int().nonnegative().optional()
|
|
2892
|
-
});
|
|
2893
|
-
playlistIdInputSchema$6.extend({
|
|
2894
|
-
mode: z.literal("reorder"),
|
|
2895
|
-
rangeStart: z.number().int().nonnegative(),
|
|
2896
|
-
insertBefore: z.number().int().nonnegative(),
|
|
2897
|
-
rangeLength: z.number().int().positive().optional(),
|
|
2898
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
2899
|
-
});
|
|
2900
|
-
playlistIdInputSchema$6.extend({
|
|
2901
|
-
mode: z.literal("replace"),
|
|
2902
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
2903
|
-
});
|
|
2904
|
-
const playlistTrackRemovalSchema$6 = z.object({
|
|
2905
|
-
uri: spotifyUriSchema,
|
|
2906
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
2907
|
-
});
|
|
2908
|
-
playlistIdInputSchema$6.extend({
|
|
2909
|
-
tracks: z.array(playlistTrackRemovalSchema$6).min(1).max(100),
|
|
2910
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
2911
|
-
});
|
|
2912
|
-
playlistPaginationInputSchema$6.extend({ userId: spotifyIdSchema });
|
|
2913
|
-
playlistIdInputSchema$6.extend({ public: z.boolean().optional() });
|
|
2914
|
-
playlistIdInputSchema$6.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
2915
|
-
playlistIdInputSchema$6.extend({ imageBase64: z.string().trim().min(1) });
|
|
2916
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
2917
|
-
const listMyPlaylistsOperation = new Operation({
|
|
2918
|
-
credentialSets: [spotifyCredentialSet],
|
|
2919
|
-
id: "spotify.list-my-playlists",
|
|
2920
|
-
name: "List My Playlists",
|
|
2921
|
-
description: "List Spotify playlists owned or followed by the connected account.",
|
|
2922
|
-
input: playlistPaginationInputSchema$6,
|
|
2923
|
-
output: spotifyPlaylistPageSchema,
|
|
2924
|
-
run: async (input, context) => {
|
|
2925
|
-
const credentials = context.credentials.spotify;
|
|
2926
|
-
return createSpotifyClient(credentials).playlists.listMyPlaylists(input);
|
|
2927
|
-
}
|
|
2928
|
-
});
|
|
2929
|
-
|
|
2930
|
-
//#endregion
|
|
2931
|
-
//#region src/operations/list-saved-albums.operation.ts
|
|
2932
|
-
const marketOffsetPaginationInputSchema$2 = z.object({
|
|
2933
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2934
|
-
offset: z.number().int().nonnegative().optional()
|
|
2935
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
2936
|
-
z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
2937
|
-
const listSavedAlbumsOperation = new Operation({
|
|
2938
|
-
credentialSets: [spotifyCredentialSet],
|
|
2939
|
-
id: "spotify.list-saved-albums",
|
|
2940
|
-
name: "List Saved Albums",
|
|
2941
|
-
description: "List albums saved in the connected Spotify account library.",
|
|
2942
|
-
input: marketOffsetPaginationInputSchema$2,
|
|
2943
|
-
output: spotifySavedAlbumPageSchema,
|
|
2944
|
-
run: async (input, context) => {
|
|
2945
|
-
const credentials = context.credentials.spotify;
|
|
2946
|
-
return createSpotifyClient(credentials).library.listSavedAlbums(input);
|
|
2947
|
-
}
|
|
2948
|
-
});
|
|
2949
|
-
|
|
2950
|
-
//#endregion
|
|
2951
|
-
//#region src/operations/list-saved-audiobooks.operation.ts
|
|
2952
|
-
const offsetPaginationInputSchema$1 = z.object({
|
|
2953
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2954
|
-
offset: z.number().int().nonnegative().optional()
|
|
2955
|
-
});
|
|
2956
|
-
offsetPaginationInputSchema$1.extend({ market: spotifyMarketSchema.optional() });
|
|
2957
|
-
z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
2958
|
-
const listSavedAudiobooksOperation = new Operation({
|
|
2959
|
-
credentialSets: [spotifyCredentialSet],
|
|
2960
|
-
id: "spotify.list-saved-audiobooks",
|
|
2961
|
-
name: "List Saved Audiobooks",
|
|
2962
|
-
description: "List audiobooks saved in the connected Spotify account library.",
|
|
2963
|
-
input: offsetPaginationInputSchema$1,
|
|
2964
|
-
output: spotifySavedAudiobookPageSchema,
|
|
2965
|
-
run: async (input, context) => {
|
|
2966
|
-
const credentials = context.credentials.spotify;
|
|
2967
|
-
return createSpotifyClient(credentials).library.listSavedAudiobooks(input);
|
|
2968
|
-
}
|
|
2969
|
-
});
|
|
2970
|
-
|
|
2971
|
-
//#endregion
|
|
2972
|
-
//#region src/operations/list-saved-episodes.operation.ts
|
|
2973
|
-
const marketOffsetPaginationInputSchema$1 = z.object({
|
|
2974
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2975
|
-
offset: z.number().int().nonnegative().optional()
|
|
2976
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
2977
|
-
z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
2978
|
-
const listSavedEpisodesOperation = new Operation({
|
|
2979
|
-
credentialSets: [spotifyCredentialSet],
|
|
2980
|
-
id: "spotify.list-saved-episodes",
|
|
2981
|
-
name: "List Saved Episodes",
|
|
2982
|
-
description: "List episodes saved in the connected Spotify account library.",
|
|
2983
|
-
input: marketOffsetPaginationInputSchema$1,
|
|
2984
|
-
output: spotifySavedEpisodePageSchema,
|
|
2985
|
-
run: async (input, context) => {
|
|
2986
|
-
const credentials = context.credentials.spotify;
|
|
2987
|
-
return createSpotifyClient(credentials).library.listSavedEpisodes(input);
|
|
2988
|
-
}
|
|
2989
|
-
});
|
|
2990
|
-
|
|
2991
|
-
//#endregion
|
|
2992
|
-
//#region src/operations/list-saved-shows.operation.ts
|
|
2993
|
-
const offsetPaginationInputSchema = z.object({
|
|
2994
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
2995
|
-
offset: z.number().int().nonnegative().optional()
|
|
2996
|
-
});
|
|
2997
|
-
offsetPaginationInputSchema.extend({ market: spotifyMarketSchema.optional() });
|
|
2998
|
-
z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
2999
|
-
const listSavedShowsOperation = new Operation({
|
|
3000
|
-
credentialSets: [spotifyCredentialSet],
|
|
3001
|
-
id: "spotify.list-saved-shows",
|
|
3002
|
-
name: "List Saved Shows",
|
|
3003
|
-
description: "List shows saved in the connected Spotify account library.",
|
|
3004
|
-
input: offsetPaginationInputSchema,
|
|
3005
|
-
output: spotifySavedShowPageSchema,
|
|
3006
|
-
run: async (input, context) => {
|
|
3007
|
-
const credentials = context.credentials.spotify;
|
|
3008
|
-
return createSpotifyClient(credentials).library.listSavedShows(input);
|
|
3009
|
-
}
|
|
3010
|
-
});
|
|
3011
|
-
|
|
3012
|
-
//#endregion
|
|
3013
|
-
//#region src/operations/list-saved-tracks.operation.ts
|
|
3014
|
-
const marketOffsetPaginationInputSchema = z.object({
|
|
3015
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3016
|
-
offset: z.number().int().nonnegative().optional()
|
|
3017
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3018
|
-
z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3019
|
-
const listSavedTracksOperation = new Operation({
|
|
3020
|
-
credentialSets: [spotifyCredentialSet],
|
|
3021
|
-
id: "spotify.list-saved-tracks",
|
|
3022
|
-
name: "List Saved Tracks",
|
|
3023
|
-
description: "List tracks saved in the connected Spotify account library.",
|
|
3024
|
-
input: marketOffsetPaginationInputSchema,
|
|
3025
|
-
output: spotifySavedTrackPageSchema,
|
|
3026
|
-
run: async (input, context) => {
|
|
3027
|
-
const credentials = context.credentials.spotify;
|
|
3028
|
-
return createSpotifyClient(credentials).library.listSavedTracks(input);
|
|
3029
|
-
}
|
|
3030
|
-
});
|
|
3031
|
-
|
|
3032
|
-
//#endregion
|
|
3033
|
-
//#region src/operations/list-user-playlists.operation.ts
|
|
3034
|
-
const playlistPaginationInputSchema$5 = z.object({
|
|
3035
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3036
|
-
offset: z.number().int().nonnegative().optional()
|
|
3037
|
-
});
|
|
3038
|
-
const playlistIdInputSchema$5 = z.object({ playlistId: spotifyIdSchema });
|
|
3039
|
-
const playlistAdditionalTypeSchema$5 = z.enum(["track", "episode"]);
|
|
3040
|
-
z.object({
|
|
3041
|
-
name: z.string().trim().min(1),
|
|
3042
|
-
public: z.boolean().optional(),
|
|
3043
|
-
collaborative: z.boolean().optional(),
|
|
3044
|
-
description: z.string().optional()
|
|
3045
|
-
});
|
|
3046
|
-
const getPlaylistInputSchema$5 = playlistIdInputSchema$5.extend({
|
|
3047
|
-
market: spotifyMarketSchema.optional(),
|
|
3048
|
-
fields: z.string().trim().min(1).optional(),
|
|
3049
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$5).min(1).optional()
|
|
3050
|
-
});
|
|
3051
|
-
playlistIdInputSchema$5.extend({
|
|
3052
|
-
name: z.string().trim().min(1).optional(),
|
|
3053
|
-
public: z.boolean().optional(),
|
|
3054
|
-
collaborative: z.boolean().optional(),
|
|
3055
|
-
description: z.string().optional()
|
|
3056
|
-
});
|
|
3057
|
-
getPlaylistInputSchema$5.extend({
|
|
3058
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
3059
|
-
offset: z.number().int().nonnegative().optional()
|
|
3060
|
-
});
|
|
3061
|
-
playlistIdInputSchema$5.extend({
|
|
3062
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
3063
|
-
position: z.number().int().nonnegative().optional()
|
|
3064
|
-
});
|
|
3065
|
-
playlistIdInputSchema$5.extend({
|
|
3066
|
-
mode: z.literal("reorder"),
|
|
3067
|
-
rangeStart: z.number().int().nonnegative(),
|
|
3068
|
-
insertBefore: z.number().int().nonnegative(),
|
|
3069
|
-
rangeLength: z.number().int().positive().optional(),
|
|
3070
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
3071
|
-
});
|
|
3072
|
-
playlistIdInputSchema$5.extend({
|
|
3073
|
-
mode: z.literal("replace"),
|
|
3074
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
3075
|
-
});
|
|
3076
|
-
const playlistTrackRemovalSchema$5 = z.object({
|
|
3077
|
-
uri: spotifyUriSchema,
|
|
3078
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
3079
|
-
});
|
|
3080
|
-
playlistIdInputSchema$5.extend({
|
|
3081
|
-
tracks: z.array(playlistTrackRemovalSchema$5).min(1).max(100),
|
|
3082
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
3083
|
-
});
|
|
3084
|
-
const listUserPlaylistsInputSchema = playlistPaginationInputSchema$5.extend({ userId: spotifyIdSchema });
|
|
3085
|
-
playlistIdInputSchema$5.extend({ public: z.boolean().optional() });
|
|
3086
|
-
playlistIdInputSchema$5.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
3087
|
-
playlistIdInputSchema$5.extend({ imageBase64: z.string().trim().min(1) });
|
|
3088
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
3089
|
-
const listUserPlaylistsOperation = new Operation({
|
|
3090
|
-
credentialSets: [spotifyCredentialSet],
|
|
3091
|
-
id: "spotify.list-user-playlists",
|
|
3092
|
-
name: "List User Playlists",
|
|
3093
|
-
description: "List public Spotify playlists for a given user.",
|
|
3094
|
-
input: listUserPlaylistsInputSchema,
|
|
3095
|
-
output: spotifyPlaylistPageSchema,
|
|
3096
|
-
run: async (input, context) => {
|
|
3097
|
-
const credentials = context.credentials.spotify;
|
|
3098
|
-
return createSpotifyClient(credentials).playlists.listUserPlaylists(input.userId, {
|
|
3099
|
-
limit: input.limit,
|
|
3100
|
-
offset: input.offset
|
|
3101
|
-
});
|
|
3102
|
-
}
|
|
3103
|
-
});
|
|
3104
|
-
|
|
3105
|
-
//#endregion
|
|
3106
|
-
//#region src/operations/pause-playback.operation.ts
|
|
3107
|
-
z.object({});
|
|
3108
|
-
const playbackTypesSchema$8 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3109
|
-
const deviceIdSchema$8 = spotifyIdSchema.optional();
|
|
3110
|
-
z.object({
|
|
3111
|
-
market: spotifyMarketSchema.optional(),
|
|
3112
|
-
additionalTypes: playbackTypesSchema$8
|
|
3113
|
-
});
|
|
3114
|
-
z.object({
|
|
3115
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3116
|
-
play: z.boolean().optional()
|
|
3117
|
-
});
|
|
3118
|
-
const playbackOffsetSchema$8 = z.object({
|
|
3119
|
-
position: z.number().int().nonnegative().optional(),
|
|
3120
|
-
uri: spotifyUriSchema.optional()
|
|
3121
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3122
|
-
z.object({
|
|
3123
|
-
deviceId: deviceIdSchema$8,
|
|
3124
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3125
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3126
|
-
offset: playbackOffsetSchema$8.optional(),
|
|
3127
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3128
|
-
});
|
|
3129
|
-
const withOptionalDeviceIdSchema$8 = z.object({ deviceId: deviceIdSchema$8 });
|
|
3130
|
-
withOptionalDeviceIdSchema$8.extend({ positionMs: z.number().int().nonnegative() });
|
|
3131
|
-
withOptionalDeviceIdSchema$8.extend({ state: z.enum([
|
|
3132
|
-
"track",
|
|
3133
|
-
"context",
|
|
3134
|
-
"off"
|
|
3135
|
-
]) });
|
|
3136
|
-
withOptionalDeviceIdSchema$8.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3137
|
-
withOptionalDeviceIdSchema$8.extend({ state: z.boolean() });
|
|
3138
|
-
z.object({
|
|
3139
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3140
|
-
after: z.number().int().nonnegative().optional(),
|
|
3141
|
-
before: z.number().int().nonnegative().optional()
|
|
3142
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3143
|
-
withOptionalDeviceIdSchema$8.extend({ uri: spotifyUriSchema });
|
|
3144
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3145
|
-
const pausePlaybackOperation = new Operation({
|
|
3146
|
-
credentialSets: [spotifyCredentialSet],
|
|
3147
|
-
id: "spotify.pause-playback",
|
|
3148
|
-
name: "Pause Playback",
|
|
3149
|
-
description: "Pause Spotify playback on the current or selected device.",
|
|
3150
|
-
input: withOptionalDeviceIdSchema$8,
|
|
3151
|
-
output: spotifyMutationSuccessSchema,
|
|
3152
|
-
needsApproval: true,
|
|
3153
|
-
run: async (input, context) => {
|
|
3154
|
-
const credentials = context.credentials.spotify;
|
|
3155
|
-
return createSpotifyClient(credentials).player.pausePlayback(input.deviceId);
|
|
3156
|
-
}
|
|
3157
|
-
});
|
|
3158
|
-
|
|
3159
|
-
//#endregion
|
|
3160
|
-
//#region src/operations/remove-items-from-playlist.operation.ts
|
|
3161
|
-
const playlistPaginationInputSchema$4 = z.object({
|
|
3162
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3163
|
-
offset: z.number().int().nonnegative().optional()
|
|
3164
|
-
});
|
|
3165
|
-
const playlistIdInputSchema$4 = z.object({ playlistId: spotifyIdSchema });
|
|
3166
|
-
const playlistAdditionalTypeSchema$4 = z.enum(["track", "episode"]);
|
|
3167
|
-
z.object({
|
|
3168
|
-
name: z.string().trim().min(1),
|
|
3169
|
-
public: z.boolean().optional(),
|
|
3170
|
-
collaborative: z.boolean().optional(),
|
|
3171
|
-
description: z.string().optional()
|
|
3172
|
-
});
|
|
3173
|
-
const getPlaylistInputSchema$4 = playlistIdInputSchema$4.extend({
|
|
3174
|
-
market: spotifyMarketSchema.optional(),
|
|
3175
|
-
fields: z.string().trim().min(1).optional(),
|
|
3176
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$4).min(1).optional()
|
|
3177
|
-
});
|
|
3178
|
-
playlistIdInputSchema$4.extend({
|
|
3179
|
-
name: z.string().trim().min(1).optional(),
|
|
3180
|
-
public: z.boolean().optional(),
|
|
3181
|
-
collaborative: z.boolean().optional(),
|
|
3182
|
-
description: z.string().optional()
|
|
3183
|
-
});
|
|
3184
|
-
getPlaylistInputSchema$4.extend({
|
|
3185
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
3186
|
-
offset: z.number().int().nonnegative().optional()
|
|
3187
|
-
});
|
|
3188
|
-
playlistIdInputSchema$4.extend({
|
|
3189
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
3190
|
-
position: z.number().int().nonnegative().optional()
|
|
3191
|
-
});
|
|
3192
|
-
playlistIdInputSchema$4.extend({
|
|
3193
|
-
mode: z.literal("reorder"),
|
|
3194
|
-
rangeStart: z.number().int().nonnegative(),
|
|
3195
|
-
insertBefore: z.number().int().nonnegative(),
|
|
3196
|
-
rangeLength: z.number().int().positive().optional(),
|
|
3197
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
3198
|
-
});
|
|
3199
|
-
playlistIdInputSchema$4.extend({
|
|
3200
|
-
mode: z.literal("replace"),
|
|
3201
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
3202
|
-
});
|
|
3203
|
-
const playlistTrackRemovalSchema$4 = z.object({
|
|
3204
|
-
uri: spotifyUriSchema,
|
|
3205
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
3206
|
-
});
|
|
3207
|
-
const removeItemsFromPlaylistInputSchema = playlistIdInputSchema$4.extend({
|
|
3208
|
-
tracks: z.array(playlistTrackRemovalSchema$4).min(1).max(100),
|
|
3209
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
3210
|
-
});
|
|
3211
|
-
playlistPaginationInputSchema$4.extend({ userId: spotifyIdSchema });
|
|
3212
|
-
playlistIdInputSchema$4.extend({ public: z.boolean().optional() });
|
|
3213
|
-
playlistIdInputSchema$4.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
3214
|
-
playlistIdInputSchema$4.extend({ imageBase64: z.string().trim().min(1) });
|
|
3215
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
3216
|
-
const removeItemsFromPlaylistOperation = new Operation({
|
|
3217
|
-
credentialSets: [spotifyCredentialSet],
|
|
3218
|
-
id: "spotify.remove-items-from-playlist",
|
|
3219
|
-
name: "Remove Items From Playlist",
|
|
3220
|
-
description: "Remove specific tracks or episodes from a Spotify playlist.",
|
|
3221
|
-
input: removeItemsFromPlaylistInputSchema,
|
|
3222
|
-
output: spotifySnapshotResponseSchema,
|
|
3223
|
-
needsApproval: true,
|
|
3224
|
-
run: async (input, context) => {
|
|
3225
|
-
const credentials = context.credentials.spotify;
|
|
3226
|
-
return createSpotifyClient(credentials).playlists.removeItemsFromPlaylist(input.playlistId, {
|
|
3227
|
-
tracks: input.tracks,
|
|
3228
|
-
snapshotId: input.snapshotId
|
|
3229
|
-
});
|
|
3230
|
-
}
|
|
3231
|
-
});
|
|
3232
|
-
|
|
3233
|
-
//#endregion
|
|
3234
|
-
//#region src/operations/remove-saved-albums.operation.ts
|
|
3235
|
-
z.object({
|
|
3236
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3237
|
-
offset: z.number().int().nonnegative().optional()
|
|
3238
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3239
|
-
const savedItemIdsInputSchema$9 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3240
|
-
const removeSavedAlbumsOperation = new Operation({
|
|
3241
|
-
credentialSets: [spotifyCredentialSet],
|
|
3242
|
-
id: "spotify.remove-saved-albums",
|
|
3243
|
-
name: "Remove Saved Albums",
|
|
3244
|
-
description: "Remove saved albums from the connected Spotify account library.",
|
|
3245
|
-
input: savedItemIdsInputSchema$9,
|
|
3246
|
-
output: spotifyMutationSuccessSchema,
|
|
3247
|
-
needsApproval: true,
|
|
3248
|
-
run: async (input, context) => {
|
|
3249
|
-
const credentials = context.credentials.spotify;
|
|
3250
|
-
return createSpotifyClient(credentials).library.removeSavedAlbums(input.ids);
|
|
3251
|
-
}
|
|
3252
|
-
});
|
|
3253
|
-
|
|
3254
|
-
//#endregion
|
|
3255
|
-
//#region src/operations/remove-saved-audiobooks.operation.ts
|
|
3256
|
-
z.object({
|
|
3257
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3258
|
-
offset: z.number().int().nonnegative().optional()
|
|
3259
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3260
|
-
const savedItemIdsInputSchema$8 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3261
|
-
const removeSavedAudiobooksOperation = new Operation({
|
|
3262
|
-
credentialSets: [spotifyCredentialSet],
|
|
3263
|
-
id: "spotify.remove-saved-audiobooks",
|
|
3264
|
-
name: "Remove Saved Audiobooks",
|
|
3265
|
-
description: "Remove saved audiobooks from the connected Spotify account library.",
|
|
3266
|
-
input: savedItemIdsInputSchema$8,
|
|
3267
|
-
output: spotifyMutationSuccessSchema,
|
|
3268
|
-
needsApproval: true,
|
|
3269
|
-
run: async (input, context) => {
|
|
3270
|
-
const credentials = context.credentials.spotify;
|
|
3271
|
-
return createSpotifyClient(credentials).library.removeSavedAudiobooks(input.ids);
|
|
3272
|
-
}
|
|
3273
|
-
});
|
|
3274
|
-
|
|
3275
|
-
//#endregion
|
|
3276
|
-
//#region src/operations/remove-saved-episodes.operation.ts
|
|
3277
|
-
z.object({
|
|
3278
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3279
|
-
offset: z.number().int().nonnegative().optional()
|
|
3280
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3281
|
-
const savedItemIdsInputSchema$7 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3282
|
-
const removeSavedEpisodesOperation = new Operation({
|
|
3283
|
-
credentialSets: [spotifyCredentialSet],
|
|
3284
|
-
id: "spotify.remove-saved-episodes",
|
|
3285
|
-
name: "Remove Saved Episodes",
|
|
3286
|
-
description: "Remove saved episodes from the connected Spotify account library.",
|
|
3287
|
-
input: savedItemIdsInputSchema$7,
|
|
3288
|
-
output: spotifyMutationSuccessSchema,
|
|
3289
|
-
needsApproval: true,
|
|
3290
|
-
run: async (input, context) => {
|
|
3291
|
-
const credentials = context.credentials.spotify;
|
|
3292
|
-
return createSpotifyClient(credentials).library.removeSavedEpisodes(input.ids);
|
|
3293
|
-
}
|
|
3294
|
-
});
|
|
3295
|
-
|
|
3296
|
-
//#endregion
|
|
3297
|
-
//#region src/operations/remove-saved-shows.operation.ts
|
|
3298
|
-
z.object({
|
|
3299
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3300
|
-
offset: z.number().int().nonnegative().optional()
|
|
3301
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3302
|
-
const savedItemIdsInputSchema$6 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3303
|
-
const removeSavedShowsOperation = new Operation({
|
|
3304
|
-
credentialSets: [spotifyCredentialSet],
|
|
3305
|
-
id: "spotify.remove-saved-shows",
|
|
3306
|
-
name: "Remove Saved Shows",
|
|
3307
|
-
description: "Remove saved shows from the connected Spotify account library.",
|
|
3308
|
-
input: savedItemIdsInputSchema$6,
|
|
3309
|
-
output: spotifyMutationSuccessSchema,
|
|
3310
|
-
needsApproval: true,
|
|
3311
|
-
run: async (input, context) => {
|
|
3312
|
-
const credentials = context.credentials.spotify;
|
|
3313
|
-
return createSpotifyClient(credentials).library.removeSavedShows(input.ids);
|
|
3314
|
-
}
|
|
3315
|
-
});
|
|
3316
|
-
|
|
3317
|
-
//#endregion
|
|
3318
|
-
//#region src/operations/remove-saved-tracks.operation.ts
|
|
3319
|
-
z.object({
|
|
3320
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3321
|
-
offset: z.number().int().nonnegative().optional()
|
|
3322
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3323
|
-
const savedItemIdsInputSchema$5 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3324
|
-
const removeSavedTracksOperation = new Operation({
|
|
3325
|
-
credentialSets: [spotifyCredentialSet],
|
|
3326
|
-
id: "spotify.remove-saved-tracks",
|
|
3327
|
-
name: "Remove Saved Tracks",
|
|
3328
|
-
description: "Remove saved tracks from the connected Spotify account library.",
|
|
3329
|
-
input: savedItemIdsInputSchema$5,
|
|
3330
|
-
output: spotifyMutationSuccessSchema,
|
|
3331
|
-
needsApproval: true,
|
|
3332
|
-
run: async (input, context) => {
|
|
3333
|
-
const credentials = context.credentials.spotify;
|
|
3334
|
-
return createSpotifyClient(credentials).library.removeSavedTracks(input.ids);
|
|
3335
|
-
}
|
|
3336
|
-
});
|
|
3337
|
-
|
|
3338
|
-
//#endregion
|
|
3339
|
-
//#region src/operations/reorder-or-replace-playlist-items.operation.ts
|
|
3340
|
-
const playlistPaginationInputSchema$3 = z.object({
|
|
3341
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3342
|
-
offset: z.number().int().nonnegative().optional()
|
|
3343
|
-
});
|
|
3344
|
-
const playlistIdInputSchema$3 = z.object({ playlistId: spotifyIdSchema });
|
|
3345
|
-
const playlistAdditionalTypeSchema$3 = z.enum(["track", "episode"]);
|
|
3346
|
-
z.object({
|
|
3347
|
-
name: z.string().trim().min(1),
|
|
3348
|
-
public: z.boolean().optional(),
|
|
3349
|
-
collaborative: z.boolean().optional(),
|
|
3350
|
-
description: z.string().optional()
|
|
3351
|
-
});
|
|
3352
|
-
const getPlaylistInputSchema$3 = playlistIdInputSchema$3.extend({
|
|
3353
|
-
market: spotifyMarketSchema.optional(),
|
|
3354
|
-
fields: z.string().trim().min(1).optional(),
|
|
3355
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$3).min(1).optional()
|
|
3356
|
-
});
|
|
3357
|
-
playlistIdInputSchema$3.extend({
|
|
3358
|
-
name: z.string().trim().min(1).optional(),
|
|
3359
|
-
public: z.boolean().optional(),
|
|
3360
|
-
collaborative: z.boolean().optional(),
|
|
3361
|
-
description: z.string().optional()
|
|
3362
|
-
});
|
|
3363
|
-
getPlaylistInputSchema$3.extend({
|
|
3364
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
3365
|
-
offset: z.number().int().nonnegative().optional()
|
|
3366
|
-
});
|
|
3367
|
-
playlistIdInputSchema$3.extend({
|
|
3368
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
3369
|
-
position: z.number().int().nonnegative().optional()
|
|
3370
|
-
});
|
|
3371
|
-
const reorderPlaylistItemsInputSchema = playlistIdInputSchema$3.extend({
|
|
3372
|
-
mode: z.literal("reorder"),
|
|
3373
|
-
rangeStart: z.number().int().nonnegative(),
|
|
3374
|
-
insertBefore: z.number().int().nonnegative(),
|
|
3375
|
-
rangeLength: z.number().int().positive().optional(),
|
|
3376
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
3377
|
-
});
|
|
3378
|
-
const replacePlaylistItemsInputSchema = playlistIdInputSchema$3.extend({
|
|
3379
|
-
mode: z.literal("replace"),
|
|
3380
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
3381
|
-
});
|
|
3382
|
-
const playlistTrackRemovalSchema$3 = z.object({
|
|
3383
|
-
uri: spotifyUriSchema,
|
|
3384
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
3385
|
-
});
|
|
3386
|
-
playlistIdInputSchema$3.extend({
|
|
3387
|
-
tracks: z.array(playlistTrackRemovalSchema$3).min(1).max(100),
|
|
3388
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
3389
|
-
});
|
|
3390
|
-
playlistPaginationInputSchema$3.extend({ userId: spotifyIdSchema });
|
|
3391
|
-
playlistIdInputSchema$3.extend({ public: z.boolean().optional() });
|
|
3392
|
-
playlistIdInputSchema$3.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
3393
|
-
playlistIdInputSchema$3.extend({ imageBase64: z.string().trim().min(1) });
|
|
3394
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
3395
|
-
const reorderOrReplacePlaylistItemsOperation = new Operation({
|
|
3396
|
-
credentialSets: [spotifyCredentialSet],
|
|
3397
|
-
id: "spotify.reorder-or-replace-playlist-items",
|
|
3398
|
-
name: "Reorder Or Replace Playlist Items",
|
|
3399
|
-
description: "Reorder existing playlist items or replace the full playlist contents.",
|
|
3400
|
-
input: z.discriminatedUnion("mode", [reorderPlaylistItemsInputSchema, replacePlaylistItemsInputSchema]),
|
|
3401
|
-
output: spotifySnapshotResponseSchema,
|
|
3402
|
-
needsApproval: true,
|
|
3403
|
-
run: async (input, context) => {
|
|
3404
|
-
const credentials = context.credentials.spotify;
|
|
3405
|
-
const client = createSpotifyClient(credentials);
|
|
3406
|
-
if (input.mode === "reorder") return client.playlists.reorderPlaylistItems(input.playlistId, {
|
|
3407
|
-
rangeStart: input.rangeStart,
|
|
3408
|
-
insertBefore: input.insertBefore,
|
|
3409
|
-
rangeLength: input.rangeLength,
|
|
3410
|
-
snapshotId: input.snapshotId
|
|
3411
|
-
});
|
|
3412
|
-
return client.playlists.replacePlaylistItems(input.playlistId, { uris: input.uris });
|
|
3413
|
-
}
|
|
3414
|
-
});
|
|
3415
|
-
|
|
3416
|
-
//#endregion
|
|
3417
|
-
//#region src/operations/save-albums.operation.ts
|
|
3418
|
-
z.object({
|
|
3419
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3420
|
-
offset: z.number().int().nonnegative().optional()
|
|
3421
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3422
|
-
const savedItemIdsInputSchema$4 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3423
|
-
const saveAlbumsOperation = new Operation({
|
|
3424
|
-
credentialSets: [spotifyCredentialSet],
|
|
3425
|
-
id: "spotify.save-albums",
|
|
3426
|
-
name: "Save Albums",
|
|
3427
|
-
description: "Save albums to the connected Spotify account library.",
|
|
3428
|
-
input: savedItemIdsInputSchema$4,
|
|
3429
|
-
output: spotifyMutationSuccessSchema,
|
|
3430
|
-
needsApproval: true,
|
|
3431
|
-
run: async (input, context) => {
|
|
3432
|
-
const credentials = context.credentials.spotify;
|
|
3433
|
-
return createSpotifyClient(credentials).library.saveAlbums(input.ids);
|
|
3434
|
-
}
|
|
3435
|
-
});
|
|
3436
|
-
|
|
3437
|
-
//#endregion
|
|
3438
|
-
//#region src/operations/save-audiobooks.operation.ts
|
|
3439
|
-
z.object({
|
|
3440
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3441
|
-
offset: z.number().int().nonnegative().optional()
|
|
3442
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3443
|
-
const savedItemIdsInputSchema$3 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3444
|
-
const saveAudiobooksOperation = new Operation({
|
|
3445
|
-
credentialSets: [spotifyCredentialSet],
|
|
3446
|
-
id: "spotify.save-audiobooks",
|
|
3447
|
-
name: "Save Audiobooks",
|
|
3448
|
-
description: "Save audiobooks to the connected Spotify account library.",
|
|
3449
|
-
input: savedItemIdsInputSchema$3,
|
|
3450
|
-
output: spotifyMutationSuccessSchema,
|
|
3451
|
-
needsApproval: true,
|
|
3452
|
-
run: async (input, context) => {
|
|
3453
|
-
const credentials = context.credentials.spotify;
|
|
3454
|
-
return createSpotifyClient(credentials).library.saveAudiobooks(input.ids);
|
|
3455
|
-
}
|
|
3456
|
-
});
|
|
3457
|
-
|
|
3458
|
-
//#endregion
|
|
3459
|
-
//#region src/operations/save-episodes.operation.ts
|
|
3460
|
-
z.object({
|
|
3461
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3462
|
-
offset: z.number().int().nonnegative().optional()
|
|
3463
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3464
|
-
const savedItemIdsInputSchema$2 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3465
|
-
const saveEpisodesOperation = new Operation({
|
|
3466
|
-
credentialSets: [spotifyCredentialSet],
|
|
3467
|
-
id: "spotify.save-episodes",
|
|
3468
|
-
name: "Save Episodes",
|
|
3469
|
-
description: "Save episodes to the connected Spotify account library.",
|
|
3470
|
-
input: savedItemIdsInputSchema$2,
|
|
3471
|
-
output: spotifyMutationSuccessSchema,
|
|
3472
|
-
needsApproval: true,
|
|
3473
|
-
run: async (input, context) => {
|
|
3474
|
-
const credentials = context.credentials.spotify;
|
|
3475
|
-
return createSpotifyClient(credentials).library.saveEpisodes(input.ids);
|
|
3476
|
-
}
|
|
3477
|
-
});
|
|
3478
|
-
|
|
3479
|
-
//#endregion
|
|
3480
|
-
//#region src/operations/save-shows.operation.ts
|
|
3481
|
-
z.object({
|
|
3482
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3483
|
-
offset: z.number().int().nonnegative().optional()
|
|
3484
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3485
|
-
const savedItemIdsInputSchema$1 = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3486
|
-
const saveShowsOperation = new Operation({
|
|
3487
|
-
credentialSets: [spotifyCredentialSet],
|
|
3488
|
-
id: "spotify.save-shows",
|
|
3489
|
-
name: "Save Shows",
|
|
3490
|
-
description: "Save shows to the connected Spotify account library.",
|
|
3491
|
-
input: savedItemIdsInputSchema$1,
|
|
3492
|
-
output: spotifyMutationSuccessSchema,
|
|
3493
|
-
needsApproval: true,
|
|
3494
|
-
run: async (input, context) => {
|
|
3495
|
-
const credentials = context.credentials.spotify;
|
|
3496
|
-
return createSpotifyClient(credentials).library.saveShows(input.ids);
|
|
3497
|
-
}
|
|
3498
|
-
});
|
|
3499
|
-
|
|
3500
|
-
//#endregion
|
|
3501
|
-
//#region src/operations/save-tracks.operation.ts
|
|
3502
|
-
z.object({
|
|
3503
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3504
|
-
offset: z.number().int().nonnegative().optional()
|
|
3505
|
-
}).extend({ market: spotifyMarketSchema.optional() });
|
|
3506
|
-
const savedItemIdsInputSchema = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
|
|
3507
|
-
const saveTracksOperation = new Operation({
|
|
3508
|
-
credentialSets: [spotifyCredentialSet],
|
|
3509
|
-
id: "spotify.save-tracks",
|
|
3510
|
-
name: "Save Tracks",
|
|
3511
|
-
description: "Save tracks to the connected Spotify account library.",
|
|
3512
|
-
input: savedItemIdsInputSchema,
|
|
3513
|
-
output: spotifyMutationSuccessSchema,
|
|
3514
|
-
needsApproval: true,
|
|
3515
|
-
run: async (input, context) => {
|
|
3516
|
-
const credentials = context.credentials.spotify;
|
|
3517
|
-
return createSpotifyClient(credentials).library.saveTracks(input.ids);
|
|
3518
|
-
}
|
|
3519
|
-
});
|
|
3520
|
-
|
|
3521
|
-
//#endregion
|
|
3522
|
-
//#region src/operations/search-spotify-catalog.operation.ts
|
|
3523
|
-
const spotifySearchTypeSchema = z.enum([
|
|
3524
|
-
"album",
|
|
3525
|
-
"artist",
|
|
3526
|
-
"playlist",
|
|
3527
|
-
"track",
|
|
3528
|
-
"show",
|
|
3529
|
-
"episode",
|
|
3530
|
-
"audiobook"
|
|
3531
|
-
]);
|
|
3532
|
-
const searchOperation = new Operation({
|
|
3533
|
-
credentialSets: [spotifyCredentialSet],
|
|
3534
|
-
id: "spotify.search-spotify-catalog",
|
|
3535
|
-
name: "Search Spotify Catalog",
|
|
3536
|
-
description: "Search the Spotify catalog across one or more resource types.",
|
|
3537
|
-
input: z.object({
|
|
3538
|
-
query: z.string().min(1),
|
|
3539
|
-
types: z.array(spotifySearchTypeSchema).min(1),
|
|
3540
|
-
market: spotifyMarketSchema.optional(),
|
|
3541
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3542
|
-
offset: z.number().int().nonnegative().optional(),
|
|
3543
|
-
includeExternalAudio: z.boolean().optional()
|
|
3544
|
-
}),
|
|
3545
|
-
output: spotifySearchResultSchema,
|
|
3546
|
-
run: async (input, context) => {
|
|
3547
|
-
const credentials = context.credentials.spotify;
|
|
3548
|
-
return createSpotifyClient(credentials).discovery.search({
|
|
3549
|
-
q: input.query,
|
|
3550
|
-
type: input.types,
|
|
3551
|
-
market: input.market,
|
|
3552
|
-
limit: input.limit,
|
|
3553
|
-
offset: input.offset,
|
|
3554
|
-
include_external: input.includeExternalAudio ? "audio" : void 0
|
|
3555
|
-
});
|
|
3556
|
-
}
|
|
3557
|
-
});
|
|
3558
|
-
|
|
3559
|
-
//#endregion
|
|
3560
|
-
//#region src/operations/seek-to-position.operation.ts
|
|
3561
|
-
z.object({});
|
|
3562
|
-
const playbackTypesSchema$7 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3563
|
-
const deviceIdSchema$7 = spotifyIdSchema.optional();
|
|
3564
|
-
z.object({
|
|
3565
|
-
market: spotifyMarketSchema.optional(),
|
|
3566
|
-
additionalTypes: playbackTypesSchema$7
|
|
3567
|
-
});
|
|
3568
|
-
z.object({
|
|
3569
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3570
|
-
play: z.boolean().optional()
|
|
3571
|
-
});
|
|
3572
|
-
const playbackOffsetSchema$7 = z.object({
|
|
3573
|
-
position: z.number().int().nonnegative().optional(),
|
|
3574
|
-
uri: spotifyUriSchema.optional()
|
|
3575
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3576
|
-
z.object({
|
|
3577
|
-
deviceId: deviceIdSchema$7,
|
|
3578
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3579
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3580
|
-
offset: playbackOffsetSchema$7.optional(),
|
|
3581
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3582
|
-
});
|
|
3583
|
-
const withOptionalDeviceIdSchema$7 = z.object({ deviceId: deviceIdSchema$7 });
|
|
3584
|
-
const seekToPositionInputSchema = withOptionalDeviceIdSchema$7.extend({ positionMs: z.number().int().nonnegative() });
|
|
3585
|
-
withOptionalDeviceIdSchema$7.extend({ state: z.enum([
|
|
3586
|
-
"track",
|
|
3587
|
-
"context",
|
|
3588
|
-
"off"
|
|
3589
|
-
]) });
|
|
3590
|
-
withOptionalDeviceIdSchema$7.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3591
|
-
withOptionalDeviceIdSchema$7.extend({ state: z.boolean() });
|
|
3592
|
-
z.object({
|
|
3593
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3594
|
-
after: z.number().int().nonnegative().optional(),
|
|
3595
|
-
before: z.number().int().nonnegative().optional()
|
|
3596
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3597
|
-
withOptionalDeviceIdSchema$7.extend({ uri: spotifyUriSchema });
|
|
3598
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3599
|
-
const seekToPositionOperation = new Operation({
|
|
3600
|
-
credentialSets: [spotifyCredentialSet],
|
|
3601
|
-
id: "spotify.seek-to-position",
|
|
3602
|
-
name: "Seek To Position",
|
|
3603
|
-
description: "Seek the currently playing Spotify item to a new playback position.",
|
|
3604
|
-
input: seekToPositionInputSchema,
|
|
3605
|
-
output: spotifyMutationSuccessSchema,
|
|
3606
|
-
needsApproval: true,
|
|
3607
|
-
run: async (input, context) => {
|
|
3608
|
-
const credentials = context.credentials.spotify;
|
|
3609
|
-
return createSpotifyClient(credentials).player.seekToPosition(input.positionMs, input.deviceId);
|
|
3610
|
-
}
|
|
3611
|
-
});
|
|
3612
|
-
|
|
3613
|
-
//#endregion
|
|
3614
|
-
//#region src/operations/set-playback-volume.operation.ts
|
|
3615
|
-
z.object({});
|
|
3616
|
-
const playbackTypesSchema$6 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3617
|
-
const deviceIdSchema$6 = spotifyIdSchema.optional();
|
|
3618
|
-
z.object({
|
|
3619
|
-
market: spotifyMarketSchema.optional(),
|
|
3620
|
-
additionalTypes: playbackTypesSchema$6
|
|
3621
|
-
});
|
|
3622
|
-
z.object({
|
|
3623
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3624
|
-
play: z.boolean().optional()
|
|
3625
|
-
});
|
|
3626
|
-
const playbackOffsetSchema$6 = z.object({
|
|
3627
|
-
position: z.number().int().nonnegative().optional(),
|
|
3628
|
-
uri: spotifyUriSchema.optional()
|
|
3629
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3630
|
-
z.object({
|
|
3631
|
-
deviceId: deviceIdSchema$6,
|
|
3632
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3633
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3634
|
-
offset: playbackOffsetSchema$6.optional(),
|
|
3635
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3636
|
-
});
|
|
3637
|
-
const withOptionalDeviceIdSchema$6 = z.object({ deviceId: deviceIdSchema$6 });
|
|
3638
|
-
withOptionalDeviceIdSchema$6.extend({ positionMs: z.number().int().nonnegative() });
|
|
3639
|
-
withOptionalDeviceIdSchema$6.extend({ state: z.enum([
|
|
3640
|
-
"track",
|
|
3641
|
-
"context",
|
|
3642
|
-
"off"
|
|
3643
|
-
]) });
|
|
3644
|
-
const playbackVolumeInputSchema = withOptionalDeviceIdSchema$6.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3645
|
-
withOptionalDeviceIdSchema$6.extend({ state: z.boolean() });
|
|
3646
|
-
z.object({
|
|
3647
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3648
|
-
after: z.number().int().nonnegative().optional(),
|
|
3649
|
-
before: z.number().int().nonnegative().optional()
|
|
3650
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3651
|
-
withOptionalDeviceIdSchema$6.extend({ uri: spotifyUriSchema });
|
|
3652
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3653
|
-
const setPlaybackVolumeOperation = new Operation({
|
|
3654
|
-
credentialSets: [spotifyCredentialSet],
|
|
3655
|
-
id: "spotify.set-playback-volume",
|
|
3656
|
-
name: "Set Playback Volume",
|
|
3657
|
-
description: "Set Spotify playback volume on the current or selected device.",
|
|
3658
|
-
input: playbackVolumeInputSchema,
|
|
3659
|
-
output: spotifyMutationSuccessSchema,
|
|
3660
|
-
needsApproval: true,
|
|
3661
|
-
run: async (input, context) => {
|
|
3662
|
-
const credentials = context.credentials.spotify;
|
|
3663
|
-
return createSpotifyClient(credentials).player.setPlaybackVolume(input.volumePercent, input.deviceId);
|
|
3664
|
-
}
|
|
3665
|
-
});
|
|
3666
|
-
|
|
3667
|
-
//#endregion
|
|
3668
|
-
//#region src/operations/set-repeat-mode.operation.ts
|
|
3669
|
-
z.object({});
|
|
3670
|
-
const playbackTypesSchema$5 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3671
|
-
const deviceIdSchema$5 = spotifyIdSchema.optional();
|
|
3672
|
-
z.object({
|
|
3673
|
-
market: spotifyMarketSchema.optional(),
|
|
3674
|
-
additionalTypes: playbackTypesSchema$5
|
|
3675
|
-
});
|
|
3676
|
-
z.object({
|
|
3677
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3678
|
-
play: z.boolean().optional()
|
|
3679
|
-
});
|
|
3680
|
-
const playbackOffsetSchema$5 = z.object({
|
|
3681
|
-
position: z.number().int().nonnegative().optional(),
|
|
3682
|
-
uri: spotifyUriSchema.optional()
|
|
3683
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3684
|
-
z.object({
|
|
3685
|
-
deviceId: deviceIdSchema$5,
|
|
3686
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3687
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3688
|
-
offset: playbackOffsetSchema$5.optional(),
|
|
3689
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3690
|
-
});
|
|
3691
|
-
const withOptionalDeviceIdSchema$5 = z.object({ deviceId: deviceIdSchema$5 });
|
|
3692
|
-
withOptionalDeviceIdSchema$5.extend({ positionMs: z.number().int().nonnegative() });
|
|
3693
|
-
const repeatModeInputSchema = withOptionalDeviceIdSchema$5.extend({ state: z.enum([
|
|
3694
|
-
"track",
|
|
3695
|
-
"context",
|
|
3696
|
-
"off"
|
|
3697
|
-
]) });
|
|
3698
|
-
withOptionalDeviceIdSchema$5.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3699
|
-
withOptionalDeviceIdSchema$5.extend({ state: z.boolean() });
|
|
3700
|
-
z.object({
|
|
3701
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3702
|
-
after: z.number().int().nonnegative().optional(),
|
|
3703
|
-
before: z.number().int().nonnegative().optional()
|
|
3704
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3705
|
-
withOptionalDeviceIdSchema$5.extend({ uri: spotifyUriSchema });
|
|
3706
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3707
|
-
const setRepeatModeOperation = new Operation({
|
|
3708
|
-
credentialSets: [spotifyCredentialSet],
|
|
3709
|
-
id: "spotify.set-repeat-mode",
|
|
3710
|
-
name: "Set Repeat Mode",
|
|
3711
|
-
description: "Set Spotify repeat mode for the current or selected device.",
|
|
3712
|
-
input: repeatModeInputSchema,
|
|
3713
|
-
output: spotifyMutationSuccessSchema,
|
|
3714
|
-
needsApproval: true,
|
|
3715
|
-
run: async (input, context) => {
|
|
3716
|
-
const credentials = context.credentials.spotify;
|
|
3717
|
-
return createSpotifyClient(credentials).player.setRepeatMode(input.state, input.deviceId);
|
|
3718
|
-
}
|
|
3719
|
-
});
|
|
3720
|
-
|
|
3721
|
-
//#endregion
|
|
3722
|
-
//#region src/operations/set-shuffle-mode.operation.ts
|
|
3723
|
-
z.object({});
|
|
3724
|
-
const playbackTypesSchema$4 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3725
|
-
const deviceIdSchema$4 = spotifyIdSchema.optional();
|
|
3726
|
-
z.object({
|
|
3727
|
-
market: spotifyMarketSchema.optional(),
|
|
3728
|
-
additionalTypes: playbackTypesSchema$4
|
|
3729
|
-
});
|
|
3730
|
-
z.object({
|
|
3731
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3732
|
-
play: z.boolean().optional()
|
|
3733
|
-
});
|
|
3734
|
-
const playbackOffsetSchema$4 = z.object({
|
|
3735
|
-
position: z.number().int().nonnegative().optional(),
|
|
3736
|
-
uri: spotifyUriSchema.optional()
|
|
3737
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3738
|
-
z.object({
|
|
3739
|
-
deviceId: deviceIdSchema$4,
|
|
3740
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3741
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3742
|
-
offset: playbackOffsetSchema$4.optional(),
|
|
3743
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3744
|
-
});
|
|
3745
|
-
const withOptionalDeviceIdSchema$4 = z.object({ deviceId: deviceIdSchema$4 });
|
|
3746
|
-
withOptionalDeviceIdSchema$4.extend({ positionMs: z.number().int().nonnegative() });
|
|
3747
|
-
withOptionalDeviceIdSchema$4.extend({ state: z.enum([
|
|
3748
|
-
"track",
|
|
3749
|
-
"context",
|
|
3750
|
-
"off"
|
|
3751
|
-
]) });
|
|
3752
|
-
withOptionalDeviceIdSchema$4.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3753
|
-
const shuffleModeInputSchema = withOptionalDeviceIdSchema$4.extend({ state: z.boolean() });
|
|
3754
|
-
z.object({
|
|
3755
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3756
|
-
after: z.number().int().nonnegative().optional(),
|
|
3757
|
-
before: z.number().int().nonnegative().optional()
|
|
3758
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3759
|
-
withOptionalDeviceIdSchema$4.extend({ uri: spotifyUriSchema });
|
|
3760
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3761
|
-
const setShuffleModeOperation = new Operation({
|
|
3762
|
-
credentialSets: [spotifyCredentialSet],
|
|
3763
|
-
id: "spotify.set-shuffle-mode",
|
|
3764
|
-
name: "Set Shuffle Mode",
|
|
3765
|
-
description: "Enable or disable Spotify shuffle mode.",
|
|
3766
|
-
input: shuffleModeInputSchema,
|
|
3767
|
-
output: spotifyMutationSuccessSchema,
|
|
3768
|
-
needsApproval: true,
|
|
3769
|
-
run: async (input, context) => {
|
|
3770
|
-
const credentials = context.credentials.spotify;
|
|
3771
|
-
return createSpotifyClient(credentials).player.setShuffleMode(input.state, input.deviceId);
|
|
3772
|
-
}
|
|
3773
|
-
});
|
|
3774
|
-
|
|
3775
|
-
//#endregion
|
|
3776
|
-
//#region src/operations/skip-to-next.operation.ts
|
|
3777
|
-
z.object({});
|
|
3778
|
-
const playbackTypesSchema$3 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3779
|
-
const deviceIdSchema$3 = spotifyIdSchema.optional();
|
|
3780
|
-
z.object({
|
|
3781
|
-
market: spotifyMarketSchema.optional(),
|
|
3782
|
-
additionalTypes: playbackTypesSchema$3
|
|
3783
|
-
});
|
|
3784
|
-
z.object({
|
|
3785
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3786
|
-
play: z.boolean().optional()
|
|
3787
|
-
});
|
|
3788
|
-
const playbackOffsetSchema$3 = z.object({
|
|
3789
|
-
position: z.number().int().nonnegative().optional(),
|
|
3790
|
-
uri: spotifyUriSchema.optional()
|
|
3791
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3792
|
-
z.object({
|
|
3793
|
-
deviceId: deviceIdSchema$3,
|
|
3794
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3795
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3796
|
-
offset: playbackOffsetSchema$3.optional(),
|
|
3797
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3798
|
-
});
|
|
3799
|
-
const withOptionalDeviceIdSchema$3 = z.object({ deviceId: deviceIdSchema$3 });
|
|
3800
|
-
withOptionalDeviceIdSchema$3.extend({ positionMs: z.number().int().nonnegative() });
|
|
3801
|
-
withOptionalDeviceIdSchema$3.extend({ state: z.enum([
|
|
3802
|
-
"track",
|
|
3803
|
-
"context",
|
|
3804
|
-
"off"
|
|
3805
|
-
]) });
|
|
3806
|
-
withOptionalDeviceIdSchema$3.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3807
|
-
withOptionalDeviceIdSchema$3.extend({ state: z.boolean() });
|
|
3808
|
-
z.object({
|
|
3809
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3810
|
-
after: z.number().int().nonnegative().optional(),
|
|
3811
|
-
before: z.number().int().nonnegative().optional()
|
|
3812
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3813
|
-
withOptionalDeviceIdSchema$3.extend({ uri: spotifyUriSchema });
|
|
3814
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3815
|
-
const skipToNextOperation = new Operation({
|
|
3816
|
-
credentialSets: [spotifyCredentialSet],
|
|
3817
|
-
id: "spotify.skip-to-next",
|
|
3818
|
-
name: "Skip To Next",
|
|
3819
|
-
description: "Skip to the next Spotify item in the active queue.",
|
|
3820
|
-
input: withOptionalDeviceIdSchema$3,
|
|
3821
|
-
output: spotifyMutationSuccessSchema,
|
|
3822
|
-
needsApproval: true,
|
|
3823
|
-
run: async (input, context) => {
|
|
3824
|
-
const credentials = context.credentials.spotify;
|
|
3825
|
-
return createSpotifyClient(credentials).player.skipToNext(input.deviceId);
|
|
3826
|
-
}
|
|
3827
|
-
});
|
|
3828
|
-
|
|
3829
|
-
//#endregion
|
|
3830
|
-
//#region src/operations/skip-to-previous.operation.ts
|
|
3831
|
-
z.object({});
|
|
3832
|
-
const playbackTypesSchema$2 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3833
|
-
const deviceIdSchema$2 = spotifyIdSchema.optional();
|
|
3834
|
-
z.object({
|
|
3835
|
-
market: spotifyMarketSchema.optional(),
|
|
3836
|
-
additionalTypes: playbackTypesSchema$2
|
|
3837
|
-
});
|
|
3838
|
-
z.object({
|
|
3839
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3840
|
-
play: z.boolean().optional()
|
|
3841
|
-
});
|
|
3842
|
-
const playbackOffsetSchema$2 = z.object({
|
|
3843
|
-
position: z.number().int().nonnegative().optional(),
|
|
3844
|
-
uri: spotifyUriSchema.optional()
|
|
3845
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3846
|
-
z.object({
|
|
3847
|
-
deviceId: deviceIdSchema$2,
|
|
3848
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3849
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3850
|
-
offset: playbackOffsetSchema$2.optional(),
|
|
3851
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3852
|
-
});
|
|
3853
|
-
const withOptionalDeviceIdSchema$2 = z.object({ deviceId: deviceIdSchema$2 });
|
|
3854
|
-
withOptionalDeviceIdSchema$2.extend({ positionMs: z.number().int().nonnegative() });
|
|
3855
|
-
withOptionalDeviceIdSchema$2.extend({ state: z.enum([
|
|
3856
|
-
"track",
|
|
3857
|
-
"context",
|
|
3858
|
-
"off"
|
|
3859
|
-
]) });
|
|
3860
|
-
withOptionalDeviceIdSchema$2.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3861
|
-
withOptionalDeviceIdSchema$2.extend({ state: z.boolean() });
|
|
3862
|
-
z.object({
|
|
3863
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3864
|
-
after: z.number().int().nonnegative().optional(),
|
|
3865
|
-
before: z.number().int().nonnegative().optional()
|
|
3866
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3867
|
-
withOptionalDeviceIdSchema$2.extend({ uri: spotifyUriSchema });
|
|
3868
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3869
|
-
const skipToPreviousOperation = new Operation({
|
|
3870
|
-
credentialSets: [spotifyCredentialSet],
|
|
3871
|
-
id: "spotify.skip-to-previous",
|
|
3872
|
-
name: "Skip To Previous",
|
|
3873
|
-
description: "Skip to the previous Spotify item in the active queue.",
|
|
3874
|
-
input: withOptionalDeviceIdSchema$2,
|
|
3875
|
-
output: spotifyMutationSuccessSchema,
|
|
3876
|
-
needsApproval: true,
|
|
3877
|
-
run: async (input, context) => {
|
|
3878
|
-
const credentials = context.credentials.spotify;
|
|
3879
|
-
return createSpotifyClient(credentials).player.skipToPrevious(input.deviceId);
|
|
3880
|
-
}
|
|
3881
|
-
});
|
|
3882
|
-
|
|
3883
|
-
//#endregion
|
|
3884
|
-
//#region src/operations/start-or-resume-playback.operation.ts
|
|
3885
|
-
z.object({});
|
|
3886
|
-
const playbackTypesSchema$1 = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3887
|
-
const deviceIdSchema$1 = spotifyIdSchema.optional();
|
|
3888
|
-
z.object({
|
|
3889
|
-
market: spotifyMarketSchema.optional(),
|
|
3890
|
-
additionalTypes: playbackTypesSchema$1
|
|
3891
|
-
});
|
|
3892
|
-
z.object({
|
|
3893
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3894
|
-
play: z.boolean().optional()
|
|
3895
|
-
});
|
|
3896
|
-
const playbackOffsetSchema$1 = z.object({
|
|
3897
|
-
position: z.number().int().nonnegative().optional(),
|
|
3898
|
-
uri: spotifyUriSchema.optional()
|
|
3899
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3900
|
-
const startOrResumePlaybackInputSchema = z.object({
|
|
3901
|
-
deviceId: deviceIdSchema$1,
|
|
3902
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3903
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3904
|
-
offset: playbackOffsetSchema$1.optional(),
|
|
3905
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3906
|
-
});
|
|
3907
|
-
const withOptionalDeviceIdSchema$1 = z.object({ deviceId: deviceIdSchema$1 });
|
|
3908
|
-
withOptionalDeviceIdSchema$1.extend({ positionMs: z.number().int().nonnegative() });
|
|
3909
|
-
withOptionalDeviceIdSchema$1.extend({ state: z.enum([
|
|
3910
|
-
"track",
|
|
3911
|
-
"context",
|
|
3912
|
-
"off"
|
|
3913
|
-
]) });
|
|
3914
|
-
withOptionalDeviceIdSchema$1.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3915
|
-
withOptionalDeviceIdSchema$1.extend({ state: z.boolean() });
|
|
3916
|
-
z.object({
|
|
3917
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3918
|
-
after: z.number().int().nonnegative().optional(),
|
|
3919
|
-
before: z.number().int().nonnegative().optional()
|
|
3920
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3921
|
-
withOptionalDeviceIdSchema$1.extend({ uri: spotifyUriSchema });
|
|
3922
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3923
|
-
function hasPlaybackBody(input) {
|
|
3924
|
-
return input.contextUri !== void 0 || input.uris !== void 0 || input.offset !== void 0 || input.positionMs !== void 0;
|
|
3925
|
-
}
|
|
3926
|
-
const startOrResumePlaybackOperation = new Operation({
|
|
3927
|
-
credentialSets: [spotifyCredentialSet],
|
|
3928
|
-
id: "spotify.start-or-resume-playback",
|
|
3929
|
-
name: "Start Or Resume Playback",
|
|
3930
|
-
description: "Start or resume Spotify playback on an active or selected device.",
|
|
3931
|
-
input: startOrResumePlaybackInputSchema,
|
|
3932
|
-
output: spotifyMutationSuccessSchema,
|
|
3933
|
-
needsApproval: true,
|
|
3934
|
-
run: async (input, context) => {
|
|
3935
|
-
const credentials = context.credentials.spotify;
|
|
3936
|
-
const client = createSpotifyClient(credentials);
|
|
3937
|
-
const body = hasPlaybackBody(input) ? {
|
|
3938
|
-
contextUri: input.contextUri,
|
|
3939
|
-
uris: input.uris,
|
|
3940
|
-
offset: input.offset,
|
|
3941
|
-
positionMs: input.positionMs
|
|
3942
|
-
} : void 0;
|
|
3943
|
-
return client.player.startOrResumePlayback(body, input.deviceId);
|
|
3944
|
-
}
|
|
3945
|
-
});
|
|
3946
|
-
|
|
3947
|
-
//#endregion
|
|
3948
|
-
//#region src/operations/transfer-playback.operation.ts
|
|
3949
|
-
z.object({});
|
|
3950
|
-
const playbackTypesSchema = z.array(z.enum(["track", "episode"])).min(1).optional();
|
|
3951
|
-
const deviceIdSchema = spotifyIdSchema.optional();
|
|
3952
|
-
z.object({
|
|
3953
|
-
market: spotifyMarketSchema.optional(),
|
|
3954
|
-
additionalTypes: playbackTypesSchema
|
|
3955
|
-
});
|
|
3956
|
-
const transferPlaybackInputSchema = z.object({
|
|
3957
|
-
deviceIds: z.array(spotifyIdSchema).min(1).max(50),
|
|
3958
|
-
play: z.boolean().optional()
|
|
3959
|
-
});
|
|
3960
|
-
const playbackOffsetSchema = z.object({
|
|
3961
|
-
position: z.number().int().nonnegative().optional(),
|
|
3962
|
-
uri: spotifyUriSchema.optional()
|
|
3963
|
-
}).refine((value) => value.position !== void 0 || value.uri !== void 0, { error: "Playback offset must include a position or uri." });
|
|
3964
|
-
z.object({
|
|
3965
|
-
deviceId: deviceIdSchema,
|
|
3966
|
-
contextUri: spotifyUriSchema.optional(),
|
|
3967
|
-
uris: z.array(spotifyUriSchema).min(1).max(100).optional(),
|
|
3968
|
-
offset: playbackOffsetSchema.optional(),
|
|
3969
|
-
positionMs: z.number().int().nonnegative().optional()
|
|
3970
|
-
});
|
|
3971
|
-
const withOptionalDeviceIdSchema = z.object({ deviceId: deviceIdSchema });
|
|
3972
|
-
withOptionalDeviceIdSchema.extend({ positionMs: z.number().int().nonnegative() });
|
|
3973
|
-
withOptionalDeviceIdSchema.extend({ state: z.enum([
|
|
3974
|
-
"track",
|
|
3975
|
-
"context",
|
|
3976
|
-
"off"
|
|
3977
|
-
]) });
|
|
3978
|
-
withOptionalDeviceIdSchema.extend({ volumePercent: z.number().int().min(0).max(100) });
|
|
3979
|
-
withOptionalDeviceIdSchema.extend({ state: z.boolean() });
|
|
3980
|
-
z.object({
|
|
3981
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
3982
|
-
after: z.number().int().nonnegative().optional(),
|
|
3983
|
-
before: z.number().int().nonnegative().optional()
|
|
3984
|
-
}).refine((value) => !(value.after !== void 0 && value.before !== void 0), { error: "Specify only one of after or before." });
|
|
3985
|
-
withOptionalDeviceIdSchema.extend({ uri: spotifyUriSchema });
|
|
3986
|
-
z.object({ devices: z.array(spotifyDeviceSchema) });
|
|
3987
|
-
const transferPlaybackOperation = new Operation({
|
|
3988
|
-
credentialSets: [spotifyCredentialSet],
|
|
3989
|
-
id: "spotify.transfer-playback",
|
|
3990
|
-
name: "Transfer Playback",
|
|
3991
|
-
description: "Transfer Spotify playback to another available device.",
|
|
3992
|
-
input: transferPlaybackInputSchema,
|
|
3993
|
-
output: spotifyMutationSuccessSchema,
|
|
3994
|
-
needsApproval: true,
|
|
3995
|
-
run: async (input, context) => {
|
|
3996
|
-
const credentials = context.credentials.spotify;
|
|
3997
|
-
return createSpotifyClient(credentials).player.transferPlayback(input);
|
|
3998
|
-
}
|
|
3999
|
-
});
|
|
4000
|
-
|
|
4001
|
-
//#endregion
|
|
4002
|
-
//#region src/operations/unfollow-playlist.operation.ts
|
|
4003
|
-
const playlistPaginationInputSchema$2 = z.object({
|
|
4004
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
4005
|
-
offset: z.number().int().nonnegative().optional()
|
|
4006
|
-
});
|
|
4007
|
-
const playlistIdInputSchema$2 = z.object({ playlistId: spotifyIdSchema });
|
|
4008
|
-
const playlistAdditionalTypeSchema$2 = z.enum(["track", "episode"]);
|
|
4009
|
-
z.object({
|
|
4010
|
-
name: z.string().trim().min(1),
|
|
4011
|
-
public: z.boolean().optional(),
|
|
4012
|
-
collaborative: z.boolean().optional(),
|
|
4013
|
-
description: z.string().optional()
|
|
4014
|
-
});
|
|
4015
|
-
const getPlaylistInputSchema$2 = playlistIdInputSchema$2.extend({
|
|
4016
|
-
market: spotifyMarketSchema.optional(),
|
|
4017
|
-
fields: z.string().trim().min(1).optional(),
|
|
4018
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$2).min(1).optional()
|
|
4019
|
-
});
|
|
4020
|
-
playlistIdInputSchema$2.extend({
|
|
4021
|
-
name: z.string().trim().min(1).optional(),
|
|
4022
|
-
public: z.boolean().optional(),
|
|
4023
|
-
collaborative: z.boolean().optional(),
|
|
4024
|
-
description: z.string().optional()
|
|
4025
|
-
});
|
|
4026
|
-
getPlaylistInputSchema$2.extend({
|
|
4027
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
4028
|
-
offset: z.number().int().nonnegative().optional()
|
|
4029
|
-
});
|
|
4030
|
-
playlistIdInputSchema$2.extend({
|
|
4031
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
4032
|
-
position: z.number().int().nonnegative().optional()
|
|
4033
|
-
});
|
|
4034
|
-
playlistIdInputSchema$2.extend({
|
|
4035
|
-
mode: z.literal("reorder"),
|
|
4036
|
-
rangeStart: z.number().int().nonnegative(),
|
|
4037
|
-
insertBefore: z.number().int().nonnegative(),
|
|
4038
|
-
rangeLength: z.number().int().positive().optional(),
|
|
4039
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
4040
|
-
});
|
|
4041
|
-
playlistIdInputSchema$2.extend({
|
|
4042
|
-
mode: z.literal("replace"),
|
|
4043
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
4044
|
-
});
|
|
4045
|
-
const playlistTrackRemovalSchema$2 = z.object({
|
|
4046
|
-
uri: spotifyUriSchema,
|
|
4047
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
4048
|
-
});
|
|
4049
|
-
playlistIdInputSchema$2.extend({
|
|
4050
|
-
tracks: z.array(playlistTrackRemovalSchema$2).min(1).max(100),
|
|
4051
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
4052
|
-
});
|
|
4053
|
-
playlistPaginationInputSchema$2.extend({ userId: spotifyIdSchema });
|
|
4054
|
-
playlistIdInputSchema$2.extend({ public: z.boolean().optional() });
|
|
4055
|
-
playlistIdInputSchema$2.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
4056
|
-
playlistIdInputSchema$2.extend({ imageBase64: z.string().trim().min(1) });
|
|
4057
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
4058
|
-
const unfollowPlaylistOperation = new Operation({
|
|
4059
|
-
credentialSets: [spotifyCredentialSet],
|
|
4060
|
-
id: "spotify.unfollow-playlist",
|
|
4061
|
-
name: "Unfollow Playlist",
|
|
4062
|
-
description: "Unfollow a Spotify playlist for the connected account.",
|
|
4063
|
-
input: playlistIdInputSchema$2,
|
|
4064
|
-
output: spotifyMutationSuccessSchema,
|
|
4065
|
-
needsApproval: true,
|
|
4066
|
-
run: async (input, context) => {
|
|
4067
|
-
const credentials = context.credentials.spotify;
|
|
4068
|
-
return createSpotifyClient(credentials).playlists.unfollowPlaylist(input.playlistId);
|
|
4069
|
-
}
|
|
4070
|
-
});
|
|
4071
|
-
|
|
4072
|
-
//#endregion
|
|
4073
|
-
//#region src/operations/unfollow-spotify-artists-or-users.operation.ts
|
|
4074
|
-
const followTypeSchema = z.enum(["artist", "user"]);
|
|
4075
|
-
const followIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
4076
|
-
createSpotifyCursorPageSchema(spotifyArtistSchema);
|
|
4077
|
-
z.object({
|
|
4078
|
-
after: z.string().min(1).optional(),
|
|
4079
|
-
limit: z.number().int().min(1).max(50).optional()
|
|
4080
|
-
});
|
|
4081
|
-
const followMutationInputSchema = z.object({
|
|
4082
|
-
type: followTypeSchema,
|
|
4083
|
-
ids: followIdsSchema
|
|
4084
|
-
});
|
|
4085
|
-
const unfollowArtistsOrUsersOperation = new Operation({
|
|
4086
|
-
credentialSets: [spotifyCredentialSet],
|
|
4087
|
-
id: "spotify.unfollow-spotify-artists-or-users",
|
|
4088
|
-
name: "Unfollow Spotify Artists Or Users",
|
|
4089
|
-
description: "Unfollow Spotify artists or users for the current account.",
|
|
4090
|
-
needsApproval: true,
|
|
4091
|
-
input: followMutationInputSchema,
|
|
4092
|
-
output: spotifyMutationSuccessSchema,
|
|
4093
|
-
run: async (input, context) => {
|
|
4094
|
-
const credentials = context.credentials.spotify;
|
|
4095
|
-
return createSpotifyClient(credentials).follow.unfollowArtistsOrUsers(input.type, input.ids);
|
|
4096
|
-
}
|
|
4097
|
-
});
|
|
4098
|
-
|
|
4099
|
-
//#endregion
|
|
4100
|
-
//#region src/operations/update-playlist-details.operation.ts
|
|
4101
|
-
const playlistPaginationInputSchema$1 = z.object({
|
|
4102
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
4103
|
-
offset: z.number().int().nonnegative().optional()
|
|
4104
|
-
});
|
|
4105
|
-
const playlistIdInputSchema$1 = z.object({ playlistId: spotifyIdSchema });
|
|
4106
|
-
const playlistAdditionalTypeSchema$1 = z.enum(["track", "episode"]);
|
|
4107
|
-
z.object({
|
|
4108
|
-
name: z.string().trim().min(1),
|
|
4109
|
-
public: z.boolean().optional(),
|
|
4110
|
-
collaborative: z.boolean().optional(),
|
|
4111
|
-
description: z.string().optional()
|
|
4112
|
-
});
|
|
4113
|
-
const getPlaylistInputSchema$1 = playlistIdInputSchema$1.extend({
|
|
4114
|
-
market: spotifyMarketSchema.optional(),
|
|
4115
|
-
fields: z.string().trim().min(1).optional(),
|
|
4116
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema$1).min(1).optional()
|
|
4117
|
-
});
|
|
4118
|
-
const updatePlaylistDetailsInputSchema = playlistIdInputSchema$1.extend({
|
|
4119
|
-
name: z.string().trim().min(1).optional(),
|
|
4120
|
-
public: z.boolean().optional(),
|
|
4121
|
-
collaborative: z.boolean().optional(),
|
|
4122
|
-
description: z.string().optional()
|
|
4123
|
-
});
|
|
4124
|
-
getPlaylistInputSchema$1.extend({
|
|
4125
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
4126
|
-
offset: z.number().int().nonnegative().optional()
|
|
4127
|
-
});
|
|
4128
|
-
playlistIdInputSchema$1.extend({
|
|
4129
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
4130
|
-
position: z.number().int().nonnegative().optional()
|
|
4131
|
-
});
|
|
4132
|
-
playlistIdInputSchema$1.extend({
|
|
4133
|
-
mode: z.literal("reorder"),
|
|
4134
|
-
rangeStart: z.number().int().nonnegative(),
|
|
4135
|
-
insertBefore: z.number().int().nonnegative(),
|
|
4136
|
-
rangeLength: z.number().int().positive().optional(),
|
|
4137
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
4138
|
-
});
|
|
4139
|
-
playlistIdInputSchema$1.extend({
|
|
4140
|
-
mode: z.literal("replace"),
|
|
4141
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
4142
|
-
});
|
|
4143
|
-
const playlistTrackRemovalSchema$1 = z.object({
|
|
4144
|
-
uri: spotifyUriSchema,
|
|
4145
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
4146
|
-
});
|
|
4147
|
-
playlistIdInputSchema$1.extend({
|
|
4148
|
-
tracks: z.array(playlistTrackRemovalSchema$1).min(1).max(100),
|
|
4149
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
4150
|
-
});
|
|
4151
|
-
playlistPaginationInputSchema$1.extend({ userId: spotifyIdSchema });
|
|
4152
|
-
playlistIdInputSchema$1.extend({ public: z.boolean().optional() });
|
|
4153
|
-
playlistIdInputSchema$1.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
4154
|
-
playlistIdInputSchema$1.extend({ imageBase64: z.string().trim().min(1) });
|
|
4155
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
4156
|
-
const updatePlaylistDetailsOperation = new Operation({
|
|
4157
|
-
credentialSets: [spotifyCredentialSet],
|
|
4158
|
-
id: "spotify.update-playlist-details",
|
|
4159
|
-
name: "Update Playlist Details",
|
|
4160
|
-
description: "Update a Spotify playlist name, privacy, collaboration, or description.",
|
|
4161
|
-
input: updatePlaylistDetailsInputSchema,
|
|
4162
|
-
output: spotifyMutationSuccessSchema,
|
|
4163
|
-
needsApproval: true,
|
|
4164
|
-
run: async (input, context) => {
|
|
4165
|
-
const credentials = context.credentials.spotify;
|
|
4166
|
-
return createSpotifyClient(credentials).playlists.updatePlaylistDetails(input.playlistId, {
|
|
4167
|
-
name: input.name,
|
|
4168
|
-
public: input.public,
|
|
4169
|
-
collaborative: input.collaborative,
|
|
4170
|
-
description: input.description
|
|
4171
|
-
});
|
|
4172
|
-
}
|
|
4173
|
-
});
|
|
4174
|
-
|
|
4175
|
-
//#endregion
|
|
4176
|
-
//#region src/operations/upload-playlist-cover-image.operation.ts
|
|
4177
|
-
const playlistPaginationInputSchema = z.object({
|
|
4178
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
4179
|
-
offset: z.number().int().nonnegative().optional()
|
|
4180
|
-
});
|
|
4181
|
-
const playlistIdInputSchema = z.object({ playlistId: spotifyIdSchema });
|
|
4182
|
-
const playlistAdditionalTypeSchema = z.enum(["track", "episode"]);
|
|
4183
|
-
z.object({
|
|
4184
|
-
name: z.string().trim().min(1),
|
|
4185
|
-
public: z.boolean().optional(),
|
|
4186
|
-
collaborative: z.boolean().optional(),
|
|
4187
|
-
description: z.string().optional()
|
|
4188
|
-
});
|
|
4189
|
-
const getPlaylistInputSchema = playlistIdInputSchema.extend({
|
|
4190
|
-
market: spotifyMarketSchema.optional(),
|
|
4191
|
-
fields: z.string().trim().min(1).optional(),
|
|
4192
|
-
additionalTypes: z.array(playlistAdditionalTypeSchema).min(1).optional()
|
|
4193
|
-
});
|
|
4194
|
-
playlistIdInputSchema.extend({
|
|
4195
|
-
name: z.string().trim().min(1).optional(),
|
|
4196
|
-
public: z.boolean().optional(),
|
|
4197
|
-
collaborative: z.boolean().optional(),
|
|
4198
|
-
description: z.string().optional()
|
|
4199
|
-
});
|
|
4200
|
-
getPlaylistInputSchema.extend({
|
|
4201
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
4202
|
-
offset: z.number().int().nonnegative().optional()
|
|
4203
|
-
});
|
|
4204
|
-
playlistIdInputSchema.extend({
|
|
4205
|
-
uris: z.array(spotifyUriSchema).min(1).max(100),
|
|
4206
|
-
position: z.number().int().nonnegative().optional()
|
|
4207
|
-
});
|
|
4208
|
-
playlistIdInputSchema.extend({
|
|
4209
|
-
mode: z.literal("reorder"),
|
|
4210
|
-
rangeStart: z.number().int().nonnegative(),
|
|
4211
|
-
insertBefore: z.number().int().nonnegative(),
|
|
4212
|
-
rangeLength: z.number().int().positive().optional(),
|
|
4213
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
4214
|
-
});
|
|
4215
|
-
playlistIdInputSchema.extend({
|
|
4216
|
-
mode: z.literal("replace"),
|
|
4217
|
-
uris: z.array(spotifyUriSchema).min(1).max(100)
|
|
4218
|
-
});
|
|
4219
|
-
const playlistTrackRemovalSchema = z.object({
|
|
4220
|
-
uri: spotifyUriSchema,
|
|
4221
|
-
positions: z.array(z.number().int().nonnegative()).min(1).optional()
|
|
4222
|
-
});
|
|
4223
|
-
playlistIdInputSchema.extend({
|
|
4224
|
-
tracks: z.array(playlistTrackRemovalSchema).min(1).max(100),
|
|
4225
|
-
snapshotId: z.string().trim().min(1).optional()
|
|
4226
|
-
});
|
|
4227
|
-
playlistPaginationInputSchema.extend({ userId: spotifyIdSchema });
|
|
4228
|
-
playlistIdInputSchema.extend({ public: z.boolean().optional() });
|
|
4229
|
-
playlistIdInputSchema.extend({ userIds: z.array(spotifyIdSchema).min(1).max(5) });
|
|
4230
|
-
const uploadPlaylistCoverImageInputSchema = playlistIdInputSchema.extend({ imageBase64: z.string().trim().min(1) });
|
|
4231
|
-
z.object({ images: z.array(spotifyPlaylistImageSchema) });
|
|
4232
|
-
const uploadPlaylistCoverImageOperation = new Operation({
|
|
4233
|
-
credentialSets: [spotifyCredentialSet],
|
|
4234
|
-
id: "spotify.upload-playlist-cover-image",
|
|
4235
|
-
name: "Upload Playlist Cover Image",
|
|
4236
|
-
description: "Replace the cover image for a Spotify playlist.",
|
|
4237
|
-
input: uploadPlaylistCoverImageInputSchema,
|
|
4238
|
-
output: spotifyMutationSuccessSchema,
|
|
4239
|
-
needsApproval: true,
|
|
4240
|
-
run: async (input, context) => {
|
|
4241
|
-
const credentials = context.credentials.spotify;
|
|
4242
|
-
return createSpotifyClient(credentials).playlists.uploadPlaylistCoverImage(input.playlistId, input.imageBase64);
|
|
4243
|
-
}
|
|
4244
|
-
});
|
|
4245
|
-
|
|
4246
|
-
//#endregion
|
|
4247
|
-
export { getEpisodeOperation as $, listSavedEpisodesOperation as A, checkSavedShowsOperation as At, getSeveralEpisodesOperation as B, removeSavedAudiobooksOperation as C, getAvailableDevicesOperation as Ct, listUserPlaylistsOperation as D, checkUsersFollowPlaylistOperation as Dt, pausePlaybackOperation as E, createPlaylistOperation as Et, getTrackOperation as F, addItemsToPlaylistOperation as Ft, getSeveralAlbumsOperation as G, getSeveralAudiobooksOperation as H, getShowEpisodesOperation as I, getMyTopTracksOperation as J, getRecommendationsOperation as K, getShowOperation as L, listSavedAlbumsOperation as M, checkSavedAudiobooksOperation as Mt, listMyPlaylistsOperation as N, checkSavedAlbumsOperation as Nt, listSavedTracksOperation as O, checkFollowingArtistsOrUsersOperation as Ot, getUserOperation as P, addToQueueOperation as Pt, getFeaturedPlaylistsOperation as Q, getSeveralTracksOperation as R, removeSavedEpisodesOperation as S, getCurrentlyPlayingOperation as St, removeItemsFromPlaylistOperation as T, followPlaylistOperation as Tt, getSeveralAudioFeaturesOperation as U, getSeveralChaptersOperation as V, getSeveralArtistsOperation as W, getMeOperation as X, getMyTopArtistsOperation as Y, getFollowedArtistsOperation as Z, saveAudiobooksOperation as _, getQueueOperation as _t, transferPlaybackOperation as a, getAvailableGenreSeedsOperation as at, removeSavedTracksOperation as b, getPlaylistOperation as bt, skipToNextOperation as c, getAudioFeaturesOperation as ct, setPlaybackVolumeOperation as d, getArtistRelatedArtistsOperation as dt, getChapterOperation as et, seekToPositionOperation as f, getArtistAlbumsOperation as ft, saveEpisodesOperation as g, getRecentlyPlayedOperation as gt, saveShowsOperation as h, getAlbumOperation as ht, unfollowPlaylistOperation as i, getAvailableMarketsOperation as it, listSavedAudiobooksOperation as j, checkSavedEpisodesOperation as jt, listSavedShowsOperation as k, checkSavedTracksOperation as kt, setShuffleModeOperation as l, getAudioAnalysisOperation as lt, saveTracksOperation as m, getAlbumTracksOperation as mt, updatePlaylistDetailsOperation as n, getBrowseCategoryOperation as nt, startOrResumePlaybackOperation as o, getAudiobookChaptersOperation as ot, searchOperation as p, getArtistOperation as pt, getNewReleasesOperation as q, unfollowArtistsOrUsersOperation as r, getBrowseCategoriesOperation as rt, skipToPreviousOperation as s, getAudiobookOperation as st, uploadPlaylistCoverImageOperation as t, getCategoryPlaylistsOperation as tt, setRepeatModeOperation as u, getArtistTopTracksOperation as ut, saveAlbumsOperation as v, getPlaylistItemsOperation as vt, removeSavedAlbumsOperation as w, followArtistsOrUsersOperation as wt, removeSavedShowsOperation as x, getPlaybackStateOperation as xt, reorderOrReplacePlaylistItemsOperation as y, getPlaylistCoverImageOperation as yt, getSeveralShowsOperation as z };
|