Pomodoro
Vérifier app.capabilities pour la prise en charge des fonctionnalités et app.access ainsi que les permissions de l’hôte pour les autorisations. Les exemples utilisent des valeurs synthétiques ; remplacer les chemins, ID, entrées et filtres avant tout appel.
Définitions de types
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!
}Opérations
pomodoroSettingsChanged
Recevoir un signal lorsque les paramètres Pomodoro changent.
subscription pomodoroSettingsChanged {
pomodoroSettingsChanged
}pomodoroAction
Recevoir les mises à jour d’actions du minuteur Pomodoro.
subscription pomodoroAction {
pomodoroAction { completedState }
}pausePomodoro
Mettre en pause le minuteur Pomodoro actif.
mutation pausePomodoro {
pausePomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}setPomodoroRemainingTime
Définir le temps restant du minuteur actif ou en pause, en secondes, entre zéro et la durée du cycle actuel.
mutation setPomodoroRemainingTime($remainingSec: Int!) {
setPomodoroRemainingTime(remainingSec: $remainingSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}startPomodoro
Démarrer un minuteur Pomodoro avec la durée fournie en secondes.
mutation startPomodoro($durationSec: Int!) {
startPomodoro(durationSec: $durationSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}stopPomodoro
Arrêter le minuteur Pomodoro et réinitialiser le cycle actuel.
mutation stopPomodoro {
stopPomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}pomodoroSettings
Obtenir les paramètres Pomodoro enregistrés (durées, indicateurs de démarrage automatique, cycles).
query pomodoroSettings {
pomodoroSettings { workDurationMin shortBreakDurationMin longBreakDurationMin pomodorosBeforeLongBreak showNotification playSoundOnComplete soundPath originalSoundName }
}pomodoroToday
Obtenir les informations d’exécution du jour : cycles terminés, phase actuelle, temps restant et état de fonctionnement.
query pomodoroToday {
pomodoroToday { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}