앱
기능 지원은 app.capabilities, 인가는 app.access와 호스트 권한으로 확인하세요. 예제는 합성 값을 사용합니다. 호출 전에 경로, ID, 입력, 필터를 바꾸세요.
타입 정의
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작업
clearAppCache
삭제 가능한 앱 캐시 파일을 삭제합니다.
mutation clearAppCache {
clearAppCache
}restartHttpServer
HTTP/HTTPS 포트를 변경하고 새 리스너가 준비될 때까지 기다립니다. HTTP_SERVER 기능이 필요합니다. 실제 포트를 반환하며 현재 주소가 바뀌면 다시 연결해야 합니다.
mutation restartHttpServer($httpPort: Int, $httpsPort: Int) {
restartHttpServer(httpPort: $httpPort, httpsPort: $httpsPort) { revision restarting httpPort httpsPort error }
}appCacheSize
앱 캐시 사용량을 바이트 단위로 반환합니다.
query appCacheSize {
appCacheSize
}appUpdate
사용 가능한 앱 업데이트 정보를 읽습니다.
query appUpdate {
appUpdate { currentVersion latestVersion releaseName publishedAt hasUpdate url }
}httpServer
HTTP/HTTPS 서버 상태, LAN 주소, 온라인 클라이언트 및 원격 접근 상태를 읽습니다. 인증된 호출자와 HTTP_SERVER 기능이 필요합니다.
query httpServer {
httpServer { addresses onlineClients remoteAccess mdnsHostname }
}httpServerChanged
구독 시작 시와 리스너, 네트워크, 온라인 클라이언트 또는 설정이 변경된 후 현재 HTTP 서버 상태를 받습니다. 인증된 호출자와 HTTP_SERVER 지원이 필요합니다. 페이지를 떠날 때 구독을 취소하고 돌아오면 다시 구독하세요.
subscription httpServerChanged {
httpServerChanged { addresses onlineClients remoteAccess mdnsHostname }
}deviceNameUpdated
갱신된 기기 표시 이름을 받습니다.
subscription deviceNameUpdated {
deviceNameUpdated
}accessUpdated
기기 기능 인가 변경 시 변경 신호를 받습니다.
subscription accessUpdated {
accessUpdated
}contentChanged
저장된 콘텐츠 변경 시 변경 신호를 받습니다.
subscription contentChanged {
contentChanged
}relaunchApp
기기에서 PlainApp 프로세스를 다시 시작합니다.
# The app restarts itself; the response only acknowledges that the
# request was accepted, since the connection dies with the process.
mutation relaunchApp {
relaunchApp
}requestAccess
지원되는 기능에 대한 기기 인가를 요청합니다. 기기에서 사용자 작업이 필요할 수 있습니다.
mutation requestAccess($feature: AccessFeature!) {
requestAccess(feature: $feature)
}setTempValue
일시적인 메모리 내 키/값 쌍을 설정하여 반환합니다. 영구 Key Value 데이터가 아닙니다.
mutation setTempValue($key: String!, $value: String!) {
setTempValue(key: $key, value: $value) { key value }
}updateDeviceName
웹 UI에 표시하고 페어링된 피어에 알리는 기기 표시 이름을 변경합니다.
# 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)
}app
앱 신원, 설정, 기능 지원, 인가 필드를 읽습니다. app.urlToken은 호출 세션에 속하며 리소스 링크를 암호화합니다. 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 }
}