A decentralized music tracking and discovery platform built on AT Protocol 馃幍 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
at main 57 lines 1.2 kB view raw
1import { client } from "."; 2 3export const getFiles = async (parent_id?: string) => { 4 const response = await client.get<{ 5 parentDirectory: { 6 id: string; 7 name: string; 8 path: string; 9 fileId: string; 10 }; 11 directory: { 12 id: string; 13 name: string; 14 path: string; 15 fileId: string; 16 }; 17 directories: { 18 id: string; 19 name: string; 20 fileId: string; 21 path: string; 22 parentId?: string; 23 }[]; 24 files: { 25 id: string; 26 name: string; 27 fileId: string; 28 directoryId: string; 29 trackId: string; 30 }[]; 31 }>("/xrpc/app.rocksky.googledrive.getFiles", { 32 headers: { 33 Authorization: `Bearer ${localStorage.getItem("token")}`, 34 }, 35 params: { 36 at: parent_id, 37 }, 38 }); 39 return response.data; 40}; 41 42export const getFile = async (id: string) => { 43 const response = await client.get<{ 44 id: string; 45 mimeType: string; 46 name: string; 47 parents: string[]; 48 }>("/xrpc/app.rocksky.googledrive.getFile", { 49 headers: { 50 Authorization: `Bearer ${localStorage.getItem("token")}`, 51 }, 52 params: { 53 id, 54 }, 55 }); 56 return response.data; 57};