File
Sfoglia e gestisci file e directory. Supporta archiviazione multi-montaggio (interna, scheda SD, USB).
Definizioni di tipo
type File {
name: String!
path: String!
permission: String! # "rw" | "r"
createdAt: String # ISO 8601, null on some filesystems
updatedAt: String! # ISO 8601
size: Long! # 0 for directories
isDir: Boolean!
children: Int! # 0 for files; child count for directories
mediaId: String! # media store ID, empty when unavailable
}
type StorageMount {
id: String!
name: String!
path: String!
mountPoint: String!
fsType: String!
totalBytes: Long!
usedBytes: Long!
freeBytes: Long!
remote: Boolean!
alias: String!
}
type FileInfo {
path: String!
updatedAt: String!
size: Long!
tags: [Tag!]!
data: MediaFileInfo # image/video/audio metadata, null for other types
}
type MediaFileInfo {
# Union-like structure; fields vary by media type (image / video / audio)
width: Int
height: Int
duration: Int # milliseconds (video / audio)
artist: String
album: String
title: String
}
type FavoriteFolder {
rootPath: String!
fullPath: String!
alias: String # optional display alias, empty when not set
}Operazioni
mounts
Elenca tutti i volumi di archiviazione disponibili (interno, scheda SD, USB).
query GetMounts {
mounts {
id name path mountPoint fsType totalBytes usedBytes freeBytes remote alias
}
}recentFiles
Elenca i file modificati di recente in tutte le archiviazioni. Origine della vista "Recenti" nell'UI File.
query GetRecentFiles {
recentFiles {
name path permission createdAt updatedAt size isDir children mediaId
}
}files
Elenca e cerca file sotto un percorso radice con paginazione. Passa una query vuota per elencarli tutti.
query GetFiles($root: String!, $offset: Int!, $limit: Int!, $query: String!, $sortBy: FileSortBy!) {
files(root: $root, offset: $offset, limit: $limit, query: $query, sortBy: $sortBy) {
name path permission createdAt updatedAt size isDir children mediaId
}
}fileInfo
Recupera stat + metadati media + tag per un singolo file. Passa fileName in modo che il server possa rilevare immagine/video/audio e caricare larghezza, altezza, durata, ecc.
query GetFileInfo($id: ID!, $path: String!, $fileName: String!) {
fileInfo(id: $id, path: $path, fileName: $fileName) {
path updatedAt size
tags { id name }
data { width height duration artist album title }
}
}fileIds
Risolve un elenco di percorsi filesystem nei loro ID del media store (stringa vuota quando non indicizzati).
query GetFileIds($paths: [String!]!) {
fileIds(paths: $paths)
}uploadedChunks
Elenca gli indici dei chunk già ricevuti per un upload chunked ripristinabile. Usato per riprendere upload interrotti.
query GetUploadedChunks($fileId: String!) {
uploadedChunks(fileId: $fileId)
}createDir
Crea una nuova directory e la restituisce come oggetto File.
mutation CreateDir($path: String!) {
createDir(path: $path) {
name path permission createdAt updatedAt size isDir children mediaId
}
}renameFile
Rinomina un file o una directory.
mutation RenameFile($path: String!, $name: String!) {
renameFile(path: $path, name: $name)
}writeTextFile
Scrive contenuto testuale in un file. Imposta overwrite=false per aggiungere un suffisso "(1)" quando il file esiste già.
mutation WriteTextFile($path: String!, $content: String!, $overwrite: Boolean!) {
writeTextFile(path: $path, content: $content, overwrite: $overwrite) {
name path size updatedAt
}
}deleteFiles
Elimina uno o più file o directory per percorso esatto.
mutation DeleteFiles($paths: [String!]!) {
deleteFiles(paths: $paths)
}copyFile
Copia un file o una directory in un percorso di destinazione. Imposta overwrite per sostituire un file esistente.
mutation CopyFile($src: String!, $dst: String!, $overwrite: Boolean!) {
copyFile(src: $src, dst: $dst, overwrite: $overwrite)
}moveFile
Sposta un file o una directory in un percorso di destinazione. Imposta overwrite per sostituire un file esistente.
mutation MoveFile($src: String!, $dst: String!, $overwrite: Boolean!) {
moveFile(src: $src, dst: $dst, overwrite: $overwrite)
}addFavoriteFolder
Aggiunge una cartella ai preferiti per un accesso rapido. Restituisce l'elenco aggiornato di tutte le cartelle preferite.
mutation AddFavoriteFolder($rootPath: String!, $fullPath: String!) {
addFavoriteFolder(rootPath: $rootPath, fullPath: $fullPath) {
rootPath fullPath alias
}
}removeFavoriteFolder
Rimuove una cartella dai preferiti. Restituisce l'elenco aggiornato delle cartelle rimanenti.
mutation RemoveFavoriteFolder($fullPath: String!) {
removeFavoriteFolder(fullPath: $fullPath) {
rootPath fullPath alias
}
}setFavoriteFolderAlias
Imposta o aggiorna l'alias mostrato per una cartella preferita. Passa una stringa vuota per cancellare l'alias.
mutation SetFavoriteFolderAlias($fullPath: String!, $alias: String!) {
setFavoriteFolderAlias(fullPath: $fullPath, alias: $alias) {
rootPath fullPath alias
}
}deleteChunks
Elimina tutti i chunk memorizzati per un fileId di upload chunked. Usa dopo un upload annullato o non riuscito per liberare spazio su disco.
mutation DeleteChunks($fileId: String!) {
deleteChunks(fileId: $fileId)
}mergeChunks
Unisce i chunk caricati in precedenza nel file finale. Passa isAppFile=true per importare il risultato nell'AppFileStore content-addressable di PlainApp (usato dagli allegati chat).
mutation MergeChunks($fileId: String!, $totalChunks: Int!, $path: String!, $replace: Boolean!, $isAppFile: Boolean!) {
mergeChunks(fileId: $fileId, totalChunks: $totalChunks, path: $path, replace: $replace, isAppFile: $isAppFile)
}