diff --git a/website/src/components/navigation/DocSideBar.astro b/website/src/components/navigation/DocSideBar.astro index b8570fb0..05892b80 100644 --- a/website/src/components/navigation/DocSideBar.astro +++ b/website/src/components/navigation/DocSideBar.astro @@ -58,6 +58,7 @@ const sections: [ ][] = [ ["Get Started", "get-started/", queryCollection], ["Developing Plugins", "developing-plugins/", queryCollection], + ["Models", "models/", queryCollection], // ["Design System", "design/", queryCollection], // ["Tailwind Components", "tailwind/", queryCollection], // ["Functional Components", "components/", queryMetaCollection], diff --git a/website/src/content/docs/developing-plugins/album-endpoint.mdx b/website/src/content/docs/developing-plugins/album-endpoint.mdx index bf8317a5..2d2ec3dd 100644 --- a/website/src/content/docs/developing-plugins/album-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/album-endpoint.mdx @@ -43,6 +43,6 @@ class AlbumEndpoint { | `unsave()` | Removes the specified albums from saved albums. Accepts a list of album IDs. | `void` | {/* Urls */} -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeFullAlbumObject]: /models/spotube-full-album-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object +[SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object +[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject +[SpotubeFullTrackObject]: /docs/models/spotube-track-object diff --git a/website/src/content/docs/developing-plugins/artist-endpoint.mdx b/website/src/content/docs/developing-plugins/artist-endpoint.mdx index fef8b44a..7c74d802 100644 --- a/website/src/content/docs/developing-plugins/artist-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/artist-endpoint.mdx @@ -50,7 +50,7 @@ class ArtistEndpoint { | `unsave()` | Removes the specified artists from saved artists. Accepts a list of artist IDs. | `void` | {/* Urls */} -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeFullAlbumObject]: /models/spotube-full-album-object -[SpotubeFullArtistObject]: /models/spotube-full-artist-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object +[SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object +[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject +[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject +[SpotubeFullTrackObject]: /docs/models/spotube-track-object diff --git a/website/src/content/docs/developing-plugins/browse-endpoint.mdx b/website/src/content/docs/developing-plugins/browse-endpoint.mdx index 9861d02e..70f31075 100644 --- a/website/src/content/docs/developing-plugins/browse-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/browse-endpoint.mdx @@ -40,9 +40,9 @@ By the way, the `Object` can be any of the following types: - [`SpotubeFullAlbumObject`][SpotubeFullAlbumObject] {/* Urls */} -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeBrowseSectionObject]: /models/spotube-browse-section-object -[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object -[SpotubeFullArtistObject]: /models/spotube-full-artist-object -[SpotubeFullAlbumObject]: /models/spotube-full-album-object +[SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object +[SpotubeBrowseSectionObject]: /docs/models/spotube-browse-section-object +[SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject +[SpotubeFullTrackObject]: /docs/models/spotube-track-object +[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject +[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject diff --git a/website/src/content/docs/developing-plugins/core-endpoint.mdx b/website/src/content/docs/developing-plugins/core-endpoint.mdx index 5daedc29..20f9a651 100644 --- a/website/src/content/docs/developing-plugins/core-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/core-endpoint.mdx @@ -65,10 +65,4 @@ class CorePlugin { > Also, the `downloadUrl` it provides should be a direct binary download link (redirect is supported) for the `.smplug` file {/* Urls */} -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeBrowseSectionObject]: /models/spotube-browse-section-object -[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object -[SpotubeFullArtistObject]: /models/spotube-full-artist-object -[SpotubeFullAlbumObject]: /models/spotube-full-album-object [scrobbling_wiki]: https://en.wikipedia.org/wiki/Last.fm diff --git a/website/src/content/docs/developing-plugins/playlist-endpoint.mdx b/website/src/content/docs/developing-plugins/playlist-endpoint.mdx index 70b0a92a..137f4a60 100644 --- a/website/src/content/docs/developing-plugins/playlist-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/playlist-endpoint.mdx @@ -76,6 +76,6 @@ class PlaylistEndpoint { | `unsave` | Removes a playlist from the user's library. | `void` | {/* Urls */} -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object +[SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object +[SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject +[SpotubeFullTrackObject]: /docs/models/spotube-track-object diff --git a/website/src/content/docs/developing-plugins/search-endpoint.mdx b/website/src/content/docs/developing-plugins/search-endpoint.mdx index bc76d707..4411aa77 100644 --- a/website/src/content/docs/developing-plugins/search-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/search-endpoint.mdx @@ -51,9 +51,9 @@ class SearchEndpoint { | `playlists()` | Searches only for playlists. | [`SpotubePaginationResponseObject`][SpotubePaginationResponseObject] of [`SpotubeFullPlaylistObject`][SpotubeFullPlaylistObject] | {/* Urls */} -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeSearchResponseObject]: /models/spotube-search-response-object -[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object -[SpotubeFullArtistObject]: /models/spotube-full-artist-object -[SpotubeFullAlbumObject]: /models/spotube-full-album-object +[SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object +[SpotubeSearchResponseObject]: /docs/models/spotube-search-response-object +[SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject +[SpotubeFullTrackObject]: /docs/models/spotube-track-object +[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject +[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject diff --git a/website/src/content/docs/developing-plugins/track-endpoint.mdx b/website/src/content/docs/developing-plugins/track-endpoint.mdx index 41b4c8ac..d6e34695 100644 --- a/website/src/content/docs/developing-plugins/track-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/track-endpoint.mdx @@ -40,4 +40,4 @@ class TrackEndpoint { | `radio()` | Fetches related tracks based on specified tracks. Try to return a List of 50 tracks. | [List\][SpotubeFullTrackObject] | {/* Urls */} -[SpotubeFullTrackObject]: /models/spotube-full-track-object +[SpotubeFullTrackObject]: /docs/models/spotube-track-object diff --git a/website/src/content/docs/developing-plugins/user-endpoint.mdx b/website/src/content/docs/developing-plugins/user-endpoint.mdx index 5ce8e7b5..4b8efb33 100644 --- a/website/src/content/docs/developing-plugins/user-endpoint.mdx +++ b/website/src/content/docs/developing-plugins/user-endpoint.mdx @@ -75,9 +75,9 @@ These methods are pretty self-explanatory. You need to implement them to fetch u > in the input list. {/* Links */} -[SpotubeUserObject]: /models/spotube-user-object -[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object -[SpotubeFullTrackObject]: /models/spotube-full-track-object -[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object -[SpotubeFullAlbumObject]: /models/spotube-full-album-object -[SpotubeFullArtistObject]: /models/spotube-full-artist-object +[SpotubeUserObject]: /docs/models/spotube-user-object +[SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object +[SpotubeFullTrackObject]: /docs/models/spotube-track-object +[SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject +[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject +[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject diff --git a/website/src/content/docs/models/spotube-album-object.mdx b/website/src/content/docs/models/spotube-album-object.mdx new file mode 100644 index 00000000..29197e90 --- /dev/null +++ b/website/src/content/docs/models/spotube-album-object.mdx @@ -0,0 +1,42 @@ +--- +layout: "layouts/DocLayout.astro" +title: Album +description: Different types of album objects used in Spotube. +order: 3 +--- + +### SpotubeSimpleAlbumObject + +Following is the structure of the `SpotubeAlbumObject`: + +| Property | Type | +| ----------- | ---------------------------------------------------------------- | +| id | `string` | +| name | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] | +| albumType | `album`, `single` or `compilation` | +| artists | List of [`SpotubeSimpleArtistObject`][SpotubeSimpleArtistObject] | +| releaseDate | `string` (YYYY-MM-DD format) or `null` | + +{/* Urls */} + +### SpotubeFullAlbumObject + +Following is the structure of the `SpotubeFullAlbumObject`: + +| Property | Type | +| ----------- | ---------------------------------------------------------------- | +| id | `string` | +| name | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] | +| albumType | `album`, `single` or `compilation` | +| artists | List of [`SpotubeSimpleArtistObject`][SpotubeSimpleArtistObject] | +| releaseDate | `string` (YYYY-MM-DD format) | +| totalTracks | `number` | +| recordLabel | `string` or `null` | + +{/* Urls */} +[SpotubeImageObject]: /docs/models/spotube-image-object +[SpotubeSimpleArtistObject]: /docs/models/spotube-artist-objects#spotubesimpleartistobject diff --git a/website/src/content/docs/models/spotube-artist-object.mdx b/website/src/content/docs/models/spotube-artist-object.mdx new file mode 100644 index 00000000..ab1716db --- /dev/null +++ b/website/src/content/docs/models/spotube-artist-object.mdx @@ -0,0 +1,33 @@ +--- +layout: "layouts/DocLayout.astro" +title: Artist +description: Different types of artist objects used in Spotube. +order: 2 +--- + +### SpotubeSimpleArtistObject + +Following is the structure of the `SpotubeArtistObject`: + +| Property | Type | +| ----------- | ------------------------------------------------------------ | +| id | `string` | +| name | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] or `null` | + +### SpotubeFullArtistObject + +Following is the structure of the `SpotubeFullArtistObject`: + +| Property | Type | +| ----------- | ----------------------------------------------------- | +| id | `string` | +| name | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] or | +| followers | `number` | +| genres | List of `string` or `null` | + +{/* Urls */} +[SpotubeImageObject]: /docs/models/spotube-image-object diff --git a/website/src/content/docs/models/spotube-browse-section-object.mdx b/website/src/content/docs/models/spotube-browse-section-object.mdx new file mode 100644 index 00000000..29368605 --- /dev/null +++ b/website/src/content/docs/models/spotube-browse-section-object.mdx @@ -0,0 +1,27 @@ +--- +layout: "layouts/DocLayout.astro" +title: Browse Section +description: "" +order: 7 +--- + +Following is the structure of `SpotubeBrowseSectionObject`: + +| Property | Type | +| ----------- | ---------------- | +| id | `string` | +| title | `string` | +| externalUri | `string` | +| browseMore | `boolean` | +| items | List of `Object` | + +The `items` property array can contain multiple type of `Object` in it but it will always be + +- [`SpotubeFullPlaylistObject`][SpotubeFullPlaylistObject] +- [`SpotubeFullAlbumObject`][SpotubeFullAlbumObject] +- [`SpotubeFullArtistObject`][SpotubeFullArtistObject] + +{/* Urls */} +[SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject +[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject +[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject diff --git a/website/src/content/docs/models/spotube-image-object.mdx b/website/src/content/docs/models/spotube-image-object.mdx new file mode 100644 index 00000000..665e5d0a --- /dev/null +++ b/website/src/content/docs/models/spotube-image-object.mdx @@ -0,0 +1,14 @@ +--- +layout: "layouts/DocLayout.astro" +title: Image +description: How images are represented in Spotube. +order: 0 +--- + +Following is the structure of the `SpotubeImageObject`: + +| Property | Type | +| -------- | --------------- | +| width | `int` or `null` | +| height | `int` or `null` | +| url | `string` | diff --git a/website/src/content/docs/models/spotube-pagination-response-object.mdx b/website/src/content/docs/models/spotube-pagination-response-object.mdx new file mode 100644 index 00000000..a5efebc3 --- /dev/null +++ b/website/src/content/docs/models/spotube-pagination-response-object.mdx @@ -0,0 +1,18 @@ +--- +layout: "layouts/DocLayout.astro" +title: Pagination Response +description: "" +order: 8 +--- + +`SpotubePaginationResponseObject` is generic model. The `items` property can contain any type of `Object` in it. + +This is the structure of `SpotubePaginationResponseObject`: + +| Property | Type | +| ---------- | ----------------------------------------------- | +| limit | `number` | +| nextOffset | `number` or `null` | +| total | `number` | +| hasMore | `boolean` | +| items | List of generic type `T` which extends `Object` | diff --git a/website/src/content/docs/models/spotube-playlist-object.mdx b/website/src/content/docs/models/spotube-playlist-object.mdx new file mode 100644 index 00000000..3783e596 --- /dev/null +++ b/website/src/content/docs/models/spotube-playlist-object.mdx @@ -0,0 +1,40 @@ +--- +layout: "layouts/DocLayout.astro" +title: Playlist +description: Different types of playlist objects used in Spotube. +order: 5 +--- + +### SpotubeSimplePlaylistObject + +Following is the structure of the `SpotubeSimplePlaylistObject`: + +| Property | Type | +| ----------- | ------------------------------------------------------------ | +| id | `string` | +| name | `string` | +| description | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] or `null` | +| owner | [`SpotubeUserObject`][SpotubeUserObject] | + +### SpotubeFullPlaylistObject + +Following is the structure of the `SpotubeFullPlaylistObject`: + +| Property | Type | +| ------------- | ------------------------------------------------------------ | +| id | `string` | +| name | `string` | +| description | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] or `null` | +| owner | [`SpotubeUserObject`][SpotubeUserObject] | +| collaborators | List of [`SpotubeUserObject`][SpotubeUserObject] or `null` | +| collaborative | `boolean` | +| public | `boolean` | + +{/* Urls */} + +[SpotubeImageObject]: /docs/models/spotube-image-object +[SpotubeUserObject]: /docs/models/spotube-simple-user-object diff --git a/website/src/content/docs/models/spotube-search-response-object.mdx b/website/src/content/docs/models/spotube-search-response-object.mdx new file mode 100644 index 00000000..efe51a26 --- /dev/null +++ b/website/src/content/docs/models/spotube-search-response-object.mdx @@ -0,0 +1,21 @@ +--- +layout: "layouts/DocLayout.astro" +title: Search Response +description: "" +order: 6 +--- + +Following is the structure of the `SpotubeSearchResponseObject`: + +| Property | Type | +| --------- | -------------------------------------------------------------------- | +| albums | List of [`SpotubeSimpleAlbumObject`][SpotubeSimpleAlbumObject] | +| artists | List of [`SpotubeFullArtistObject`][SpotubeFullArtistObject] | +| playlists | List of [`SpotubeSimplePlaylistObject`][SpotubeSimplePlaylistObject] | +| tracks | List of [`SpotubeFullTrackObject`][SpotubeFullTrackObject] | + +{/* Urls */} +[SpotubeSimpleAlbumObject]: /docs/models/spotube-album-object#spotubesimplealbumobject +[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject +[SpotubeSimplePlaylistObject]: /docs/models/spotube-playlist-object#spotubesimpleplaylistobject +[SpotubeFullTrackObject]: /docs/models/spotube-track-object diff --git a/website/src/content/docs/models/spotube-track-object.mdx b/website/src/content/docs/models/spotube-track-object.mdx new file mode 100644 index 00000000..3e4d8b92 --- /dev/null +++ b/website/src/content/docs/models/spotube-track-object.mdx @@ -0,0 +1,27 @@ +--- +layout: "layouts/DocLayout.astro" +title: Track +description: "" +order: 4 +--- + +Following is the structure of the `SpotubeFullTrackObject`: + +| Property | Type | +| ---------------------------- | ---------------------------------------------------------------- | +| id | `string` | +| name | `string` | +| externalUri | `string` | +| artists | List of [`SpotubeSimpleArtistObject`][SpotubeSimpleArtistObject] | +| album | [`SpotubeSimpleAlbumObject`][SpotubeSimpleAlbumObject] | +| durationMs (in milliseconds) | `number` | +| explicit | `boolean` | +| [isrc][isrc_wiki] | `string` | + +> `isrc` stands for International Standard Recording Code, which is a unique identifier for tracks. +> It is used to identify recordings and is often used in music distribution and royalty collection. The format is typically a 12-character alphanumeric code. + +{/* Urls */} +[SpotubeSimpleArtistObject]: /docs/models/spotube-artist-objects#spotubesimpleartistobject +[SpotubeSimpleAlbumObject]: /docs/models/spotube-album-object#spotubesimplealbumobject +[isrc_wiki]: https://en.wikipedia.org/wiki/International_Standard_Recording_Code diff --git a/website/src/content/docs/models/spotube-user-object.mdx b/website/src/content/docs/models/spotube-user-object.mdx new file mode 100644 index 00000000..9cd32f25 --- /dev/null +++ b/website/src/content/docs/models/spotube-user-object.mdx @@ -0,0 +1,20 @@ +--- +layout: "layouts/DocLayout.astro" +title: User +description: "" +order: 1 +--- + +Structure of the SpotubeUserObject, which is used to represent a user in Spotube returned by Spotube Plugins. + +| Property | Type | +| ----------- | -------------------------------------------------- | +| id | `string` | +| name | `string` | +| externalUri | `string` | +| images | List of [`SpotubeImageObject`][SpotubeImageObject] | + +> `externalUri` is a URL that points to the user's profile on the external service (e.g. Listenbrainz) + +{/* Urls */} +[SpotubeImageObject]: /docs/models/spotube-image-object