App
Check app.capabilities for feature support and app.access plus host permissions for authorization. Examples use synthetic values; replace paths, IDs, inputs and filters before calling.
Type Definitions
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 LongOperations
clearAppCache
Delete disposable application cache files.
mutation clearAppCache {
clearAppCache
}restartHttpServer
Change HTTP or HTTPS ports and wait for the replacement listeners to become ready. Requires HTTP_SERVER support. The response reports actual bound ports; reconnect to the new port if the current address changes.
mutation restartHttpServer($httpPort: Int, $httpsPort: Int) {
restartHttpServer(httpPort: $httpPort, httpsPort: $httpsPort) { revision restarting httpPort httpsPort error }
}appCacheSize
Return application cache usage in bytes.
query appCacheSize {
appCacheSize
}appUpdate
Read available application-update information.
query appUpdate {
appUpdate { currentVersion latestVersion releaseName publishedAt hasUpdate url }
}httpServer
Read HTTP and HTTPS listener state, LAN addresses, online clients and remote-access status. Requires an authenticated caller and HTTP_SERVER support.
query httpServer {
httpServer { addresses onlineClients remoteAccess mdnsHostname }
}httpServerChanged
Receive the current HTTP server snapshot on attachment and after listener, reported network-interface, online-client or preference changes. Requires an authenticated caller and HTTP_SERVER support. Cancel when leaving the page and reattach on return.
subscription httpServerChanged {
httpServerChanged { addresses onlineClients remoteAccess mdnsHostname }
}deviceNameUpdated
Receive the updated device display name.
subscription deviceNameUpdated {
deviceNameUpdated
}accessUpdated
Receive a change signal when device feature authorization changes.
subscription accessUpdated {
accessUpdated
}contentChanged
Receive a change signal when stored content changes.
subscription contentChanged {
contentChanged
}relaunchApp
Restart the PlainApp process on the device.
# The app restarts itself; the response only acknowledges that the
# request was accepted, since the connection dies with the process.
mutation relaunchApp {
relaunchApp
}requestAccess
Request device authorization for a supported feature; user interaction may be required on the device.
mutation requestAccess($feature: AccessFeature!) {
requestAccess(feature: $feature)
}setTempValue
Set a transient in-memory key/value pair and return it; it is not persistent Key Value data.
mutation setTempValue($key: String!, $value: String!) {
setTempValue(key: $key, value: $value) { key value }
}updateDeviceName
Change the device display name shown in the web UI and broadcast to paired peers.
# 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
Read application identity, configuration, capability and authorization fields. app.urlToken belongs to the calling session and encrypts resource links; it is not the GraphQL authentication token.
# 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 }
}