API-Referenz

Pomodoro

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 Subscription {
  pomodoroSettingsChanged: Boolean!
  pomodoroAction: PomodoroAction!
}

type Mutation {
  pausePomodoro: PomodoroToday!
  setPomodoroRemainingTime(remainingSec: Int!): PomodoroToday!
  startPomodoro(durationSec: Int!): PomodoroToday!
  stopPomodoro: PomodoroToday!
}

type Query {
  pomodoroSettings: PomodoroSettings!
  pomodoroToday: PomodoroToday!
}

scalar Instant

type PomodoroAction {
	today: PomodoroToday!
	completedState: PomodoroState
}

type PomodoroSettings {
	workDurationMin: Int!
	shortBreakDurationMin: Int!
	longBreakDurationMin: Int!
	pomodorosBeforeLongBreak: Int!
	showNotification: Boolean!
	playSoundOnComplete: Boolean!
	soundPath: String!
	originalSoundName: String!
}

enum PomodoroState {
	WORK
	SHORT_BREAK
	LONG_BREAK
}

type PomodoroToday {
	date: Instant!
	completedCount: Int!
	currentRound: Int!
	timeLeftSec: Int!
	totalTimeSec: Int!
	isRunning: Boolean!
	isPaused: Boolean!
	state: PomodoroState!
}

Operationen

subscription

pomodoroSettingsChanged

Empfängt ein Änderungssignal bei geänderten Pomodoro-Einstellungen.

graphql
subscription pomodoroSettingsChanged {
  pomodoroSettingsChanged
}
subscription

pomodoroAction

Empfängt Aktualisierungen der Pomodoro-Timeraktionen.

graphql
subscription pomodoroAction {
  pomodoroAction { completedState }
}
mutation

pausePomodoro

Pausiert den laufenden Pomodoro-Timer.

graphql
mutation pausePomodoro {
  pausePomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}
mutation

setPomodoroRemainingTime

Setzt die verbleibende Zeit eines laufenden oder pausierten Timers in Sekunden zwischen 0 und der Dauer der aktuellen Runde.

graphql
mutation setPomodoroRemainingTime($remainingSec: Int!) {
  setPomodoroRemainingTime(remainingSec: $remainingSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}
mutation

startPomodoro

Startet einen Pomodoro-Timer mit der angegebenen Dauer in Sekunden.

graphql
mutation startPomodoro($durationSec: Int!) {
  startPomodoro(durationSec: $durationSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}
mutation

stopPomodoro

Stoppt den Pomodoro-Timer und setzt die aktuelle Runde zurück.

graphql
mutation stopPomodoro {
  stopPomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}
query

pomodoroSettings

Liest gespeicherte Pomodoro-Einstellungen: Zeitdauern, Autostart-Flags und Runden.

graphql
query pomodoroSettings {
  pomodoroSettings { workDurationMin shortBreakDurationMin longBreakDurationMin pomodorosBeforeLongBreak showNotification playSoundOnComplete soundPath originalSoundName }
}
query

pomodoroToday

Liest den heutigen Laufzeitstatus: abgeschlossene Runden, aktuelle Phase, Restzeit und Betriebszustand.

graphql
query pomodoroToday {
  pomodoroToday { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}