1 import { JobState } from '../../../shared/models'
2 import { exists } from './misc'
3 import { jobTypes } from '@server/lib/job-queue/job-queue'
5 const jobStates: JobState[] = [ 'active', 'completed', 'failed', 'waiting', 'delayed', 'paused' ]
7 function isValidJobState (value: JobState) {
8 return exists(value) && jobStates.includes(value)
11 function isValidJobType (value: any) {
12 return exists(value) && jobTypes.includes(value)
15 // ---------------------------------------------------------------------------