420 lines
8.8 KiB
TypeScript
420 lines
8.8 KiB
TypeScript
// Auto-generated from design document
|
|
// Generated: 2025-12-18T15:56:41
|
|
|
|
// =============================================================================
|
|
// ENUMS
|
|
// =============================================================================
|
|
|
|
export type UserRole = 'musician' | 'listener' | 'label';
|
|
export type AlbumType = 'album' | 'ep' | 'single';
|
|
|
|
// =============================================================================
|
|
// API TYPES
|
|
// =============================================================================
|
|
|
|
/** Register new user account - Request */
|
|
export interface RegisterRequest {
|
|
email: string;
|
|
password: string;
|
|
name: string;
|
|
role: UserRole;
|
|
}
|
|
|
|
/** Login with email and password - Request */
|
|
export interface LoginRequest {
|
|
email: string;
|
|
password: string;
|
|
}
|
|
|
|
/** Login with email and password - Response */
|
|
export interface LoginResponse {
|
|
user: unknown;
|
|
token: string;
|
|
}
|
|
|
|
/** Request password reset email - Request */
|
|
export interface ForgotPasswordRequest {
|
|
email: string;
|
|
}
|
|
|
|
/** Request password reset email - Response */
|
|
export interface ForgotPasswordResponse {
|
|
message: string;
|
|
}
|
|
|
|
/** Reset password with token - Request */
|
|
export interface ResetPasswordRequest {
|
|
token: string;
|
|
password: string;
|
|
}
|
|
|
|
/** Reset password with token - Response */
|
|
export interface ResetPasswordResponse {
|
|
message: string;
|
|
}
|
|
|
|
/** Get current user profile - Response */
|
|
export interface GetCurrentUserResponse {
|
|
id: string;
|
|
email: string;
|
|
name: string;
|
|
role: string;
|
|
avatar_url: string;
|
|
}
|
|
|
|
/** Update current user profile - Request */
|
|
export interface UpdateCurrentUserRequest {
|
|
name: string;
|
|
avatar_url: string;
|
|
}
|
|
|
|
/** Update current user profile - Response */
|
|
export interface UpdateCurrentUserResponse {
|
|
id: string;
|
|
email: string;
|
|
name: string;
|
|
avatar_url: string;
|
|
}
|
|
|
|
/** Create artist profile (musicians only) - Request */
|
|
export interface CreateArtistProfileRequest {
|
|
stage_name: string;
|
|
bio: string;
|
|
cover_image_url: string;
|
|
social_links: Record<string, string>;
|
|
}
|
|
|
|
/** Get artist profile by ID - Response */
|
|
export interface GetArtistResponse {
|
|
id: string;
|
|
stage_name: string;
|
|
bio: string;
|
|
cover_image_url: string;
|
|
social_links: Record<string, string>;
|
|
verified: boolean;
|
|
}
|
|
|
|
/** Update artist profile - Request */
|
|
export interface UpdateArtistRequest {
|
|
stage_name: string;
|
|
bio: string;
|
|
cover_image_url: string;
|
|
social_links: Record<string, string>;
|
|
}
|
|
|
|
/** Update artist profile - Response */
|
|
export interface UpdateArtistResponse {
|
|
id: string;
|
|
stage_name: string;
|
|
bio: string;
|
|
}
|
|
|
|
/** Song summary for lists */
|
|
export interface SongSummary {
|
|
id: string;
|
|
title: string;
|
|
duration: number;
|
|
cover_art_url: string;
|
|
play_count: number;
|
|
track_number?: number;
|
|
}
|
|
|
|
/** Get all songs by artist - Response */
|
|
export interface GetArtistSongsResponse {
|
|
songs: SongSummary[];
|
|
}
|
|
|
|
/** Album summary for lists */
|
|
export interface AlbumSummary {
|
|
id: string;
|
|
title: string;
|
|
cover_art_url: string;
|
|
release_date: string;
|
|
album_type: AlbumType;
|
|
}
|
|
|
|
/** Get all albums by artist - Response */
|
|
export interface GetArtistAlbumsResponse {
|
|
albums: AlbumSummary[];
|
|
}
|
|
|
|
/** Upload new song (musicians only) - Request */
|
|
export interface UploadSongRequest {
|
|
file: File;
|
|
title: string;
|
|
album_id: string;
|
|
genre_ids: string[];
|
|
release_date: string;
|
|
track_number: number;
|
|
}
|
|
|
|
/** Genre summary */
|
|
export interface GenreSummary {
|
|
id: string;
|
|
name: string;
|
|
slug: string;
|
|
}
|
|
|
|
/** Artist summary */
|
|
export interface ArtistSummary {
|
|
id: string;
|
|
stage_name: string;
|
|
}
|
|
|
|
/** Get song details - Response */
|
|
export interface GetSongResponse {
|
|
id: string;
|
|
title: string;
|
|
duration: number;
|
|
file_url: string;
|
|
cover_art_url: string;
|
|
artist: ArtistSummary;
|
|
album: AlbumSummary | null;
|
|
genres: GenreSummary[];
|
|
play_count: number;
|
|
}
|
|
|
|
/** Update song metadata - Request */
|
|
export interface UpdateSongRequest {
|
|
title: string;
|
|
album_id: string;
|
|
genre_ids: string[];
|
|
release_date: string;
|
|
is_public: boolean;
|
|
}
|
|
|
|
/** Update song metadata - Response */
|
|
export interface UpdateSongResponse {
|
|
id: string;
|
|
title: string;
|
|
}
|
|
|
|
/** Increment play count - Response */
|
|
export interface IncrementPlayCountResponse {
|
|
play_count: number;
|
|
}
|
|
|
|
/** Create new album - Request */
|
|
export interface CreateAlbumRequest {
|
|
title: string;
|
|
description: string;
|
|
cover_art_url: string;
|
|
release_date: string;
|
|
album_type: AlbumType;
|
|
}
|
|
|
|
/** Get album details with songs - Response */
|
|
export interface GetAlbumResponse {
|
|
id: string;
|
|
title: string;
|
|
description: string;
|
|
cover_art_url: string;
|
|
release_date: string;
|
|
artist: ArtistSummary;
|
|
songs: SongSummary[];
|
|
}
|
|
|
|
/** Update album metadata - Request */
|
|
export interface UpdateAlbumRequest {
|
|
title: string;
|
|
description: string;
|
|
cover_art_url: string;
|
|
release_date: string;
|
|
}
|
|
|
|
/** Update album metadata - Response */
|
|
export interface UpdateAlbumResponse {
|
|
id: string;
|
|
title: string;
|
|
}
|
|
|
|
/** Create new playlist - Request */
|
|
export interface CreatePlaylistRequest {
|
|
name: string;
|
|
description: string;
|
|
is_public: boolean;
|
|
}
|
|
|
|
/** Playlist summary */
|
|
export interface PlaylistSummary {
|
|
id: string;
|
|
name: string;
|
|
cover_image_url: string;
|
|
song_count: number;
|
|
}
|
|
|
|
/** Get current user's playlists - Response */
|
|
export interface GetUserPlaylistsResponse {
|
|
playlists: PlaylistSummary[];
|
|
}
|
|
|
|
/** Playlist song with position */
|
|
export interface PlaylistSongItem {
|
|
id: string;
|
|
title: string;
|
|
artist: ArtistSummary;
|
|
position: number;
|
|
}
|
|
|
|
/** Get playlist details with songs - Response */
|
|
export interface GetPlaylistResponse {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
songs: PlaylistSongItem[];
|
|
}
|
|
|
|
/** Update playlist metadata - Request */
|
|
export interface UpdatePlaylistRequest {
|
|
name: string;
|
|
description: string;
|
|
is_public: boolean;
|
|
}
|
|
|
|
/** Update playlist metadata - Response */
|
|
export interface UpdatePlaylistResponse {
|
|
id: string;
|
|
name: string;
|
|
}
|
|
|
|
/** Add song to playlist - Request */
|
|
export interface AddSongToPlaylistRequest {
|
|
song_id: string;
|
|
position: number;
|
|
}
|
|
|
|
/** Reorder songs in playlist - Request */
|
|
export interface ReorderPlaylistSongsRequest {
|
|
song_ids: string[];
|
|
}
|
|
|
|
/** Reorder songs in playlist - Response */
|
|
export interface ReorderPlaylistSongsResponse {
|
|
message: string;
|
|
}
|
|
|
|
/** Trending song item */
|
|
export interface TrendingSongItem {
|
|
id: string;
|
|
title: string;
|
|
artist: ArtistSummary;
|
|
play_count: number;
|
|
}
|
|
|
|
/** Get trending songs - Response */
|
|
export interface GetTrendingSongsResponse {
|
|
songs: TrendingSongItem[];
|
|
}
|
|
|
|
/** New release item */
|
|
export interface NewReleaseItem {
|
|
id: string;
|
|
title: string;
|
|
release_date: string;
|
|
}
|
|
|
|
/** Get recently released songs - Response */
|
|
export interface GetNewReleasesResponse {
|
|
songs: NewReleaseItem[];
|
|
}
|
|
|
|
/** Get all genres - Response */
|
|
export interface GetGenresResponse {
|
|
genres: GenreSummary[];
|
|
}
|
|
|
|
/** Get songs by genre - Response */
|
|
export interface GetSongsByGenreResponse {
|
|
genre: GenreSummary;
|
|
songs: SongSummary[];
|
|
}
|
|
|
|
/** Search songs, artists, and albums - Response */
|
|
export interface SearchResponse {
|
|
songs: SongSummary[];
|
|
artists: ArtistSummary[];
|
|
albums: AlbumSummary[];
|
|
}
|
|
|
|
/** Create label profile - Request */
|
|
export interface CreateLabelProfileRequest {
|
|
label_name: string;
|
|
description: string;
|
|
logo_url: string;
|
|
website: string;
|
|
}
|
|
|
|
/** Get artists under label - Response */
|
|
export interface GetLabelArtistsResponse {
|
|
artists: ArtistSummary[];
|
|
}
|
|
|
|
// =============================================================================
|
|
// SHARE TYPES
|
|
// =============================================================================
|
|
|
|
export type ShareType = 'SONG' | 'PLAYLIST' | 'ALBUM';
|
|
|
|
/** Create share link - Request */
|
|
export interface CreateShareRequest {
|
|
platform?: string;
|
|
}
|
|
|
|
/** Create share link - Response */
|
|
export interface CreateShareResponse {
|
|
shareUrl: string;
|
|
token: string;
|
|
type: ShareType;
|
|
}
|
|
|
|
/** Resolve share token - Response */
|
|
export interface ResolveShareResponse {
|
|
type: ShareType;
|
|
targetId: string;
|
|
content: SongShareContent | PlaylistShareContent | AlbumShareContent;
|
|
shareUrl: string;
|
|
}
|
|
|
|
/** Song content for share page */
|
|
export interface SongShareContent {
|
|
id: string;
|
|
title: string;
|
|
duration: number;
|
|
coverArtUrl: string;
|
|
fileUrl: string;
|
|
artist: ArtistSummary;
|
|
}
|
|
|
|
/** Playlist content for share page */
|
|
export interface PlaylistShareContent {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
coverImageUrl: string;
|
|
songCount: number;
|
|
curator: { id: string; name: string };
|
|
songs: SongSummary[];
|
|
}
|
|
|
|
/** Album content for share page */
|
|
export interface AlbumShareContent {
|
|
id: string;
|
|
title: string;
|
|
description: string;
|
|
coverArtUrl: string;
|
|
releaseDate: string;
|
|
artist: ArtistSummary;
|
|
songs: SongSummary[];
|
|
}
|
|
|
|
/** Track share click - Response */
|
|
export interface TrackShareClickResponse {
|
|
success: boolean;
|
|
clickCount: number;
|
|
}
|
|
|
|
/** API Error Response */
|
|
export interface ApiError {
|
|
error: string;
|
|
}
|