फ़ाइलें
सुविधा समर्थन के लिए app.capabilities और प्राधिकरण के लिए app.access तथा होस्ट अनुमतियाँ जाँचें। उदाहरण कृत्रिम मान उपयोग करते हैं; कॉल करने से पहले पथ, ID, इनपुट और फ़िल्टर बदलें।
प्रकार परिभाषाएँ
type Subscription {
fileSearchResults(root: String!, query: String!, offset: Int!, limit: Int!, sortBy: FileSortBy!): FileSearchResults!
}
type Mutation {
cacheZipEntry(path: String!): String!
copyFileToDirectory(src: String!, directory: String!, name: String!): String!
createDir(path: String!): File!
createFile(path: String!): File!
createFileTask(type: FileTaskType!, title: String!, ops: [FileTaskOpInput!]!, waitForCompletion: Boolean! = false): FileTask!
createZipArchive(paths: [String!]!, target: String!): String!
deleteFiles(paths: [String!]!): ActionResult!
deleteTrashedFile(path: String!): Boolean!
extractZipArchive(path: String!, target: String!): String!
renameFile(path: String!, name: String!): String
restoreFiles(paths: [String!]!): ActionResult!
trashFiles(paths: [String!]!): ActionResult!
writeTextFile(path: String!, content: String!, overwrite: Boolean!): File!
}
type Query {
fileCount(root: String!, query: String!): Int!
fileInfo(path: String!): FileInfo
fileTasks(query: String!, offset: Int!, limit: Int!): [FileTask!]!
files(root: String!, query: String!, offset: Int!, limit: Int!, sortBy: FileSortBy!): [File!]!
recentFiles: [File!]!
trashedFileCount(query: String!): Int!
trashedFiles(query: String!, offset: Int!, limit: Int!, sortBy: TrashedFileSortBy!): [TrashedFile!]!
}
type ActionResult {
affectedCount: Int!
}
type AudioFileInfo {
durationMs: Long!
location: Location
}
type File {
permission: String!
mediaId: ID
name: String!
path: String!
createdAt: Instant
updatedAt: Instant!
size: Long!
isDir: Boolean!
childCount: Int!
url: String!
isSystem: Boolean!
}
type FileInfo {
path: String!
updatedAt: Instant!
size: Long!
data: MediaFileInfo
}
type FileSearchResults {
items: [File!]!
offset: Long!
count: Long!
complete: Boolean!
}
enum FileSortBy {
UPDATED_AT_ASC
UPDATED_AT_DESC
SIZE_ASC
SIZE_DESC
NAME_ASC
NAME_DESC
}
type FileTask {
id: ID!
clientId: ID!
type: FileTaskType!
title: String!
status: FileTaskStatus!
error: String!
totalBytes: Long!
doneBytes: Long!
totalItems: Long!
doneItems: Long!
createdAt: Instant!
updatedAt: Instant!
completedOps: [FileTaskCompletedOp!]!
}
type FileTaskCompletedOp {
src: String!
dst: String!
}
input FileTaskOpInput {
src: String!
dst: String!
overwrite: Boolean!
}
enum FileTaskStatus {
QUEUED
RUNNING
DONE
ERROR
}
enum FileTaskType {
COPY
MOVE
}
type ImageFileInfo {
make: String!
model: String!
rotation: Int!
colorSpace: String!
apertureValue: Float!
exposureTime: String!
focalLength: String!
isoSpeed: Int!
takenAt: Instant
flash: Int!
fNumber: Float!
exposureProgram: Int!
meteringMode: Int!
whiteBalance: Int!
creator: String!
resolutionX: Int!
resolutionY: Int!
description: String!
width: Int!
height: Int!
location: Location
}
scalar Instant
type Location {
latitude: Float!
longitude: Float!
}
scalar Long
union MediaFileInfo = ImageFileInfo | AudioFileInfo | VideoFileInfo
type TrashedFile {
id: ID!
type: TrashedFileType!
originalPath: String!
disk: String!
trashRelPath: String!
deletedAt: Instant!
uid: Int!
gid: Int!
mode: Int!
sizeBytes: Long
entryCount: Int
displayName: String!
trashedPath: String!
}
enum TrashedFileSortBy {
DATE_ASC
DATE_DESC
SIZE_ASC
SIZE_DESC
NAME_ASC
NAME_DESC
}
enum TrashedFileType {
FILE
DIR
}
type VideoFileInfo {
width: Int!
height: Int!
durationMs: Long!
rotation: Int!
displayWidth: Int!
displayHeight: Int!
bitrate: Long!
frameRate: Float!
title: String!
artist: String!
album: String!
genre: String!
takenAt: Instant
writer: String!
composer: String!
location: Location
}ऑपरेशन
fileSearchResults
दिए गए रूट, फ़िल्टर, पृष्ठ और क्रम के फ़ाइल-खोज परिणाम स्नैपशॉट लें।
subscription fileSearchResults($root: String!, $query: String!, $offset: Int!, $limit: Int!, $sortBy: FileSortBy!) {
fileSearchResults(root: $root, query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { offset count complete }
}cacheZipEntry
निर्दिष्ट ZIP प्रविष्टि कैश में निकालें और उसका पथ लौटाएँ।
mutation cacheZipEntry($path: String!) {
cacheZipEntry(path: $path)
}copyFileToDirectory
दिए गए गंतव्य नाम से फ़ाइल डायरेक्टरी में कॉपी करें और उपलब्ध होने पर उसका पथ लौटाएँ।
mutation copyFileToDirectory($src: String!, $directory: String!, $name: String!) {
copyFileToDirectory(src: $src, directory: $directory, name: $name)
}createDir
नई डायरेक्टरी बनाएँ और File ऑब्जेक्ट के रूप में लौटाएँ।
mutation createDir($path: String!) {
createDir(path: $path) { permission mediaId name path createdAt updatedAt size isDir }
}createFile
दिए गए पथ पर खाली फ़ाइल बनाएँ और उसका मेटाडेटा लौटाएँ।
mutation createFile($path: String!) {
createFile(path: $path) { permission mediaId name path createdAt updatedAt size isDir }
}createFileTask
बैच कॉपी या स्थानांतरण कार्य बनाएँ; वैकल्पिक रूप से उसकी स्थिति लौटाने से पहले पूरा होने तक प्रतीक्षा करें।
mutation createFileTask($type: FileTaskType!, $title: String!, $ops: [FileTaskOpInput!]!, $waitForCompletion: Boolean!) {
createFileTask(type: $type, title: $title, ops: $ops, waitForCompletion: $waitForCompletion) { id clientId type title status error totalBytes doneBytes }
}createZipArchive
चुने गए पथों से लक्ष्य पथ पर ZIP संग्रह बनाएँ।
mutation createZipArchive($paths: [String!]!, $target: String!) {
createZipArchive(paths: $paths, target: $target)
}deleteFiles
सटीक पथ से एक या अधिक फ़ाइलें या डायरेक्टरी मिटाएँ।
mutation deleteFiles($paths: [String!]!) {
deleteFiles(paths: $paths) { affectedCount }
}deleteTrashedFile
फ़ाइल ट्रैश से एक आइटम स्थायी रूप से मिटाएँ।
mutation deleteTrashedFile($path: String!) {
deleteTrashedFile(path: $path)
}extractZipArchive
ZIP संग्रह लक्ष्य डायरेक्टरी में निकालें।
mutation extractZipArchive($path: String!, $target: String!) {
extractZipArchive(path: $path, target: $target)
}renameFile
फ़ाइल या डायरेक्टरी का नाम बदलें।
mutation renameFile($path: String!, $name: String!) {
renameFile(path: $path, name: $name)
}restoreFiles
निर्दिष्ट ट्रैश फ़ाइल पथ बहाल करें और प्रभावित संख्या बताएँ।
mutation restoreFiles($paths: [String!]!) {
restoreFiles(paths: $paths) { affectedCount }
}trashFiles
निर्दिष्ट फ़ाइल पथ ट्रैश में ले जाएँ और प्रभावित संख्या बताएँ।
mutation trashFiles($paths: [String!]!) {
trashFiles(paths: $paths) { affectedCount }
}writeTextFile
अनुरोधित ओवरराइट नीति से दिए गए फ़ाइल पथ पर टेक्स्ट लिखें।
mutation writeTextFile($path: String!, $content: String!, $overwrite: Boolean!) {
writeTextFile(path: $path, content: $content, overwrite: $overwrite) { permission mediaId name path createdAt updatedAt size isDir }
}fileCount
पृष्ठ विभाजन की अनदेखी करके निर्दिष्ट रूट के नीचे फ़ाइल खोज के मिलान गिनें।
# Total matches for the same query, ignoring paging.
query fileCount($root: String!, $query: String!) {
fileCount(root: $root, query: $query)
}fileInfo
एक पथ की फ़ाइल विशेषताएँ, समर्थित मीडिया मेटाडेटा और टैग जानकारी पढ़ें।
query fileInfo($path: String!) {
fileInfo(path: $path) { path updatedAt size }
}fileTasks
क्वेरी से मेल खाते फ़ाइल कार्रवाई कार्यों का एक पृष्ठ पढ़ें।
query fileTasks($query: String!, $offset: Int!, $limit: Int!) {
fileTasks(query: $query, offset: $offset, limit: $limit) { id clientId type title status error totalBytes doneBytes }
}files
रूट पथ के नीचे फ़ाइलें पृष्ठों में सूचीबद्ध और खोजें। सब सूचीबद्ध करने के लिए खाली query दें।
# One page of a directory listing, filtered and sorted by the search
# DSL. `query` may carry a `parent` field to redirect the root, which
# is what the file manager's breadcrumb links send.
query files($root: String!, $query: String!, $offset: Int!, $limit: Int!, $sortBy: FileSortBy!) {
files(root: $root, query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { permission mediaId name path createdAt updatedAt size isDir }
}recentFiles
हाल में खोली गई फ़ाइलें सूचीबद्ध करें।
# Recently-opened files. Reading them is a storage read, so this one
# gates — plain-app's `recentFiles` calls `checkEnabledAsync`.
query recentFiles {
recentFiles { permission mediaId name path createdAt updatedAt size isDir }
}trashedFileCount
फ़ाइल ट्रैश के आइटम गिनें।
query trashedFileCount($query: String!) {
trashedFileCount(query: $query)
}trashedFiles
ट्रैश फ़ाइलें पृष्ठ विभाजन और क्रमबद्धता के साथ खोजें।
query trashedFiles($query: String!, $offset: Int!, $limit: Int!, $sortBy: TrashedFileSortBy!) {
trashedFiles(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { id type originalPath disk trashRelPath deletedAt uid gid }
}