at main 2.8 kB view raw
1export interface FeaturedArtist { 2 did: string; 3 handle: string; 4 display_name: string; 5 avatar_url?: string; 6} 7 8export interface AlbumSummary { 9 id: string; 10 title: string; 11 slug: string; 12 track_count: number; 13 total_plays: number; 14 image_url?: string; 15} 16 17export interface AlbumMetadata extends AlbumSummary { 18 description?: string | null; 19 artist: string; 20 artist_handle: string; 21 artist_did: string; 22 list_uri?: string | null; 23} 24 25export interface AlbumResponse { 26 metadata: AlbumMetadata; 27 tracks: Track[]; 28} 29 30export interface SupportGate { 31 type: 'any' | string; 32} 33 34export interface Track { 35 id: number; 36 title: string; 37 artist: string; 38 album?: AlbumSummary | null; 39 file_id: string; 40 file_type: string; 41 artist_handle: string; 42 artist_avatar_url?: string; 43 artist_did?: string; 44 r2_url?: string; 45 atproto_record_uri?: string; 46 atproto_record_cid?: string; 47 atproto_record_url?: string; 48 play_count: number; 49 like_count?: number; 50 comment_count?: number; 51 features?: FeaturedArtist[]; 52 tags?: string[]; 53 created_at?: string; 54 image_url?: string; 55 is_liked?: boolean; 56 copyright_flagged?: boolean | null; // null = not scanned, false = clear, true = flagged 57 copyright_match?: string | null; // "Title by Artist" of primary match 58 support_gate?: SupportGate | null; // if set, track requires supporter access 59 gated?: boolean; // true if track is gated AND viewer lacks access 60} 61 62export interface LinkedAccount { 63 did: string; 64 handle: string; 65 avatar_url: string | null; 66} 67 68export interface User { 69 did: string; 70 handle: string; 71 linked_accounts: LinkedAccount[]; 72} 73 74export interface Artist { 75 did: string; 76 handle: string; 77 display_name: string; 78 avatar_url?: string; 79 bio?: string; 80 show_liked_on_profile?: boolean; 81 support_url?: string; 82} 83 84export interface QueueState { 85 track_ids: string[]; 86 current_index: number; 87 current_track_id: string | null; 88 shuffle: boolean; 89 original_order_ids: string[]; 90 auto_advance?: boolean; 91} 92 93export interface QueueResponse { 94 state: QueueState; 95 revision: number; 96 tracks: Track[]; 97} 98 99export interface TopItem { 100 id: number; 101 title: string; 102 play_count: number; 103} 104 105export interface Analytics { 106 total_plays: number; 107 total_items: number; 108 total_duration_seconds: number; 109 top_item: TopItem | null; 110 top_liked: TopItem | null; 111} 112 113export interface ArtistAlbumSummary extends AlbumSummary {} 114 115export interface TokenInfo { 116 session_id: string; 117 name: string | null; 118 created_at: string; 119 expires_at: string | null; 120} 121 122export interface Playlist { 123 id: string; 124 name: string; 125 owner_did: string; 126 owner_handle: string; 127 track_count: number; 128 image_url?: string; 129 show_on_profile: boolean; 130 atproto_record_uri: string; 131 created_at: string; 132} 133 134export interface PlaylistWithTracks extends Playlist { 135 tracks: Track[]; 136} 137