/** * Spotify Data Service * * API layer for storing Spotify listening data on backend. * Sends extracted listening history, playlists, saved items, and profile to /platform-data/store endpoint. * * MATCHES Sephora/ChatGPT implementation pattern * - Uses format: { platform, data, metadata } * - Platform: "mobile-spotify" * * Data Sources (from spotify.com - API details TBD): * - Recently Played: User's recent listening history * - Top Tracks: User's most played tracks * - Top Artists: User's most played artists * - Playlists: User's created and followed playlists * - Saved Tracks: User's liked songs * - Saved Albums: User's saved albums * - Profile: User preferences and settings */ /** * Structure of a track */ export interface SpotifyTrackData { trackId: string; name: string; artists: string[]; album?: string; albumId?: string; duration?: number; playedAt?: string; savedAt?: string; imageUrl?: string; previewUrl?: string; explicit?: boolean; popularity?: number; } /** * Structure of an artist */ export interface SpotifyArtistData { artistId: string; name: string; genres?: string[]; imageUrl?: string; popularity?: number; followers?: number; } /** * Structure of a playlist */ export interface SpotifyPlaylistData { playlistId: string; name: string; description?: string; isPublic?: boolean; isCollaborative?: boolean; trackCount?: number; imageUrl?: string; owner?: string; createdAt?: string; } /** * Structure of a saved album */ export interface SpotifySavedAlbumData { albumId: string; name: string; artists: string[]; releaseDate?: string; trackCount?: number; imageUrl?: string; savedAt?: string; } /** * Structure of recently played data */ export interface SpotifyRecentlyPlayedData { items: SpotifyTrackData[]; totalCount: number; } /** * Structure of top items data */ export interface SpotifyTopItemsData { tracks: SpotifyTrackData[]; artists: SpotifyArtistData[]; timeRange?: 'short_term' | 'medium_term' | 'long_term'; } /** * Structure of user profile */ export interface SpotifyProfileData { userId: string; displayName?: string; email?: string; country?: string; subscription?: 'free' | 'premium' | 'family'; followers?: number; imageUrl?: string; explicitContentEnabled?: boolean; } /** * Token expiry information */ export interface SpotifyTokenExpiry { expiry?: string; isExpired?: boolean; } /** * Combined Spotify data to store - matches WebView export format */ export interface SpotifyStorageData { recentlyPlayed: SpotifyRecentlyPlayedData; topItems: SpotifyTopItemsData; playlists: SpotifyPlaylistData[]; savedTracks: SpotifyTrackData[]; savedAlbums: SpotifySavedAlbumData[]; profile?: SpotifyProfileData | null; tokenExpiry?: SpotifyTokenExpiry; userId?: string; } /** * Response from backend endpoint */ export interface StoreSpotifyDataResponse { success: boolean; message?: string; error?: string; data?: any; } /** * Store Spotify data on backend * * @param userId - Username or identifier * @param data - Spotify listening data (history, playlists, saved items, profile) * @returns Response indicating success/failure with metadata */ export declare const storeSpotifyData: (userId: string, data: SpotifyStorageData) => Promise; //# sourceMappingURL=spotifyDataService.d.ts.map