API রেফারেন্স

ডাউনলোড

সমর্থনের জন্য app.capabilities এবং অনুমতির জন্য app.access ও হোস্টের অনুমতি দেখুন। ব্যবহারের আগে নমুনা মান বদলান।

টাইপ ডেফিনিশন

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