API-Referenz

App

Funktionsunterstützung über app.capabilities prüfen, Autorisierung über app.access und Host-Berechtigungen. Die Beispiele verwenden synthetische Werte; vor dem Aufruf Pfade, IDs, Eingaben und Filter ersetzen.

Typdefinitionen

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

Operationen

mutation

clearAppCache

Löscht wiederherstellbare Cachedateien der Anwendung.

graphql
mutation clearAppCache {
  clearAppCache
}
mutation

restartHttpServer

HTTP/HTTPS-Ports ändern und auf betriebsbereite Listener warten. Erfordert HTTP_SERVER. Gibt die tatsächlich gebundenen Ports zurück; bei geänderter Adresse neu verbinden.

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

appCacheSize

Gibt die Cachebelegung der Anwendung in Byte zurück.

graphql
query appCacheSize {
  appCacheSize
}
query

appUpdate

Liest Informationen über verfügbare Anwendungsupdates.

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

httpServer

HTTP/HTTPS-Status, LAN-Adressen, verbundene Clients und Fernzugriffsstatus lesen. Erfordert einen authentifizierten Aufrufer und HTTP_SERVER.

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

httpServerChanged

Empfangen Sie den aktuellen HTTP-Serverzustand beim Abonnieren sowie nach Änderungen an Listenern, Netzwerk, Online-Clients oder Einstellungen. Erfordert einen authentifizierten Aufrufer und HTTP_SERVER-Unterstützung. Beim Verlassen der Seite abbestellen und bei der Rückkehr erneut abonnieren.

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

deviceNameUpdated

Empfängt den aktualisierten Anzeigenamen des Geräts.

graphql
subscription deviceNameUpdated {
  deviceNameUpdated
}
subscription

accessUpdated

Empfängt ein Änderungssignal bei geänderter Autorisierung von Gerätefunktionen.

graphql
subscription accessUpdated {
  accessUpdated
}
subscription

contentChanged

Empfängt ein Änderungssignal bei geänderten gespeicherten Inhalten.

graphql
subscription contentChanged {
  contentChanged
}
mutation

relaunchApp

Startet den PlainApp-Prozess auf dem Gerät neu.

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

Fordert die Geräteautorisierung für eine unterstützte Funktion an. Eine Benutzeraktion auf dem Gerät kann erforderlich sein.

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

setTempValue

Setzt ein flüchtiges Schlüssel/Wert-Paar im Arbeitsspeicher und gibt es zurück. Dies sind keine persistenten Key-Value-Daten.

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

updateDeviceName

Ändert den im Web angezeigten Gerätenamen und verteilt ihn an gekoppelte Geräte.

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

Liest Identität, Konfiguration, Fähigkeiten und Autorisierungsfelder der Anwendung. app.urlToken gehört zur aufrufenden Sitzung und verschlüsselt Ressourcenlinks; es ist kein GraphQL-Authentifizierungstoken.

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