API রেফারেন্স

অ্যাপ

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

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

graphql
type Mutation {
  clearAppCache: Boolean!
  restartHttpServer(httpPort: Int, httpsPort: Int): HttpServerState!
  relaunchApp: Boolean!
  requestAccess(feature: AccessFeature!): Boolean!
  setTempValue(key: String!, value: String!): KeyValuePair!
  updateDeviceName(name: String!): Boolean!
}

type Query {
  appCacheSize: Long!
  appUpdate: AppUpdate!
  httpServer: HttpServer!
  app: App!
}

type Subscription {
  httpServerChanged: HttpServer!
  deviceNameUpdated: String!
  accessUpdated: Boolean!
  contentChanged: Boolean!
}

enum AccessFeature {
	IMAGES
	VIDEOS
	AUDIO
	DOCS
	FILES
	CONTACTS
	SMS
	CALLS
	CALL_PHONE
	PHONE_NUMBER
	APPS
	NOTIFICATIONS
	CLIPBOARD
	ADB
}

type App {
	clientId: ID!
	httpPort: Int!
	httpsPort: Int!
	deviceName: String!
	developerMode: Boolean!
	urlToken: String!
	tlsCertificateSha256: String
	appDir: String!
	deviceType: DeviceType!
	capabilities: [Capability!]!
	buildChannel: AppChannelType!
	access: [AccessFeature!]!
	downloadsDir: String!
	debug: Boolean!
}

enum AppChannelType {
	GITHUB
	GOOGLE
	FDROID
}

type AppUpdate {
	currentVersion: String!
	latestVersion: String
	releaseName: String!
	publishedAt: Instant
	hasUpdate: Boolean!
	url: String
}

enum Capability {
	ADB
	BLE
	WIFI_AWARE
	APP_RELAUNCH
	MEDIA_TRASH
	MEDIA_DELETE
	MEDIA_MOVE
	MEDIA_FAVORITE
	APP_UPDATES
	MIRROR_AUDIO
	MEDIA_SCAN
	TELEPHONY
	PACKAGES
	SCREEN_MIRROR
	NOTIFICATIONS
	CLIPBOARD
	DISK_MANAGER
	HTTP_SERVER
}

enum DeviceType {
	COMPUTER
	PHONE
	TABLET
	TV
	NAS
	OTHER
}

type HttpServer {
	state: HttpServerState!
	addresses: [String!]!
	onlineClients: [ID!]!
	remoteAccess: Boolean!
	mdnsHostname: String!
}

type HttpServerState {
	revision: Long!
	restarting: Boolean!
	httpPort: Int!
	httpsPort: Int!
	error: String!
}

scalar Instant

type KeyValuePair {
	key: String!
	value: String!
}

scalar Long

অপারেশন

mutation

clearAppCache

ফেলে দেওয়া যায় এমন অ্যাপ ক্যাশ ফাইল মুছে দেয়।

graphql
mutation clearAppCache {
  clearAppCache
}
mutation

restartHttpServer

HTTP/HTTPS পোর্ট বদলে নতুন লিসেনার প্রস্তুত হওয়া পর্যন্ত অপেক্ষা করুন। HTTP_SERVER প্রয়োজন। প্রকৃত পোর্ট ফেরত দেয়; বর্তমান ঠিকানা বদলালে আবার সংযোগ করুন।

graphql
mutation restartHttpServer($httpPort: Int, $httpsPort: Int) {
  restartHttpServer(httpPort: $httpPort, httpsPort: $httpsPort) { revision restarting httpPort httpsPort error }
}
query

appCacheSize

অ্যাপ ক্যাশের ব্যবহার বাইটে দেয়।

graphql
query appCacheSize {
  appCacheSize
}
query

appUpdate

উপলব্ধ অ্যাপ আপডেটের তথ্য পড়ে।

graphql
query appUpdate {
  appUpdate { currentVersion latestVersion releaseName publishedAt hasUpdate url }
}
query

httpServer

HTTP/HTTPS-এর অবস্থা, LAN ঠিকানা, সংযুক্ত ক্লায়েন্ট এবং দূরবর্তী অ্যাক্সেসের অবস্থা পড়ুন। প্রমাণীকৃত কলকারী ও HTTP_SERVER প্রয়োজন।

graphql
query httpServer {
  httpServer { addresses onlineClients remoteAccess mdnsHostname }
}
subscription

httpServerChanged

সাবস্ক্রিপশন যুক্ত হলে এবং লিসেনার, নেটওয়ার্ক, অনলাইন ক্লায়েন্ট বা সেটিংস বদলালে HTTP সার্ভারের বর্তমান অবস্থা পান। প্রমাণীকৃত কলার এবং HTTP_SERVER সমর্থন প্রয়োজন। পৃষ্ঠা ছাড়লে বাতিল করুন এবং ফিরে এলে আবার সাবস্ক্রাইব করুন।

graphql
subscription httpServerChanged {
  httpServerChanged { addresses onlineClients remoteAccess mdnsHostname }
}
subscription

deviceNameUpdated

আপডেট করা ডিভাইসের প্রদর্শিত নাম পায়।

graphql
subscription deviceNameUpdated {
  deviceNameUpdated
}
subscription

accessUpdated

ডিভাইসের বৈশিষ্ট্যের অনুমোদন বদলালে পরিবর্তনের সংকেত পায়।

graphql
subscription accessUpdated {
  accessUpdated
}
subscription

contentChanged

সংরক্ষিত বিষয়বস্তু বদলালে পরিবর্তনের সংকেত পায়।

graphql
subscription contentChanged {
  contentChanged
}
mutation

relaunchApp

ডিভাইসে PlainApp প্রক্রিয়া পুনরায় চালু করে।

graphql
# The app restarts itself; the response only acknowledges that the
# request was accepted, since the connection dies with the process.
mutation relaunchApp {
  relaunchApp
}
mutation

requestAccess

সমর্থিত বৈশিষ্ট্যের জন্য ডিভাইসের অনুমোদন চায়; ডিভাইসে ব্যবহারকারীর পদক্ষেপ লাগতে পারে।

graphql
mutation requestAccess($feature: AccessFeature!) {
  requestAccess(feature: $feature)
}
mutation

setTempValue

মেমরিতে অস্থায়ী কী/মান জোড়া রাখে ও ফেরত দেয়; এটি স্থায়ী Key Value তথ্য নয়।

graphql
mutation setTempValue($key: String!, $value: String!) {
  setTempValue(key: $key, value: $value) { key value }
}
mutation

updateDeviceName

ওয়েব UI-তে প্রদর্শিত ডিভাইসের নাম বদলায় ও জোড়া লাগানো পিয়ারদের প্রচার করে।

graphql
# Renaming the device also re-publishes the mDNS advertisement, so a
# client that waits for the new name to appear does see it.
mutation updateDeviceName($name: String!) {
  updateDeviceName(name: $name)
}
query

app

অ্যাপ পরিচয়, কনফিগারেশন, সক্ষমতা ও অনুমোদনের ক্ষেত্র পড়ে। app.urlToken কলকারী সেশনের এবং রিসোর্স লিংক এনক্রিপ্ট করে; এটি GraphQL প্রমাণীকরণ টোকেন নয়।

graphql
# Everything a client needs to reach this device: its identity, the
# port it listens on and the token that authorises it.
query app {
  app { clientId httpPort httpsPort deviceName developerMode urlToken tlsCertificateSha256 appDir }
}