A decentralized music tracking and discovery platform built on AT Protocol 🎵

[api] add return types

+85 -5
+57 -3
apps/api/src/xrpc/app/rocksky/dropbox/getFiles.ts
··· 42 42 params: QueryParams; 43 43 ctx: Context; 44 44 did: string; 45 - }) => { 45 + }): Effect.Effect<[Directories, Files], Error> => { 46 46 return Effect.tryPromise({ 47 47 try: async () => { 48 48 const parentDirAlias = alias(tables.dropboxDirectories, "parent_dir"); ··· 111 111 }); 112 112 }; 113 113 114 - const presentation = (data) => { 114 + const presentation = ( 115 + data: [Directories, Files] 116 + ): Effect.Effect<any, never> => { 115 117 return Effect.sync(() => ({ 116 118 directory: R.omit( 117 119 ["createdAt", "updatedAt", "xataVersion"], 118 120 _.get(data, "0.0.parent", null) || _.get(data, "1.0.parent", null) 119 121 ), 120 122 parentDirectory: R.omit( 121 - ["createdAt", "updatedAt"], 123 + ["createdAt", "updatedAt", "xataVersion"], 122 124 _.get(data, "0.0.parent_dir", null) || _.get(data, "1.0.parent_dir", null) 123 125 ), 124 126 directories: data[0].map((item) => ({ ··· 141 143 })), 142 144 })); 143 145 }; 146 + 147 + type Directories = { 148 + dropbox_directories: { 149 + id: string; 150 + name: string; 151 + fileId: string; 152 + path: string; 153 + parentId: string; 154 + createdAt: Date; 155 + updatedAt: Date; 156 + }; 157 + parent?: { 158 + id: string; 159 + name: string; 160 + fileId: string; 161 + dropboxId: string; 162 + path: string; 163 + }; 164 + parent_dir?: { 165 + id: string; 166 + name: string; 167 + fileId: string; 168 + dropboxId: string; 169 + path: string; 170 + }; 171 + }[]; 172 + 173 + type Files = { 174 + dropbox_paths: { 175 + id: string; 176 + name: string; 177 + fileId: string; 178 + directoryId: string; 179 + trackId?: string; 180 + createdAt: Date; 181 + updatedAt: Date; 182 + }; 183 + parent?: { 184 + id: string; 185 + name: string; 186 + fileId: string; 187 + dropboxId: string; 188 + path: string; 189 + }; 190 + parent_dir?: { 191 + id: string; 192 + name: string; 193 + fileId: string; 194 + dropboxId: string; 195 + path: string; 196 + }; 197 + }[];
+28 -2
apps/api/src/xrpc/app/rocksky/googledrive/getFiles.ts
··· 41 41 params: QueryParams; 42 42 ctx: Context; 43 43 did: string; 44 - }) => { 44 + }): Effect.Effect<[Directories, Files], Error> => { 45 45 return Effect.tryPromise({ 46 46 try: async () => { 47 47 const parentDirAlias = alias(tables.googleDriveDirectories, "parent_dir"); ··· 119 119 }); 120 120 }; 121 121 122 - const presentation = (data) => { 122 + const presentation = ( 123 + data: [Directories, Files] 124 + ): Effect.Effect<any, never> => { 123 125 return Effect.sync(() => ({ 124 126 directory: R.omit( 125 127 ["createdAt", "updatedAt", "xataVersion"], ··· 149 151 })), 150 152 })); 151 153 }; 154 + 155 + type Directories = { 156 + google_drive_directories: { 157 + id: string; 158 + name: string; 159 + fileId: string; 160 + path: string; 161 + parentId: string; 162 + createdAt: Date; 163 + updatedAt: Date; 164 + }; 165 + }[]; 166 + 167 + type Files = { 168 + google_drive_paths: { 169 + id: string; 170 + name: string; 171 + fileId: string; 172 + directoryId: string; 173 + trackId?: string; 174 + createdAt: Date; 175 + updatedAt: Date; 176 + }; 177 + }[];