API リファレンス
ダウンロード
機能の対応状況は app.capabilities、認可は app.access とホストの権限で確認してください。例は合成値を使用しています。呼び出す前にパス、ID、入力、フィルターを置き換えてください。
型定義
graphql
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!]!
}操作
subscription
downloadsChanged
ダウンロード進行状況の変更時に変更シグナルを受信します。
graphql
subscription downloadsChanged {
downloadsChanged
}mutation
cancelDownload
ダウンロードを停止し、タスク記録と保存済みファイルを保持します。
graphql
mutation cancelDownload($id: ID!) {
cancelDownload(id: $id)
}mutation
createDownload
リソース URL またはチャットの添付からダウンロードを作成します。ソースは必ず一つだけ指定します。
graphql
mutation createDownload($input: DownloadInput!) {
createDownload(input: $input) { id title targetDir zipName status downloadedBytes totalBytes bytesPerSecond }
}mutation
pauseDownload
指定のダウンロードタスクを一時停止し、完了したファイルを保持します。
graphql
mutation pauseDownload($id: ID!) {
pauseDownload(id: $id)
}mutation
removeDownload
ダウンロードを停止してタスク記録を削除し、保存済みファイルは保持します。
graphql
mutation removeDownload($id: ID!) {
removeDownload(id: $id)
}mutation
resumeDownload
既存の一時停止中のダウンロードを再開します。
graphql
mutation resumeDownload($id: ID!) {
resumeDownload(id: $id)
}mutation
retryDownload
失敗、一部完了、キャンセル済みの既存ダウンロードを再試行します。
graphql
mutation retryDownload($id: ID!) {
retryDownload(id: $id)
}query
downloads
ダウンロードタスクと現在の進捗、結果、エラーを一覧表示します。
graphql
query downloads {
downloads { id title targetDir zipName status downloadedBytes totalBytes bytesPerSecond }
}