Skip to content

angee.storage.schema

GraphQL schema contributions for Angee storage.

MimeTypeType

python
@strawberry_django.type(MimeType)
class MimeTypeType(AngeeNode)

GraphQL projection of one MIME taxonomy row.

BackendType

python
@strawberry_django.type(Backend)
class BackendType(AngeeNode)

Admin projection of a storage backend, including its config.

DriveType

python
@strawberry_django.type(Drive)
class DriveType(AngeeNode)

GraphQL projection of a drive.

backend

python
@strawberry_django.field(only=["backend_id"])
def backend() -> strawberry.ID

Return the parent backend's public id without exposing the row.

FolderType

python
@strawberry_django.type(Folder)
class FolderType(AngeeNode)

GraphQL projection of a folder or smart folder.

drive

python
@strawberry_django.field(only=["drive_id"])
def drive() -> strawberry.ID | None

Return the drive's public id; smart folders have none.

parent

python
@strawberry_django.field(only=["parent_id"])
def parent() -> strawberry.ID | None

Return the parent folder's public id, if any.

FileType

python
@strawberry_django.type(File)
class FileType(AuthoredRefMixin, AngeeNode)

GraphQL projection of a file row.

drive

python
@strawberry_django.field(only=["drive_id"])
def drive() -> strawberry.ID

Return the drive's public id without exposing the drive object.

folder

python
@strawberry_django.field(only=["folder_id"])
def folder() -> strawberry.ID | None

Return the folder's public id, if the file is in one.

url

python
@strawberry_django.field
def url() -> str

Return 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

python
@strawberry.input
class FileUploadBeginInput()

Fields accepted when reserving an upload.

FileUploadBeginPayload

python
@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

python
@strawberry.input
class FileUploadFinalizeInput()

Fields accepted when finalizing an upload.

FileUploadFinalizePayload

python
@strawberry.type
class FileUploadFinalizePayload()

Verified file row, or the error that rejected the upload.

StorageAdminPermission

python
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

python
def has_permission(source: Any, info: strawberry.Info, **kwargs: Any) -> bool

Return whether the current actor is an effective storage admin.

StorageQuery

python
@strawberry.type
class StorageQuery()

Storage queries shared by the public and console schemas.

FolderWriteBackend

python
class FolderWriteBackend(AngeeHasuraWriteBackend)

Write semantics for folders: create belongs to the manager factory.

create

python
def create(info: strawberry.Info, data: dict[str, Any]) -> Any

Create a real folder through Folder.objects.create_in_drive.

StorageMutation

python
@strawberry.type
class StorageMutation()

Upload protocol and folder mutations shared by both schemas.

file_upload_begin

python
@strawberry.mutation(name="file_upload_begin")
def file_upload_begin(input: FileUploadBeginInput) -> FileUploadBeginPayload

Reserve a draft file and tell the client where to send bytes.

file_upload_finalize

python
@strawberry.mutation(name="file_upload_finalize")
def file_upload_finalize(
        input: FileUploadFinalizeInput) -> FileUploadFinalizePayload

Verify uploaded bytes and return the READY row.

restore_file

python
@strawberry.mutation(name="restore_file")
def restore_file(id: PublicID) -> FileType | None

Pull one file out of the Trash smart folder.

delete_file

python
@strawberry.mutation(name="delete_file")
def delete_file(id: PublicID, confirm: bool = False) -> DeletePreview

Preview or confirm moving one file to Trash.

delete_folder

python
@strawberry.mutation(name="delete_folder")
def delete_folder(id: PublicID, confirm: bool = False) -> DeletePreview

Preview or confirm deleting one folder.

StorageConsoleMutation

python
@strawberry.type
class StorageConsoleMutation()

Admin-only storage mutations.

purge_file

python
@strawberry.mutation(
    name="purge_file",
    permission_classes=_STORAGE_ADMIN_CLASSES,
)
def purge_file(id: PublicID) -> bool

Permanently delete one file row and its backend object.

Released under the AGPL-3.0 License.