working team update/create (still need enroll)

This commit is contained in:
yohlo
2025-09-16 13:24:39 -05:00
parent cde74a04d5
commit c170e1e1fe
16 changed files with 845 additions and 175 deletions

View File

@@ -4,6 +4,7 @@ import type {
SpotifyPlaybackState,
SpotifyPlaybackSnapshot,
SpotifyError,
SpotifyTrack,
} from './types';
const SPOTIFY_API_BASE = 'https://api.spotify.com/v1';
@@ -123,6 +124,11 @@ export class SpotifyWebApiClient {
return this.request<{ id: string; display_name: string }>('/me');
}
async searchTracks(query: string, limit: number = 20): Promise<{ tracks: { items: SpotifyTrack[] } }> {
const encodedQuery = encodeURIComponent(query);
return this.request<{ tracks: { items: SpotifyTrack[] } }>(`/search?q=${encodedQuery}&type=track&limit=${limit}`);
}
updateAccessToken(accessToken: string): void {
this.accessToken = accessToken;
}