angee.storage.schema
GraphQL schema contributions for Angee storage.
MimeTypeType
@strawberry_django.type(MimeType)
class MimeTypeType(AngeeNode)GraphQL projection of one MIME taxonomy row.
BackendType
@strawberry_django.type(Backend)
class BackendType(AngeeNode)Admin projection of a storage backend, including its config.
DriveType
@strawberry_django.type(Drive)
class DriveType(AngeeNode)GraphQL projection of a drive.
backend
@strawberry_django.field(only=["backend_id"])
def backend() -> strawberry.IDReturn the parent backend's public id without exposing the row.
FolderType
@strawberry_django.type(Folder)
class FolderType(AngeeNode)GraphQL projection of a folder or smart folder.
drive
@strawberry_django.field(only=["drive_id"])
def drive() -> strawberry.ID | NoneReturn the drive's public id; smart folders have none.
parent
@strawberry_django.field(only=["parent_id"])
def parent() -> strawberry.ID | NoneReturn the parent folder's public id, if any.
FileType
@strawberry_django.type(File)
class FileType(AuthoredRefMixin, AngeeNode)GraphQL projection of a file row.
drive
@strawberry_django.field(only=["drive_id"])
def drive() -> strawberry.IDReturn the drive's public id without exposing the drive object.
folder
@strawberry_django.field(only=["folder_id"])
def folder() -> strawberry.ID | NoneReturn the folder's public id, if the file is in one.
url
@strawberry_django.field
def url() -> strReturn the token proxy download URL for READY rows, empty otherwise.
Minted here in actor scope — only a reader of the row resolves this field — so the URL is a short-lived capability the download view honours without a second access check (see :meth:File.download_url).
FileUploadBeginInput
@strawberry.input
class FileUploadBeginInput()Fields accepted when reserving an upload.
FileUploadBeginPayload
@strawberry.type
class FileUploadBeginPayload()How the client should send bytes for one reserved file row.
method is "proxy" (PUT the raw body to upload_url), "deduped" (identical bytes already exist; nothing to send), or empty when error is set. A "presigned" arm arrives with the first backend that can presign uploads natively.
FileUploadFinalizeInput
@strawberry.input
class FileUploadFinalizeInput()Fields accepted when finalizing an upload.
FileUploadFinalizePayload
@strawberry.type
class FileUploadFinalizePayload()Verified file row, or the error that rejected the upload.
StorageAdminPermission
class StorageAdminPermission(BasePermission)Allow actors who reach the storage_admin role.
Platform admins (angee/role:admin) are implicit members through the role's member union in permissions.zed.
has_permission
def has_permission(source: Any, info: strawberry.Info, **kwargs: Any) -> boolReturn whether the current actor is an effective storage admin.
StorageQuery
@strawberry.type
class StorageQuery()Storage queries shared by the public and console schemas.
FolderWriteBackend
class FolderWriteBackend(AngeeHasuraWriteBackend)Write semantics for folders: create belongs to the manager factory.
create
def create(info: strawberry.Info, data: dict[str, Any]) -> AnyCreate a real folder through Folder.objects.create_in_drive.
StorageMutation
@strawberry.type
class StorageMutation()Upload protocol and folder mutations shared by both schemas.
file_upload_begin
@strawberry.mutation(name="file_upload_begin")
def file_upload_begin(input: FileUploadBeginInput) -> FileUploadBeginPayloadReserve a draft file and tell the client where to send bytes.
file_upload_finalize
@strawberry.mutation(name="file_upload_finalize")
def file_upload_finalize(
input: FileUploadFinalizeInput) -> FileUploadFinalizePayloadVerify uploaded bytes and return the READY row.
restore_file
@strawberry.mutation(name="restore_file")
def restore_file(id: PublicID) -> FileType | NonePull one file out of the Trash smart folder.
delete_file
@strawberry.mutation(name="delete_file")
def delete_file(id: PublicID, confirm: bool = False) -> DeletePreviewPreview or confirm moving one file to Trash.
delete_folder
@strawberry.mutation(name="delete_folder")
def delete_folder(id: PublicID, confirm: bool = False) -> DeletePreviewPreview or confirm deleting one folder.
StorageConsoleMutation
@strawberry.type
class StorageConsoleMutation()Admin-only storage mutations.
purge_file
@strawberry.mutation(
name="purge_file",
permission_classes=_STORAGE_ADMIN_CLASSES,
)
def purge_file(id: PublicID) -> boolPermanently delete one file row and its backend object.