파일
기능 지원은 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 }
}