Downloads
Funktionsunterstützung über app.capabilities prüfen, Autorisierung über app.access und Host-Berechtigungen. Die Beispiele verwenden synthetische Werte; vor dem Aufruf Pfade, IDs, Eingaben und Filter ersetzen.
Typdefinitionen
type Subscription {
downloadsChanged: Boolean!
}
type Mutation {
cancelDownload(id: ID!): Boolean!
createDownload(input: DownloadInput!): Download!
pauseDownload(id: ID!): Boolean!
removeDownload(id: ID!): Boolean!
resumeDownload(id: ID!): Boolean!
retryDownload(id: ID!): Boolean!
}
type Query {
downloads: [Download!]!
}
input ChatDownloadInput {
messageId: ID!
peerId: ID!
fileIds: [String!]!
}
type ChatDownloadSource {
messageId: ID!
peerId: ID!
fileIds: [String!]!
}
type Download {
id: ID!
title: String!
source: DownloadSource!
targetDir: String!
zipName: String
status: DownloadStatus!
downloadedBytes: Long!
totalBytes: Long!
bytesPerSecond: Long!
totalFiles: Int!
doneFiles: Int!
currentFile: String!
error: String!
failures: [DownloadFailure!]!
}
type DownloadFailure {
path: String!
error: String!
}
input DownloadInput @oneOf {
resources: ResourceDownloadInput
chat: ChatDownloadInput
}
union DownloadSource = ResourceDownloadSource | ChatDownloadSource
enum DownloadStatus {
PENDING
DOWNLOADING
PAUSED
PACKING
COMPLETED
PARTIAL
FAILED
CANCELED
}
scalar Long
input ResourceDownloadInput {
urls: [String!]!
targetDir: String!
zipName: String
}
type ResourceDownloadSource {
urls: [String!]!
}Operationen
downloadsChanged
Empfängt ein Änderungssignal bei geändertem Downloadfortschritt.
subscription downloadsChanged {
downloadsChanged
}cancelDownload
Download stoppen und Aufgabenverlauf sowie gespeicherte Dateien behalten.
mutation cancelDownload($id: ID!) {
cancelDownload(id: $id)
}createDownload
Download aus Ressourcen-URLs oder Chat-Anhängen erstellen; genau eine Quelle angeben.
mutation createDownload($input: DownloadInput!) {
createDownload(input: $input) { id title targetDir zipName status downloadedBytes totalBytes bytesPerSecond }
}pauseDownload
Die angegebene Downloadaufgabe pausieren und abgeschlossene Dateien behalten.
mutation pauseDownload($id: ID!) {
pauseDownload(id: $id)
}removeDownload
Download stoppen und Aufgabenverlauf entfernen; gespeicherte Dateien behalten.
mutation removeDownload($id: ID!) {
removeDownload(id: $id)
}resumeDownload
Eine vorhandene pausierte Downloadaufgabe fortsetzen.
mutation resumeDownload($id: ID!) {
resumeDownload(id: $id)
}retryDownload
Eine vorhandene fehlgeschlagene, teilweise abgeschlossene oder abgebrochene Downloadaufgabe wiederholen.
mutation retryDownload($id: ID!) {
retryDownload(id: $id)
}downloads
Downloadaufgaben mit aktuellem Fortschritt, Ergebnissen und Fehlern auflisten.
query downloads {
downloads { id title targetDir zipName status downloadedBytes totalBytes bytesPerSecond }
}