Referência da API

Pomodoro

Controle o timer Pomodoro integrado: leia configurações, inspecione o progresso de hoje e inicie/pause/pare a sessão atual.

Definições de Tipo

bash
type PomodoroSettings {
  workDuration: Int!          # minutes
  shortBreak: Int!            # minutes
  longBreak: Int!             # minutes
  roundsBeforeLongBreak: Int!
  autoStartBreaks: Boolean!
  autoStartWork: Boolean!
}

type PomodoroToday {
  date: String!               # ISO date (YYYY-MM-DD)
  completedCount: Int!        # completed work rounds today
  currentRound: Int!
  timeLeft: Int!              # seconds remaining in the current phase
  totalTime: Int!             # seconds elapsed in the current phase
  isRunning: Boolean!
  isPause: Boolean!
  state: PomodoroState!       # WORK | SHORT_BREAK | LONG_BREAK | PAUSED
}

enum PomodoroState {
  WORK
  SHORT_BREAK
  LONG_BREAK
  PAUSED
}

Operações

query

pomodoroSettings

Obtenha as configurações de Pomodoro armazenadas (durações, flags de auto-início, rounds).

bash
query GetPomodoroSettings {
  pomodoroSettings {
    workDuration shortBreak longBreak roundsBeforeLongBreak
    autoStartBreaks autoStartWork
  }
}
query

pomodoroToday

Obtenha as informações de runtime de hoje: rounds concluídos, fase atual, tempo restante e estado de execução.

bash
query GetPomodoroToday {
  pomodoroToday {
    date completedCount currentRound timeLeft totalTime isRunning isPause state
  }
}
mutation

startPomodoro

Inicie o timer Pomodoro. Passe timeLeft (segundos) para retomar de um estado pausado, ou 0 para um início limpo.

bash
mutation StartPomodoro($timeLeft: Int!) {
  startPomodoro(timeLeft: $timeLeft)
}
mutation

pausePomodoro

Pause o timer Pomodoro em execução.

bash
mutation PausePomodoro {
  pausePomodoro
}
mutation

stopPomodoro

Pare o timer Pomodoro e redefina o round atual.

bash
mutation StopPomodoro {
  stopPomodoro
}