PlainApp
API குறிப்பு

பொமொடோரோ

அம்ச ஆதரவிற்கு app.capabilities-ஐயும் அனுமதிக்கு app.access மற்றும் host அனுமதிகளையும் சரிபார்க்கவும். எடுத்துக்காட்டுகள் செயற்கை மதிப்புகளைப் பயன்படுத்துகின்றன; அழைப்பதற்கு முன் பாதைகள், ID-கள், உள்ளீடுகள் மற்றும் வடிப்பான்களை மாற்றவும்.

வகை வரையறைகள்

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

செயல்பாடுகள்

subscription

pomodoroSettingsChanged

பொமொடோரோ அமைப்புகள் மாறும்போது மாற்றச் சைகையைப் பெறவும்.

graphql
subscription pomodoroSettingsChanged {
  pomodoroSettingsChanged
}
subscription

pomodoroAction

பொமொடோரோ நேரங்காட்டிச் செயல்களின் புதுப்பிப்புகளைப் பெறவும்.

graphql
subscription pomodoroAction {
  pomodoroAction { completedState }
}
mutation

pausePomodoro

இயங்கும் பொமொடோரோ நேரங்காட்டியை இடைநிறுத்தவும்.

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

setPomodoroRemainingTime

இயங்கும் அல்லது இடைநிறுத்தப்பட்ட நேரங்காட்டியின் மீதமுள்ள நேரத்தை பூஜ்ஜியம் முதல் தற்போதைய சுற்றின் கால அளவு வரை வினாடிகளில் அமைக்கவும்.

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

startPomodoro

கொடுக்கப்பட்ட வினாடி கால அளவுடன் பொமொடோரோ நேரங்காட்டியைத் தொடங்கவும்.

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

stopPomodoro

பொமொடோரோ நேரங்காட்டியை நிறுத்தி தற்போதைய சுற்றை மீட்டமைக்கவும்.

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

pomodoroSettings

சேமிக்கப்பட்ட பொமொடோரோ அமைப்புகளைப் பெறவும் (கால அளவுகள், தானாகத் தொடங்கும் கொடிகள், சுற்றுகள்).

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

pomodoroToday

இன்றைய இயக்கநேரத் தகவலைப் பெறவும்: முடிந்த சுற்றுகள், தற்போதைய கட்டம், மீதமுள்ள நேரம் மற்றும் இயங்கும் நிலை.

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