All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Merged PR #1 (thanks domanteli0 for the PR!) which fixes an issue where the token timestamp wouldn't get set if using the client credentials flow.
- Added top-level documentation with examples for each auth flow and general usage.
- Added constructors for the auth flow structs.
- Renamed
AuthCodeGrantFlow
,AuthCodePKCEGrantFlow
andClientCredsGrantFlow
toAuthCodeFlow
,AuthCodePkceFlow
andClientCredsFlow
respectively. - Added the
AuthCodeClient
,AuthCodePkceClient
andClientCredsClient
type aliases for each of the client's authflows. These are what you should use when referring to theClient
type.
Client::authenticate()
doesn't takescopes
anymore for the client credentials flow, as they were needless.- Moved the CSRF token and PKCE verifier inside the client to make the auth flow simpler.
- Removed
scopes
andredirect_uri
parameters fromClient::from_refresh_token()
, as they were pointless. Client::shows().get()
now returnsVec<Option<SimplifiedShow>>
, as the API returns null for some shows and the user likely wants to know that some of their shows can't be obtained.- Made the
ExternalIds
andExternalUrls
structs' fields public. - Removed the ability to implement marker traits (such as
AuthFlow
,Verifier
etc.) for library users, using the sealed trait pattern.
- Added documentation for everything apart from the model. If anything is missing, please let me know and I'll add it in the future.
- Moved several endpoints (save/remove/check albums/episodes etc.) from needless builders.
- Re-exported the
error::Result
type alias. - In the recently played tracks endpoint, you can now either set
before
orafter
, not both (as per the Spotify API documentation). - Renamed several builder methods from various names (e.g. follow, unfollow, set) to, simply,
send
.
- Removed the
fields
option from the get-playlist builder, as it would be used to filter responses, in which case aPlaylist
couldn't be deserialized properly. Users can do filtering by accessing specific fields of thePlaylist
struct anyway.
- Added the player endpoints.
Two of them return
403 Forbidden "Player command failed: Restriction violated"
(set repeat mode and toggle playback shuffle). It seems to be an issue with the Spotify API again.
- Implemented the missing track-related endpoints.
- Added an optional
tracks
method to the builder for creating playlists. It takes a slice of track or episode URIs and makes two additional API calls to add tracks to the newly created playlist: one for adding the tracks and one for getting their details.
-
Added endpoints: playlists, search, shows, tracks*, users.
*a few endpoints are still not implemented
-
Client::from_refresh_token()
method that allows you get a new client using an existing refresh token. -
Internal
BoundedU32<const MIN: u32, const MAX: u32>
type that clamps a u32 toMIN, MAX
upon creation.Limit
is aBoundedU32<1, 50>
- what Spotify uses for its limits. u32s passed by users are converted to said type. This might be unpredictable behaviour for the users, but it will be documented and I believe it's for the better - however, I am open to suggestions and might remove it in the future.
- Methods with empty API responses now return
Nil
instead of()
, in order to make deserialization from empty responses easy while keeping flexibility.
-
Changed the approach to the builders, the public API now being endpoint-oriented.
Getting an album with the optional
market
parameter set:// before let album = spotify.get_album(AlbumQuery::new("id").market("GB")).await?; // after let album = spotify.album("id").market("RO").get().await?;
- Changed the signature of methods that take several IDs to allow for more flexibility in the arguments.
-
Added two new authorisation flows: Authorisation Code Flow (no PKCE) and Client Credentials Flow.
-
Added endpoints:
-
All artist endpoints
-
Note: they return
500 Server error
, which is an issue with the API. -
The genre endpoint
- Removed duplicate token refresh methods from
Client<AuthCodeGrantPKCEFlow>
and the newClient<AuthCodeGrantFlow>
since they were the same as the generic implementation. - Client now takes a new generic type parameter:
A: AuthenticatedState
. TheToken
type now implements said trait and endpoint methods are only available on theClient<Token, F>
type now. This ensures endpoint methods can only be called after authentication (not taking into account expired tokens). - Removed the existing types for the Implicit Grant flow as it will not be implemented: it's very basic not recommended.
- Removed
oauth2::AuthorizationUrl
from the public API and re-exportedoauth2::RedirectUrl
.
- Moved from
Option<T>
for optional parameters to builders for each endpoint.
- All album endpoints from the Spotify API.
Spotify
variant for theError
enum and deserializing into a struct that is converted into said variant.RefreshUnavailable
variant of theError
enum, for when you're requesting a refresh but the auth flow doesn't support it.- Auto refresh for the token (if enabled).
- Created CHANGELOG.md.
- Slight internal changes to the model.
- The
flow
field of the client is gone, instead usingPhantomData
now.
- Added additional
Cargo.toml
metadata.
- Initial release.