API Referansı

İndirmeler

Özellik desteği için app.capabilities, yetkilendirme için app.access ve ana makine izinlerini kontrol edin. Çağrıdan önce örnek değerleri değiştirin.

Tip Tanımları

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!]!
}

İşlemler

subscription

downloadsChanged

İndirme ilerlemesi değiştiğinde değişiklik sinyali alır.

graphql
subscription downloadsChanged {
  downloadsChanged
}
mutation

cancelDownload

İndirmeyi durdurun; görev kaydını ve kaydedilmiş dosyaları koruyun.

graphql
mutation cancelDownload($id: ID!) {
  cancelDownload(id: $id)
}
mutation

createDownload

Kaynak URL’lerinden veya sohbet eklerinden indirme oluşturun; tam olarak bir kaynak belirtin.

graphql
mutation createDownload($input: DownloadInput!) {
  createDownload(input: $input) { id title targetDir zipName status downloadedBytes totalBytes bytesPerSecond }
}
mutation

pauseDownload

Belirtilen indirme görevini duraklatın ve tamamlanmış dosyaları koruyun.

graphql
mutation pauseDownload($id: ID!) {
  pauseDownload(id: $id)
}
mutation

removeDownload

İndirmeyi durdurup görev kaydını kaldırın; kaydedilmiş dosyaları koruyun.

graphql
mutation removeDownload($id: ID!) {
  removeDownload(id: $id)
}
mutation

resumeDownload

Mevcut duraklatılmış indirme görevini sürdürün.

graphql
mutation resumeDownload($id: ID!) {
  resumeDownload(id: $id)
}
mutation

retryDownload

Başarısız, kısmi veya iptal edilmiş mevcut indirme görevini yeniden deneyin.

graphql
mutation retryDownload($id: ID!) {
  retryDownload(id: $id)
}
query

downloads

İndirme görevlerini güncel ilerleme, sonuç ve hatalarıyla listeleyin.

graphql
query downloads {
  downloads { id title targetDir zipName status downloadedBytes totalBytes bytesPerSecond }
}