feat: add get and delete files

This commit is contained in:
firedotguy
2026-02-08 23:11:59 +03:00
parent c2413277d6
commit 9a4c47bd8e
5 changed files with 55 additions and 10 deletions

View File

@@ -1,7 +1,14 @@
from _io import BufferedReader
from uuid import UUID
from itd.request import fetch
def upload_file(token: str, name: str, data: BufferedReader):
return fetch(token, 'post', 'files/upload', files={'file': (name, data)})
def get_file(token: str, id: UUID):
return fetch(token, 'get', f'files/{id}')
def delete_file(token: str, id: UUID):
return fetch(token, 'delete', f'files/{id}')