API Referansı

Pomodoro

Yerleşik Pomodoro zamanlayıcısını kontrol edin: ayarları okuyun, bugünün ilerlemesini inceleyin ve mevcut oturumu başlatın/duraklatın/durdurun.

Tip Tanımları

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
}

İşlemler

query

pomodoroSettings

Saklanan Pomodoro ayarlarını alın (süreler, otomatik başlatma bayrakları, turlar).

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

pomodoroToday

Bugünün çalışma zamanı bilgilerini alın: tamamlanan turlar, mevcut aşama, kalan süre ve çalışma durumu.

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

startPomodoro

Pomodoro zamanlayıcısını başlatın. Duraklatılmış bir durumdan devam etmek için timeLeft (saniye) veya yeni bir başlangıç için 0 geçirin.

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

pausePomodoro

Çalışan Pomodoro zamanlayıcısını duraklatın.

bash
mutation PausePomodoro {
  pausePomodoro
}
mutation

stopPomodoro

Pomodoro zamanlayıcısını durdurun ve mevcut turu sıfırlayın.

bash
mutation StopPomodoro {
  stopPomodoro
}